[Kamailio-Users] kamailio crashes

Panagiotis Skoulikaritis pskoul at algonet.gr
Wed Mar 10 15:30:11 CET 2010


Dear Marius

The scenario is as follows:

1.  A Call is placed by a sip subscriber "A"
2.  kamailio forwards the call to the asterisk server
3.  Asterisk plays an IVR message on the subscriber "A", creates a new 
call to a "virtual" number which is forwarded to the kamailio server, 
and plays an ivr to this leg as well when the call is answered, then it 
connects the two calls.
4.  Kamailio translates the "virtual" number to the pstn number of 
subscriber B


I have attached a picture of the above scenario.

The modules that are loaded are:

loadmodule "db_mysql.so"
loadmodule "mi_fifo.so"
loadmodule "mi_datagram.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "uri_db.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "acc.so"
loadmodule "dispatcher.so"
loadmodule "pdt.so"
loadmodule "dialplan.so"
loadmodule "siptrace.so"
loadmodule "dialog.so"
loadmodule "sqlops.so"
loadmodule "userblacklist.so"
loadmodule "htable.so"
loadmodule "uac.so"


The config that does all the routing is :

route[10] {

        xlog("alx ------- This is Route 10 -------");

        if($rU =~ "^.*%+")
        {
                xlog("alx ------- The number contains %23 ");
                $rU = $(rU{re.subst,/^(.*)%23(.*)/\1\2/});
                #$rU = $(rU{s.unescape.user}); #It changes the %23 to # !!
                xlog("alx ------- The perl  $rU ------- ");
        }

        if($rU =~ "^.*#+")
        {
                xlog("alx ------- The number contains #");
                $rU = $(rU{re.subst,/^(.*)#(.*)/\1\2/});
                #$rU = $(rU{s.unescape.user}); #It changes the %23 to # !!
                xlog("alx ------- The perl  $rU ------- ");
        }

        if(prefix2domain("2", "0")) {

                $var(dial_grp) = $(rd{s.select,0,.}{s.int}); # Dialplan 
group prefix for routing
                $var(num_pr) = $(rd{s.select,1,.}{s.int});  # The number 
of digits that prefix has
                $var(num_translation) = $(rd{s.select,2,.}{s.int});   # 
Called number translation
                $avp(s:port_translation) = $(rd{s.select,3,.}{s.int});   
# Port number translation
                #$var(test_var) = $(rd{s.select,4,.}{s.int});   # Future 
property

                $avp(s:cust_prefix) = $(rU{s.substr,0,$var(num_pr)});
                $rU = $(rU{s.substr,$var(num_pr),0});

        xlog("alx ------- The new rU is $rU and properties $rd -------");

        if($var(num_translation) == 1)
        {
                if($sht(a=>$rU)!=null){

                      $rU = $sht(a=>$rU);
                      xlog("alx ------- Translation Done. DST num=$rU  
----------");

                } else {
                        xlog("alx ------- Translation NOT Done  
----------");
                }


                        #xlog("alx ------- We have DST number 
translation for user fU $avp(s:frm_user_name)  ----------");
                        #if(dp_translate("31", "$rU/$rU"))
                        #{
                        #        xlog("alx ------- Translation Done. DST 
num=$rU ----------");
                        #} else {
                        #        xlog("alx ------- Translation NOT Done 
----------");
                        #}
        }

        if(dp_translate("$var(dial_grp)", "$rU/$rU"))
                {
                        xlog("alx ------- The $rU and with attributes 
:$avp(s:dest) -------\n");

                        $var(i) = 0;
                        while($(avp(s:dest){s.select,$var(i),.})!="#")
                        {
                                $avp(s:dstgrp) = 
$(avp(s:dest){s.select,$var(i),.}{s.int});
                                $var(i) = $var(i) + 1;
                                xlog("alx ------- The 
avp(s:dstgrp)=$avp(s:dstgrp) var(i)=$var(i) -------");
                        }

                        # backup the username so we can use different 
prefixes
                        $avp(s:user) = $rU;

                        # select destination from first group
                                if(ds_select_domain("$avp(s:dstgrp)", "4"))
                                {
                                        if($(ru{uri.param,prefix})!=null)
                                                {
                                                                $ru = 
"sip:" + $(ru{uri.param,prefix})  +  $avp(s:user) + "@" + $rd;

                                                } else {
                                                                $ru = 
"sip:" + $avp(s:user) + "@" + $rd;
                                                }
                                }

                                $avp(s:dstgrp) = null;
                                        xlog("alx ------- The final RURI 
is $ru ------- ");
                                        if($avp(s:port_translation) == 1)
                                        {
                                                rewriteport("5061");
                                        }
                                        t_on_failure("3");
                                        t_relay();
                                        exit;

                }




        }


}

Attached is the trace

Regards.

P.

marius zbihlei wrote:
> Panagiotis Skoulikaritis wrote:
>> Hello Daniel
>>
>> the kamailio version is 1.5.3
>>
>> Regards
>>
>> P.
> Hello,
>
> Can you give us more details like the sip message that generates the 
> coredump (or if every sip message received generates the core), if 
> your config does something more out of the ordinary(let's say exotic). 
> Can we reproduce it ?
>
> It would also be helpful if you specify the list of modules you have 
> loaded.
>
> Cheers,
> Marius
>>
>> Daniel-Constantin Mierla wrote:
>>> Hello,
>> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kamailio trace-1.txt
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100310/80ca1c35/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: call scenario.jpg
Type: image/jpeg
Size: 13430 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100310/80ca1c35/attachment.jpg>


More information about the sr-users mailing list