Hi~ there. I've built SEMS and SER on the REDHAT 9.0, and made them inter-communicate with unix_sock. But when I redirected the INVITE || ACK || CANCEL || BYE requests to SEMS, and load a number_reader plug-in for test, the problem occurs. The SER conf file includes these: # select messages to redirect: if ( method=="ACK" || method=="INVITE" || method=="BYE" || method=="CANCEL" ){
# switch to stateful mode: if (!t_newtran()){ sl_send_reply("500","could not create transaction"); break; };
# prevent timeout on the other side: t_reply("100","Trying - just wait a minute !");
if (method=="INVITE"){
# redirect the call to the 'number_reader' plug-in # if the URI begin with 100 if (uri=~"sip:100.*@") {
# assumes that Sems configuration parameter 'socket_name=' # has been set to /tmp/am_sock if(!t_write_unix("/tmp/am_sock","number_reader")) { t_reply("500","error contacting sems"); }; break; };
# redirect the call to the 'announcement' plug-in # if the URI begin with 200 if (uri=~"sip:200.*@") {
if(!t_write_unix("/tmp/am_sock","announcement")) { t_reply("500","error contacting sems"); }; break; };
# no service number, redirect to number_reader. # do not forget to load AVPs so that voicemail gets the # callee's email address. #load_avp("ruri","email",0); if(!t_write_unix("/tmp/am_sock","number_reader")) { t_reply("500","error contacting sems"); }; break; } else if (method=="BYE" || method=="CANCEL") {
# Sems should already know which plug-in is handling that # call. "bye" is no plug-in name. It is a reserved name which # tells Sems to terminate the call.
if(!t_write_unix("/tmp/am_sock","bye")) { t_reply("500","error contacting sems"); }; }; };
I used a soft phone to connect with the server. The SIP messages seems OK, the INVITE, 100, 200, ACK messages are exchanged, connection established, G711u codec is used to transfer. But the RTP stage seems wrong. In the sniffer only the soft phone's RTP packets are sent, but none of the server's response received. In the debug mode it seems the SEMS sent the response to socket, but the SER throw some error messages.
# ser -d -E 127.0.0.1 [127.0.0.1]:5060 0(1926) WARNING: fix_socket_list: could not rev. resolve 10.167.16.32 10.167.16.32 [10.167.16.32]:5060 127.0.0.1 [127.0.0.1]:5060 0(1926) WARNING: fix_socket_list: could not rev. resolve 10.167.16.32 10.167.16.32 [10.167.16.32]:5060 Listening on udp: 127.0.0.1 [127.0.0.1]:5060 udp: 10.167.16.32 [10.167.16.32]:5060 tcp: 127.0.0.1 [127.0.0.1]:5060 tcp: 10.167.16.32 [10.167.16.32]:5060 Aliases: tcp: localhost:5060 tcp: localhost.localdomain:5060 tcp: VM-Redhat:5060 udp: localhost:5060 udp: localhost.localdomain:5060 udp: VM-Redhat:5060
stateless - initializing [root@VM-Redhat root]# 0(0) Maxfwd module- initializing 0(0) INFO: udp_init: SO_RCVBUF is initially 65535 0(0) INFO: udp_init: SO_RCVBUF is finally 131070 0(0) INFO: udp_init: SO_RCVBUF is initially 65535 0(0) INFO: udp_init: SO_RCVBUF is finally 131070 1(1929) to: 1(1929) ERROR: tsend_dgram: failed to send: (107) Transport endpoint is not connected 16(1944) ERROR: tsend_dgram: failed to send: (22) Invalid argument
While sending the RTP packet, the terminate also sent some RTCP packets, but a ICMP port unreachable response received.
By the way, when the BYE request is sent, a first 404 response received, then the 200 OK. Maybe the conf files are not correct?