[OpenSIPS-Users] OpenSIPS 1.6.0 + drouting module crash

Marco Nesler marco.nesler at gmail.com
Mon Nov 30 14:47:15 CET 2009


hi all,
we are setting up an opensips 1.6.0 server as core sip router for our
internal voip system, we found some strange conditions in which
opensips crashes, here the scenario:
Two asterisk 1.4 servers acting as media gateways to the PSTN, a
single openips 1.6.0 server acting as registrar server for the voip
phones and router for the calls. In Opensips we also implemented
drouting to obtain some resilience, the call is first routed through
the first asterisk, if it fails then the second one will be used.

Here the opensips config:

route[7]{
        do_routing("2","0");
        t_on_failure("10") ;
        t_relay() ;
        exit ;
}

failure_route[10]{
        if(t_was_cancelled() ) {
                exit ;
        }

        if( t_check_status("[56][0-9][0-9]") || t_check_status("409") ) {
                if(use_next_gw()) {
                        t_on_failure("10") ;
                        t_relay() ;
                        exit ;
                }
                t_reply("503","Service not available, no more gateways") ;
                exit ;
        }
        exit ;
}

The configuration works pretty well but we discovered that sometimes
the opensips server crashes, looking at the sip signalling we found
this strange behavior.
First a correct call, this one works flawlessly:
Opensips TO Asterisk => INVITE
Asterisk TO Opensips => 100 Trying
[ISDN side, here the call fails]
Asterisk TO Opensips => 503 Service Unavailable
Opensips TO Asterisk => ACK
Then opensips tries the next gw and all goes flawlessly.

Now the call that crashes the opensips:
Opensips TO Asterisk => INVITE
Asterisk TO Opensips => 100 Trying
[ISDN side, here the call fails]
Asterisk TO Opensips => 183 Session Progress
Asterisk TO Opensips => 183 Session Progress
Asterisk TO Opensips => 503 Service Unavailable
Opensips TO Asterisk => ACK
[Opensips crashes]
At this point opensips crashes in the failure_route when trying the
next gateway.

Nov 30 14:26:12 opensips1-tst /sbin/opensips[1111]:
DBG:core:_shm_resize: resize(0) called
Nov 30 14:26:13 opensips1-tst /sbin/opensips[1119]:
CRITICAL:core:receive_fd: EOF on 9
Nov 30 14:26:13 opensips1-tst /sbin/opensips[1106]:
INFO:core:handle_sigs: child process 1111 exited by a signal 11
Nov 30 14:26:13 opensips1-tst /sbin/opensips[1119]:
DBG:core:handle_ser_child: dead child 4, pid 1111 (shutting down?)
Nov 30 14:26:13 opensips1-tst /sbin/opensips[1106]:
INFO:core:handle_sigs: core was generated
Nov 30 14:26:13 opensips1-tst /sbin/opensips[1119]:
DBG:core:io_watch_del: io_watch_del (0x8180140, 9, -1, 0x0) fd_no=15
called
Nov 30 14:26:13 opensips1-tst /sbin/opensips[1106]:
INFO:core:handle_sigs: terminating due to SIGCHLD


Basically every time opensips receives a 183 and then a 503 it crashes.

If we setup a simple onreply route and drop the 183 responses:
onreply_route[2] {
        xlog("incoming reply\n");
        if( t_check_status("183") ) {
                drop() ;
        }
}
Then the call is correctly handled and the module does not crash
anymore... is this normal ?

thanks
marco



More information about the Users mailing list