Published on iptel.org (http://www.iptel.org)

sms

By greger
Created 2006-11-26 10:18

Standard-dep

This module provides a way of communication between SIP network (via SIP MESSAGE) and GSMi [1] networks (via ShortMessageService). Communication is possible from SIP to SMS and vice versa. The module provides facilities like SMS confirmation--the gateway can confirm to the SIP user if his message really reached its destination as a SMS--or multi-part messages--if a SIP messages is too long it will be split and sent as multiple SMS.


Bogdan Iancu


i [2] networks (via ShortMessageService). Communication is possible from SIP to SMS and vice versa. The module provides facilities like SMS confirmation--the gateway can confirm to the SIP user if his message really reached its destination as a SMS--or multi-part messages--if a SIP messages is too long it will be split and sent as multiple SMS.

Errors occurred because of an invalid number or a too long message or because of an internal modem malfunction are reported back to the SIP user via a SIP message containing explanations regarding the error.

Section 1.4, “Functions” [3]).

i [4] require it.

Default is 0 (no).

Example 7. Set use_contact parameter

...
modparam("sms", "use_contact", 1)
...

1.3.8. sms_report_type (integer)

If the modem should ask for SMS confirmation from the SMS Center. If the SMSC reply with an error code, the gateway will send back to SIP user a SIP message containing the text (or part of it) that couldn't be send. Two report mechanisms are implemented:

  • 1 - the reports are delivered by the GSM device as SMS reports (so far supported only by Nokia modems);

  • 2 - the reports are delivered as async. CDS responses (supported by almost all modems, except Ericsson).

Default is 0 (no report).

Example 8. Set sms_report_type parameter

...
modparam("sms", "sms_report_type", 1)
...

1.4. Functions

Revision History
Revision $Revision: 1.2 $ $Date: 2005/08/24 13:24:34 $

1.4.1. sms_send_msg_to_net(network_name)

Put the SIP msg in the specified network queue. The function return error if the number encapsulated into SIP message is malformed, if the content_type is incorrect or because of some internal failures.

Meaning of the parameters is as follows:

  • network_name - Name of network.

Example 9. sms_send_msg_to_net usage

...
if (sms_send_msg_to_net("D1"))
{
    if (!t_reply("202", "yes sir, SMS sent over"))
    {
        # if replying failed, retry statelessly
        sl_reply_error();
    };
} else {
    if (!t_reply("502", "Bad gateway - SMS error"))
    {
        # if replying failed, retry statelessly
        sl_reply_error();
    };
    break;
};
...

1.4.2. sms_send_msg()

The same as the previous one, but use the default network queue.

Example 10. sms_send_msg usage

...
if (sms_send_msg_to_net())
{
    if (!t_reply("202", "yes sir, SMS sent over"))
    {
        # if replying failed, retry statelessly
        sl_reply_error();
    };
} else {
    if (!t_reply("502", "Bad gateway - SMS error"))
    {
        # if replying failed, retry statelessly
        sl_reply_error();
    };
    break;
};
...