[Serusers] Problem with ACK

Amozurrutia Jesus jamozurrutia at mcmtelecom.com.mx
Mon Dec 27 23:33:42 CET 2004


The loose route in my config is located before any sl_send_reply, but the
ACK is not being processed as loose route. why?
Should I include something like:

if (method=="ACK") {
        t_relay();
        break;
};


My config file is:

######################################################################
# SER Config File
######################################################################

check_via=no    # (cmd. line: -v)
dns=no           # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
fifo="/tmp/ser_fifo"

######################################################################
# Load Modules
######################################################################

# Uncomment this if you want to use SQL database
loadmodule "/usr/lib/ser/modules/sl.so"         /*Stateless routing*/
loadmodule "/usr/lib/ser/modules/tm.so"         /*Statefull routing*/ 
loadmodule "/usr/lib/ser/modules/acc.so"        /*Accounting*/
loadmodule "/usr/lib/ser/modules/rr.so"         /*Record Routing*/
loadmodule "/usr/lib/ser/modules/maxfwd.so"     /*Max-fwd header logic*/
loadmodule "/usr/lib/ser/modules/usrloc.so"     /*User Location*/
loadmodule "/usr/lib/ser/modules/registrar.so"  /*SIP Register functions*/
loadmodule "/usr/lib/ser/modules/exec.so"       /*Execute external
commands*/
loadmodule "/usr/lib/ser/modules/mysql.so"      /*MySQL DB Module*/
# MySQL dependant modules
loadmodule "/usr/lib/ser/modules/auth.so"       /*User authentication*/
loadmodule "/usr/lib/ser/modules/auth_db.so"    /*User auth. using MySQL
DB*/
loadmodule "/usr/lib/ser/modules/group.so"      /*Group commands*/
  
######################################################################
# Establecer parametros para los modulos
######################################################################

# -- usrloc params --
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url", "sql://user:pass@localhost/db")

# -- auth params --
modparam("auth_db", "db_url", "sql://user:pass@localhost/db")
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")

# -- rr params --
modparam("rr", "enable_full_lr", 0)

# -- group params --
modparam("group", "db_url", "sql://user:pass@localhost/db")

# -- accounting params --
modparam("acc", "log_level", 3)
modparam("acc", "db_url", "mysql://user:pass@localhost/db")
modparam("acc", "db_flag", 2) 
modparam("acc", "db_missed_flag", 3)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)

######################################################################
# Server Aliases
######################################################################
alias="mydomain.com"

######################################################################
# Main Routing Logic
######################################################################

route{

        ##################################################
        # Initial sanity checks -- messages with
        # max_forwards==0, or excessively long requests
        ##################################################
        if (!mf_process_maxfwd_header("15")) {
                sl_send_reply("483","Too Many Hops");
                break;
        };
        if ( msg:len > max_len ) {  
                sl_send_reply("513", "Message too big");
                break;
        };

        ##################################################
        # Loose-route processing
        ##################################################
        if (loose_route()) {
                setflag(2);
                t_relay();
                break;
        };
                
        ##################################################
        # We record-route all messages
        ##################################################
        if (method=="INVITE") {
                record_route();
        };

        ##################################################
        # Registering routines start here
        ##################################################
        if (method=="REGISTER") {
                if (!src_ip==server2.mydomain.com) {
                        if (!www_authorize("mydomain.com", "subscriber")) {
                                www_challenge("mydomain.com", "0");
                                break;
                        };
                        t_replicate("server2.mydomain.com", "5060");
                };
                save("location");
                break;
        };

        ##################################################
        # Check the source of call and auth. if required
        ##################################################
        # If the call comes from the gateways, no authentication is required
        if (src_ip==gateway.mydomain.com ) {
                log(1,"Call from pstn. \n");
        } else {
                if (method=="INVITE") {
                        if (!proxy_authorize("mydomain.com", "subscriber"))
{
                                proxy_challenge("mydomain.com", "0");
                                break;
                        };
                };
        }

        ##################################################
        # Route call
        ##################################################
        if (uri=~"^sip:59803[0-9][0-9][0-9]@.*") {
                if (!lookup("location")) {
                        sl_send_reply("404", "Not Found");
                        break;
                } else {
                        if (!t_relay()) {
                                sl_reply_error();
                        };
                };
        } else if (uri=~"^sip:[0|1|2|3|5|8|9][0-9]*@.*") {
                rewritehost("gateway.mydomain.com");
                t_relay();
        };
}


-----Original Message-----
From: Greger V. Teigre [mailto:greger at teigre.com]
Sent: Viernes, 24 de Diciembre de 2004 01:32 a.m.
To: Amozurrutia Jesus; serusers at lists.iptel.org
Subject: Re: [Serusers] Problem with ACK


