# Functions

## `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.

### `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;
    };
    ...

## `sms_send_msg()`

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

### `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;
    };
    ...