The ACK has a Route header that is supposed to be picked up by the loose 
route part of your config.  If the loose route call is not reached before 
you do other processing, the ACK may be dropped...
Route: <sip:5559853979 at X.X.84.93;ftag=2413706159;lr>
g-)

Amozurrutia Jesus wrote:
> I double checked and the ACK are ignored by SER.
>
> The log file thows this:
> Dec 23 13:26:13 sip2 /usr/sbin/ser[21127]: Warning: sl_send_reply: I
> won't send a reply for ACK!!
>
>
> Jesus
>
> -----Original Message-----
> From: Greger V. Teigre [mailto:greger at teigre.com]
> Sent: Lunes, 20 de Diciembre de 2004 01:43 a.m.
> To: Amozurrutia Jesus; serusers at lists.iptel.org
> Subject: Re: [Serusers] Problem with ACK
>
>
> Are you sure that the ACK stops at ser?  The ACKs should just flow
> through ser.  I have seen a similar problem with XLite where Cisco
> drops the ACK because XLite there is a bug in XLIte's Via parsing.
> This is a Cisco gateway appending an x-route-tag to via.  Turn on
> debugging (ALL) on Cisco and check if it drops the ACK due to
> wrong/no branch info in Via.
> g-)
>
> Amozurrutia Jesus wrote:
>> I'm implementing the scenario shown below.
>>
>>   ___      ______
>>  / 0 \ ---/      \   |
>>   /_\     | ATA1 |---|    ____     _  _  _  _     _____
>>           \______/   |   /    \   / \/ \/ \/ \   /     \
>>                      |---| FW |---|  IP Net  |---| CCM |
>>                      |   \____/   \_/\_/\_/\_/   \_____/
>>                      |             |        |
>>                      |             |        |
>>                                    |        |
>>                                   ---      ---
>>                                  /   \    /   \
>>                                  |NAT|    |SER|
>>                                  |-T |    |   |
>>                                  \___/    \___/
>>
>> When calling between the CCM (Cisco CallManager) and the ATA, SER
>> simply ignores the call ACK.
>> The ACK looks like:
>>
>>  ACK sip:5559853979*sip1.mcm.net.mx=X.X.71.2+17081 at X.X.81.92:5063
>>  SIP/2.0 Via: SIP/2.0/UDP  X.X.67.218:5060;branch=z9hG4bK29b2c750
>>  From: "5559852600" <sip:5559852600 at X.X.67.218>;tag=16781758
>>  To: <sip:5559853979 at mcm.net.mx>;tag=2602576443
>>  Date: Tue, 30 Nov 2004 23:53:15 GMT
>>  Call-ID: fef8ed00-1da1612d-24d-da4334c8 at X.X.67.218
>>  Route: <sip:5559853979 at X.X.81.94;ftag=16781758;lr>
>>  Max-Forwards: 70
>>  CSeq: 101 ACK
>>  Content-Length: 0
>>
>> The call flow:
>>
>>     CallManager         SIP Server             ATA
>>          |                   |                   |
>>          |-- INVITE -------->|                   |
>>          |<-- trying --------|                   |
>>          |                   |-- INVITE -------->|
>>          |                   |<-- Trying --------|
>>          |                   |<-- Ringing -------|
>>          |<-- Ringing -------|                   |
>>          |                   |<-- OK ------------|
>>          |<-- OK ------------|                   |
>>          |-- ACK ----------->|                   |
>>          |                   |<-- OK ------------|
>>          |<-- OK ------------|                   |
>>          |-- ACK ----------->|                   |
>>          |                   |<-- OK ------------|
>>          |<-- OK ------------|                   |
>>          |-- ACK ----------->|                   |
>>          |                   |<-- OK ------------|
>>          |<-- OK ------------|                   |
>>          |-- ACK ----------->|                   |
>>          |                   |<-- OK ------------|
>>                ......
>>
>> My guess is that SER does not accept the URI
>> "5559853979*sip1.mcm.net.mx=X.X.71.2+17081 at X.X.81.92:5063" because it
>> contains "*+=" signs ore something similar.
>> When calling from ATA - ATA there is no preoblem because ATAs
>> construct the ACK message different (URI and Rote flipped).
>>
>> Any ideas?
>>
>> Thanks in advance,
>>
>> Jesus
>>
>>
>> _______________________________________________
>> Serusers mailing list
>> serusers at lists.iptel.org
>> http://lists.iptel.org/mailman/listinfo/serusers 




More information about the sr-users mailing list