Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on udp: 127.0.0.1:5080 tcp: 127.0.0.1:5060 tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080 -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.com SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080 ;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: sip:1010@my.domain.com. From: sip:1000@my.domain.com;tag=def4124455da8a0b8e97eafabd028e26-2c30. CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla <miconda@gmail.com
wrote:
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back. Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying.
####### Routing Logic ########
# Main SIP request routing logic # - processing of any incoming SIP request starts with this route route {
# per request initial checks route(REQINIT);
# NAT detection route(NAT);
# handle requests within SIP dialogs route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
if (is_method("MESSAGE")) { log(1,"-------------------------------------------------------->WE HAVE A NEW MESSAGE\n"); route(MSILO_MESSAGE); } t_check_trans();
# authentication route(AUTH);
# record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route();
# account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting }
# dispatch requests to foreign domains route(SIPOUT);
### requests for my local domains
# handle presence related requests route(PRESENCE);
# handle registrations route(REGISTRAR);
if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
# dispatch destinations to PSTN route(PSTN);
# user location service route(LOCATION);
route(RELAY); }
route[RELAY] { #!ifdef WITH_NAT if (check_route_param("nat=yes")) { setbflag(FLB_NATB); } if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) { route(RTPPROXY); } #!endif
/* example how to enable some additional event routes */ if (is_method("INVITE")) { #t_on_branch("BRANCH_ONE"); t_on_reply("REPLY_ONE"); t_on_failure("FAIL_ONE"); }
if (!t_relay()) { sl_reply_error(); } exit; }
##storing offline messages route[MSILO_MESSAGE]{ if (lookup("location")){ t_on_failure("FAIL_MESSAGE"); t_relay(); xlog("L_NOTICE","---------------------------------MI: ($mi), MB: ($mb)\n"); }else{ xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, storing offline message ID: ($ru)\n"); m_store("$ru"); sl_send_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, stored offline message ID: ($ru)\n"); }; exit; };
failure_route[FAIL_MESSAGE]{
xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be reached, storing offline message ID: ($ou)\n"); m_store("$ou"); t_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be reached, stored offline message ID: ($ou)\n"); exit; }
# Per SIP request initial checks route[REQINIT] { #!ifdef WITH_ANTIFLOOD # flood dection from same IP and traffic ban for a while # be sure you exclude checking trusted peers, such as pstn gateways # - local host excluded (e.g., loop to self) if(src_ip!=myself) { if($sht(ipban=>$si)!=$null) { # ip is already blocked xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n"); exit; } if (!pike_check_req()) { xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n"); $sht(ipban=>$si) = 1; exit; } } #!endif
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }
if(!sanity_check("1511", "7")) { xlog("Malformed SIP message from $si:$sp\n"); exit; } }
# Handle requests within SIP dialogs route[WITHINDLG] { if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { if (is_method("BYE")) { setflag(FLT_ACC); # do accounting ... setflag(FLT_ACCFAILED); # ... even if the transaction fails } route(RELAY); } else { if (is_method("SUBSCRIBE") && uri == myself) { # in-dialog subscribe requests route(PRESENCE); exit; } if ( is_method("ACK") ) { if ( t_check_trans() ) { # no loose-route, but stateful ACK; # must be an ACK after a 487 # or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction ... ignore and discard exit; } } sl_send_reply("404","Not here"); } exit; } }
# Handle SIP registrations route[REGISTRAR] { if (is_method("REGISTER")) { if(isflagset(FLT_NATS)) { setbflag(FLB_NATB); # uncomment next line to do SIP NAT pinging setbflag(FLB_NATSIPPING); } if (!save("location")) sl_reply_error(); # MSILO - dumping user's offline messages m_dump(); log(1,"-------------------------MESSAGE PROCESSING: dumping offline messages\n");
exit; } }
# USER location service route[LOCATION] {
#!ifdef WITH_ALIASDB # search in DB-based aliases alias_db_lookup("dbaliases"); #!endif
if (!lookup("location")) { switch ($rc) { case -1: case -3: t_newtran(); t_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } }
# when routing via usrloc, log the missed calls also if (is_method("INVITE")) { setflag(FLT_ACCMISSED); } }
# Presence server route route[PRESENCE] { if(!is_method("PUBLISH|SUBSCRIBE")) return;
#!ifdef WITH_PRESENCE if (!t_newtran()) { sl_reply_error(); exit; };
if(is_method("PUBLISH")) { handle_publish(); t_release(); } else if( is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); } exit; #!endif # if presence enabled, this part will not be executed if (is_method("PUBLISH") || $rU==$null) { sl_send_reply("404", "Not here"); exit; } return; }
# Authentication route route[AUTH] { #!ifdef WITH_AUTH if (is_method("REGISTER")) { # authenticate the REGISTER requests (uncomment to enable auth) if (!www_authorize("$td", "subscriber")) { www_challenge("$td", "0"); exit; }
if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else {
#!ifdef WITH_IPAUTH if(allow_source_address()) { # source IP allowed return; } #!endif
# authenticate if from local subscriber if (from_uri==myself) { if (!proxy_authorize("$fd", "subscriber")) { proxy_challenge("$fd", "0"); exit; } if (is_method("PUBLISH")) { if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { if ($au!=$fU) { sl_send_reply("403","Forbidden auth ID"); exit; } }
consume_credentials(); # caller authenticated } else { # caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (!uri==myself) { sl_send_reply("403","Not relaying"); exit; } } } #!endif return; }
# Caller NAT detection route route[NAT] { #!ifdef WITH_NAT force_rport(); if (nat_uac_test("19")) { if (method=="REGISTER") { fix_nated_register(); } else { fix_nated_contact(); } setflag(FLT_NATS); } #!endif return; }
# RTPProxy control route[RTPPROXY] { #!ifdef WITH_NAT if (is_method("BYE")) { unforce_rtp_proxy(); } else if (is_method("INVITE")){ rtpproxy_offer(); } if (!has_totag()) add_rr_param(";nat=yes"); #!endif return; }
# Routing to foreign domains route[SIPOUT] { if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(RELAY); } }
# PSTN GW routing route[PSTN] { #!ifdef WITH_PSTN # check if PSTN GW IP is defined if (strempty($sel(cfg_get.pstn.gw_ip))) { xlog("SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n"); return; }
# route to PSTN dialed numbers starting with '+' or '00' # (international format) # - update the condition to match your dialing rules for PSTN routing if(!($rU=~"^(+|00)[1-9][0-9]{3,20}$")) return;
# only local users allowed to call if(from_uri!=myself) { sl_send_reply("403", "Not Allowed"); exit; }
$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
route(RELAY); exit; #!endif
return; }
# XMLRPC routing #!ifdef WITH_XMLRPC route[XMLRPC] { # allow XMLRPC from localhost if ((method=="POST" || method=="GET") && (src_ip==127.0.0.1)) { # close connection only for xmlrpclib user agents (there is a bug in # xmlrpclib: it waits for EOF before interpreting the response). if ($hdr(User-Agent) =~ "xmlrpclib") set_reply_close(); set_reply_no_connect(); dispatch_rpc(); exit; } send_reply("403", "Forbidden"); exit; } #!endif
# Sample branch router branch_route[BRANCH_ONE] { xdbg("new branch at $ru\n"); }
# Sample onreply route onreply_route[REPLY_ONE] { xdbg("incoming reply\n"); #!ifdef WITH_NAT if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB)) && status=~"(183)|(2[0-9][0-9])") {
rtpproxy_answer(); } if (isbflagset("6")) { fix_nated_contact(); } #!endif }
# Sample failure route failure_route[FAIL_ONE] { #!ifdef WITH_NAT if (is_method("INVITE") && (isbflagset(FLB_NATB) || isflagset(FLT_NATS))) { unforce_rtp_proxy(); } #!endif
if (t_is_canceled()) { exit; }
# uncomment the following lines if you want to block client # redirect based on 3xx replies. ##if (t_check_status("3[0-9][0-9]")) { ##t_reply("404","Not found"); ## exit; ##}
# uncomment the following lines if you want to redirect the failed # calls to a different new destination ##if (t_check_status("486|408")) { ## sethostport("192.168.2.100:5060"); ## append_branch(); ## # do not set the missed call flag again ## t_relay(); ##} }
On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on udp: 127.0.0.1:5080 tcp: 127.0.0.1:5060 tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080 -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.com SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080 ;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: sip:1010@my.domain.com. From: sip:1000@my.domain.com;tag=def4124455da8a0b8e97eafabd028e26-2c30. CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that. Why isn't kamailio sending the message back through the TLS socket?
NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2 ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found
On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve petervnv1@gmail.com wrote:
And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back. Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying.
####### Routing Logic ########
# Main SIP request routing logic # - processing of any incoming SIP request starts with this route route {
# per request initial checks route(REQINIT);
# NAT detection route(NAT);
# handle requests within SIP dialogs route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
if (is_method("MESSAGE")) {
log(1,"-------------------------------------------------------->WE HAVE A NEW MESSAGE\n"); route(MSILO_MESSAGE); } t_check_trans();
# authentication route(AUTH);
# record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route();
# account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting }
# dispatch requests to foreign domains route(SIPOUT);
### requests for my local domains
# handle presence related requests route(PRESENCE);
# handle registrations route(REGISTRAR);
if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
# dispatch destinations to PSTN route(PSTN);
# user location service route(LOCATION);
route(RELAY); }
route[RELAY] { #!ifdef WITH_NAT if (check_route_param("nat=yes")) { setbflag(FLB_NATB); } if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) { route(RTPPROXY); } #!endif
/* example how to enable some additional event routes */ if (is_method("INVITE")) { #t_on_branch("BRANCH_ONE"); t_on_reply("REPLY_ONE"); t_on_failure("FAIL_ONE"); }
if (!t_relay()) { sl_reply_error(); } exit; }
##storing offline messages route[MSILO_MESSAGE]{ if (lookup("location")){ t_on_failure("FAIL_MESSAGE"); t_relay(); xlog("L_NOTICE","---------------------------------MI: ($mi), MB: ($mb)\n"); }else{ xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, storing offline message ID: ($ru)\n"); m_store("$ru"); sl_send_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, stored offline message ID: ($ru)\n"); }; exit; };
failure_route[FAIL_MESSAGE]{
xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be
reached, storing offline message ID: ($ou)\n"); m_store("$ou"); t_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be reached, stored offline message ID: ($ou)\n"); exit; }
# Per SIP request initial checks route[REQINIT] { #!ifdef WITH_ANTIFLOOD # flood dection from same IP and traffic ban for a while # be sure you exclude checking trusted peers, such as pstn gateways # - local host excluded (e.g., loop to self) if(src_ip!=myself) { if($sht(ipban=>$si)!=$null) { # ip is already blocked xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n"); exit; } if (!pike_check_req()) { xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n"); $sht(ipban=>$si) = 1; exit; } } #!endif
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }
if(!sanity_check("1511", "7")) { xlog("Malformed SIP message from $si:$sp\n"); exit; } }
# Handle requests within SIP dialogs route[WITHINDLG] { if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { if (is_method("BYE")) { setflag(FLT_ACC); # do accounting ... setflag(FLT_ACCFAILED); # ... even if the transaction fails } route(RELAY); } else { if (is_method("SUBSCRIBE") && uri == myself) { # in-dialog subscribe requests route(PRESENCE); exit; } if ( is_method("ACK") ) { if ( t_check_trans() ) { # no loose-route, but stateful ACK; # must be an ACK after a 487 # or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction ... ignore and discard exit; } } sl_send_reply("404","Not here"); } exit; } }
# Handle SIP registrations route[REGISTRAR] { if (is_method("REGISTER")) { if(isflagset(FLT_NATS)) { setbflag(FLB_NATB); # uncomment next line to do SIP NAT pinging setbflag(FLB_NATSIPPING); } if (!save("location")) sl_reply_error(); # MSILO - dumping user's offline messages m_dump(); log(1,"-------------------------MESSAGE PROCESSING: dumping offline messages\n");
exit;
} }
# USER location service route[LOCATION] {
#!ifdef WITH_ALIASDB # search in DB-based aliases alias_db_lookup("dbaliases"); #!endif
if (!lookup("location")) { switch ($rc) { case -1: case -3: t_newtran(); t_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } }
# when routing via usrloc, log the missed calls also if (is_method("INVITE")) { setflag(FLT_ACCMISSED); } }
# Presence server route route[PRESENCE] { if(!is_method("PUBLISH|SUBSCRIBE")) return;
#!ifdef WITH_PRESENCE if (!t_newtran()) { sl_reply_error(); exit; };
if(is_method("PUBLISH")) { handle_publish(); t_release(); } else if( is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); } exit; #!endif # if presence enabled, this part will not be executed if (is_method("PUBLISH") || $rU==$null) { sl_send_reply("404", "Not here"); exit; } return; }
# Authentication route route[AUTH] { #!ifdef WITH_AUTH if (is_method("REGISTER")) { # authenticate the REGISTER requests (uncomment to enable auth) if (!www_authorize("$td", "subscriber")) { www_challenge("$td", "0"); exit; }
if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else {
#!ifdef WITH_IPAUTH if(allow_source_address()) { # source IP allowed return; } #!endif
# authenticate if from local subscriber if (from_uri==myself) { if (!proxy_authorize("$fd", "subscriber")) { proxy_challenge("$fd", "0"); exit; } if (is_method("PUBLISH")) { if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { if ($au!=$fU) { sl_send_reply("403","Forbidden auth ID"); exit; } }
consume_credentials(); # caller authenticated } else { # caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (!uri==myself) { sl_send_reply("403","Not relaying"); exit; } } } #!endif return; }
# Caller NAT detection route route[NAT] { #!ifdef WITH_NAT force_rport(); if (nat_uac_test("19")) { if (method=="REGISTER") { fix_nated_register(); } else { fix_nated_contact(); } setflag(FLT_NATS); } #!endif return; }
# RTPProxy control route[RTPPROXY] { #!ifdef WITH_NAT if (is_method("BYE")) { unforce_rtp_proxy(); } else if (is_method("INVITE")){ rtpproxy_offer(); } if (!has_totag()) add_rr_param(";nat=yes"); #!endif return; }
# Routing to foreign domains route[SIPOUT] { if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(RELAY); } }
# PSTN GW routing route[PSTN] { #!ifdef WITH_PSTN # check if PSTN GW IP is defined if (strempty($sel(cfg_get.pstn.gw_ip))) { xlog("SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n"); return; }
# route to PSTN dialed numbers starting with '+' or '00' # (international format) # - update the condition to match your dialing rules for PSTN routing if(!($rU=~"^(+|00)[1-9][0-9]{3,20}$")) return;
# only local users allowed to call if(from_uri!=myself) { sl_send_reply("403", "Not Allowed"); exit; }
$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
route(RELAY); exit; #!endif
return; }
# XMLRPC routing #!ifdef WITH_XMLRPC route[XMLRPC] { # allow XMLRPC from localhost if ((method=="POST" || method=="GET") && (src_ip==127.0.0.1)) { # close connection only for xmlrpclib user agents (there is a bug in # xmlrpclib: it waits for EOF before interpreting the response). if ($hdr(User-Agent) =~ "xmlrpclib") set_reply_close(); set_reply_no_connect(); dispatch_rpc(); exit; } send_reply("403", "Forbidden"); exit; } #!endif
# Sample branch router branch_route[BRANCH_ONE] { xdbg("new branch at $ru\n"); }
# Sample onreply route onreply_route[REPLY_ONE] { xdbg("incoming reply\n"); #!ifdef WITH_NAT if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB)) && status=~"(183)|(2[0-9][0-9])") {
rtpproxy_answer(); } if (isbflagset("6")) { fix_nated_contact(); } #!endif }
# Sample failure route failure_route[FAIL_ONE] { #!ifdef WITH_NAT if (is_method("INVITE") && (isbflagset(FLB_NATB) || isflagset(FLT_NATS))) { unforce_rtp_proxy(); } #!endif
if (t_is_canceled()) { exit; }
# uncomment the following lines if you want to block client # redirect based on 3xx replies. ##if (t_check_status("3[0-9][0-9]")) { ##t_reply("404","Not found"); ## exit; ##}
# uncomment the following lines if you want to redirect the failed # calls to a different new destination ##if (t_check_status("486|408")) { ## sethostport("192.168.2.100:5060"); ## append_branch(); ## # do not set the missed call flag again ## t_relay(); ##} }
On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on udp: 127.0.0.1:5080 tcp: 127.0.0.1:5060 tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080 -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.com SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080 ;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: sip:1010@my.domain.com. From: sip:1000@my.domain.com;tag=def4124455da8a0b8e97eafabd028e26-2c30. CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Can anyone help please? I was supposed to have this server up and running hours ago and I can't think of anything to do next to help debug this.
Thanks
On Wed, Jul 16, 2014 at 7:01 PM, Peter Villeneuve petervnv1@gmail.com wrote:
I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that. Why isn't kamailio sending the message back through the TLS socket?
NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2 ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found
On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve petervnv1@gmail.com wrote:
And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back. Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying.
####### Routing Logic ########
# Main SIP request routing logic # - processing of any incoming SIP request starts with this route route {
# per request initial checks route(REQINIT);
# NAT detection route(NAT);
# handle requests within SIP dialogs route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
if (is_method("MESSAGE")) {
log(1,"-------------------------------------------------------->WE HAVE A NEW MESSAGE\n"); route(MSILO_MESSAGE); } t_check_trans();
# authentication route(AUTH);
# record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route();
# account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting }
# dispatch requests to foreign domains route(SIPOUT);
### requests for my local domains
# handle presence related requests route(PRESENCE);
# handle registrations route(REGISTRAR);
if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
# dispatch destinations to PSTN route(PSTN);
# user location service route(LOCATION);
route(RELAY); }
route[RELAY] { #!ifdef WITH_NAT if (check_route_param("nat=yes")) { setbflag(FLB_NATB); } if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) { route(RTPPROXY); } #!endif
/* example how to enable some additional event routes */ if (is_method("INVITE")) { #t_on_branch("BRANCH_ONE"); t_on_reply("REPLY_ONE"); t_on_failure("FAIL_ONE"); }
if (!t_relay()) { sl_reply_error(); } exit; }
##storing offline messages route[MSILO_MESSAGE]{ if (lookup("location")){ t_on_failure("FAIL_MESSAGE"); t_relay(); xlog("L_NOTICE","---------------------------------MI: ($mi), MB: ($mb)\n"); }else{ xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, storing offline message ID: ($ru)\n"); m_store("$ru"); sl_send_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, stored offline message ID: ($ru)\n"); }; exit; };
failure_route[FAIL_MESSAGE]{
xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be
reached, storing offline message ID: ($ou)\n"); m_store("$ou"); t_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be reached, stored offline message ID: ($ou)\n"); exit; }
# Per SIP request initial checks route[REQINIT] { #!ifdef WITH_ANTIFLOOD # flood dection from same IP and traffic ban for a while # be sure you exclude checking trusted peers, such as pstn gateways # - local host excluded (e.g., loop to self) if(src_ip!=myself) { if($sht(ipban=>$si)!=$null) { # ip is already blocked xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n"); exit; } if (!pike_check_req()) { xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n"); $sht(ipban=>$si) = 1; exit; } } #!endif
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }
if(!sanity_check("1511", "7")) { xlog("Malformed SIP message from $si:$sp\n"); exit; } }
# Handle requests within SIP dialogs route[WITHINDLG] { if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { if (is_method("BYE")) { setflag(FLT_ACC); # do accounting ... setflag(FLT_ACCFAILED); # ... even if the transaction fails } route(RELAY); } else { if (is_method("SUBSCRIBE") && uri == myself) { # in-dialog subscribe requests route(PRESENCE); exit; } if ( is_method("ACK") ) { if ( t_check_trans() ) { # no loose-route, but stateful ACK; # must be an ACK after a 487 # or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction ... ignore and discard exit; } } sl_send_reply("404","Not here"); } exit; } }
# Handle SIP registrations route[REGISTRAR] { if (is_method("REGISTER")) { if(isflagset(FLT_NATS)) { setbflag(FLB_NATB); # uncomment next line to do SIP NAT pinging setbflag(FLB_NATSIPPING); } if (!save("location")) sl_reply_error(); # MSILO - dumping user's offline messages m_dump(); log(1,"-------------------------MESSAGE PROCESSING: dumping offline messages\n");
exit;
} }
# USER location service route[LOCATION] {
#!ifdef WITH_ALIASDB # search in DB-based aliases alias_db_lookup("dbaliases"); #!endif
if (!lookup("location")) { switch ($rc) { case -1: case -3: t_newtran(); t_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } }
# when routing via usrloc, log the missed calls also if (is_method("INVITE")) { setflag(FLT_ACCMISSED); } }
# Presence server route route[PRESENCE] { if(!is_method("PUBLISH|SUBSCRIBE")) return;
#!ifdef WITH_PRESENCE if (!t_newtran()) { sl_reply_error(); exit; };
if(is_method("PUBLISH")) { handle_publish(); t_release(); } else if( is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); } exit; #!endif # if presence enabled, this part will not be executed if (is_method("PUBLISH") || $rU==$null) { sl_send_reply("404", "Not here"); exit; } return; }
# Authentication route route[AUTH] { #!ifdef WITH_AUTH if (is_method("REGISTER")) { # authenticate the REGISTER requests (uncomment to enable auth) if (!www_authorize("$td", "subscriber")) { www_challenge("$td", "0"); exit; }
if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else {
#!ifdef WITH_IPAUTH if(allow_source_address()) { # source IP allowed return; } #!endif
# authenticate if from local subscriber if (from_uri==myself) { if (!proxy_authorize("$fd", "subscriber")) { proxy_challenge("$fd", "0"); exit; } if (is_method("PUBLISH")) { if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { if ($au!=$fU) { sl_send_reply("403","Forbidden auth ID"); exit; } }
consume_credentials(); # caller authenticated } else { # caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (!uri==myself) { sl_send_reply("403","Not relaying"); exit; } } } #!endif return; }
# Caller NAT detection route route[NAT] { #!ifdef WITH_NAT force_rport(); if (nat_uac_test("19")) { if (method=="REGISTER") { fix_nated_register(); } else { fix_nated_contact(); } setflag(FLT_NATS); } #!endif return; }
# RTPProxy control route[RTPPROXY] { #!ifdef WITH_NAT if (is_method("BYE")) { unforce_rtp_proxy(); } else if (is_method("INVITE")){ rtpproxy_offer(); } if (!has_totag()) add_rr_param(";nat=yes"); #!endif return; }
# Routing to foreign domains route[SIPOUT] { if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(RELAY); } }
# PSTN GW routing route[PSTN] { #!ifdef WITH_PSTN # check if PSTN GW IP is defined if (strempty($sel(cfg_get.pstn.gw_ip))) { xlog("SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n"); return; }
# route to PSTN dialed numbers starting with '+' or '00' # (international format) # - update the condition to match your dialing rules for PSTN routing if(!($rU=~"^(+|00)[1-9][0-9]{3,20}$")) return;
# only local users allowed to call if(from_uri!=myself) { sl_send_reply("403", "Not Allowed"); exit; }
$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
route(RELAY); exit; #!endif
return; }
# XMLRPC routing #!ifdef WITH_XMLRPC route[XMLRPC] { # allow XMLRPC from localhost if ((method=="POST" || method=="GET") && (src_ip==127.0.0.1)) { # close connection only for xmlrpclib user agents (there is a bug in # xmlrpclib: it waits for EOF before interpreting the response). if ($hdr(User-Agent) =~ "xmlrpclib") set_reply_close(); set_reply_no_connect(); dispatch_rpc(); exit; } send_reply("403", "Forbidden"); exit; } #!endif
# Sample branch router branch_route[BRANCH_ONE] { xdbg("new branch at $ru\n"); }
# Sample onreply route onreply_route[REPLY_ONE] { xdbg("incoming reply\n"); #!ifdef WITH_NAT if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB)) && status=~"(183)|(2[0-9][0-9])") {
rtpproxy_answer(); } if (isbflagset("6")) { fix_nated_contact(); } #!endif }
# Sample failure route failure_route[FAIL_ONE] { #!ifdef WITH_NAT if (is_method("INVITE") && (isbflagset(FLB_NATB) || isflagset(FLT_NATS))) { unforce_rtp_proxy(); } #!endif
if (t_is_canceled()) { exit; }
# uncomment the following lines if you want to block client # redirect based on 3xx replies. ##if (t_check_status("3[0-9][0-9]")) { ##t_reply("404","Not found"); ## exit; ##}
# uncomment the following lines if you want to redirect the failed # calls to a different new destination ##if (t_check_status("486|408")) { ## sethostport("192.168.2.100:5060"); ## append_branch(); ## # do not set the missed call flag again ## t_relay(); ##} }
On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on udp: 127.0.0.1:5080 tcp: 127.0.0.1:5060 tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080 -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.com SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080 ;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: sip:1010@my.domain.com. From: <sip:1000@my.domain.com
;tag=def4124455da8a0b8e97eafabd028e26-2c30.
CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
I guess no one really knows why it isn't working either. The only option I have left seems to be to try and update to the 4.2 nightly and hope that whatever's wrong is a bug with 4.1.4 and not a simple mistake in my routing syntax or logic.
Daniel, is 4.2 nightly debian package stable enough for a production system? Would you recommend I upgrade?
Thanks
On Wed, Jul 16, 2014 at 9:37 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Can anyone help please? I was supposed to have this server up and running hours ago and I can't think of anything to do next to help debug this.
Thanks
On Wed, Jul 16, 2014 at 7:01 PM, Peter Villeneuve petervnv1@gmail.com wrote:
I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that. Why isn't kamailio sending the message back through the TLS socket?
NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2 ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found
On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve petervnv1@gmail.com wrote:
And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back. Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying.
####### Routing Logic ########
# Main SIP request routing logic # - processing of any incoming SIP request starts with this route route {
# per request initial checks route(REQINIT);
# NAT detection route(NAT);
# handle requests within SIP dialogs route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; }
if (is_method("MESSAGE")) {
log(1,"-------------------------------------------------------->WE HAVE A NEW MESSAGE\n"); route(MSILO_MESSAGE); } t_check_trans();
# authentication route(AUTH);
# record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route();
# account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting }
# dispatch requests to foreign domains route(SIPOUT);
### requests for my local domains
# handle presence related requests route(PRESENCE);
# handle registrations route(REGISTRAR);
if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
# dispatch destinations to PSTN route(PSTN);
# user location service route(LOCATION);
route(RELAY); }
route[RELAY] { #!ifdef WITH_NAT if (check_route_param("nat=yes")) { setbflag(FLB_NATB); } if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) { route(RTPPROXY); } #!endif
/* example how to enable some additional event routes */ if (is_method("INVITE")) { #t_on_branch("BRANCH_ONE"); t_on_reply("REPLY_ONE"); t_on_failure("FAIL_ONE"); }
if (!t_relay()) { sl_reply_error(); } exit; }
##storing offline messages route[MSILO_MESSAGE]{ if (lookup("location")){ t_on_failure("FAIL_MESSAGE"); t_relay(); xlog("L_NOTICE","---------------------------------MI: ($mi), MB: ($mb)\n"); }else{ xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, storing offline message ID: ($ru)\n"); m_store("$ru"); sl_send_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, stored offline message ID: ($ru)\n"); }; exit; };
failure_route[FAIL_MESSAGE]{
xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot
be reached, storing offline message ID: ($ou)\n"); m_store("$ou"); t_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be reached, stored offline message ID: ($ou)\n"); exit; }
# Per SIP request initial checks route[REQINIT] { #!ifdef WITH_ANTIFLOOD # flood dection from same IP and traffic ban for a while # be sure you exclude checking trusted peers, such as pstn gateways # - local host excluded (e.g., loop to self) if(src_ip!=myself) { if($sht(ipban=>$si)!=$null) { # ip is already blocked xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n"); exit; } if (!pike_check_req()) { xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n"); $sht(ipban=>$si) = 1; exit; } } #!endif
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }
if(!sanity_check("1511", "7")) { xlog("Malformed SIP message from $si:$sp\n"); exit; } }
# Handle requests within SIP dialogs route[WITHINDLG] { if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { if (is_method("BYE")) { setflag(FLT_ACC); # do accounting ... setflag(FLT_ACCFAILED); # ... even if the transaction fails } route(RELAY); } else { if (is_method("SUBSCRIBE") && uri == myself) { # in-dialog subscribe requests route(PRESENCE); exit; } if ( is_method("ACK") ) { if ( t_check_trans() ) { # no loose-route, but stateful ACK; # must be an ACK after a 487 # or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction ... ignore and discard exit; } } sl_send_reply("404","Not here"); } exit; } }
# Handle SIP registrations route[REGISTRAR] { if (is_method("REGISTER")) { if(isflagset(FLT_NATS)) { setbflag(FLB_NATB); # uncomment next line to do SIP NAT pinging setbflag(FLB_NATSIPPING); } if (!save("location")) sl_reply_error(); # MSILO - dumping user's offline messages m_dump(); log(1,"-------------------------MESSAGE PROCESSING: dumping offline messages\n");
exit;
} }
# USER location service route[LOCATION] {
#!ifdef WITH_ALIASDB # search in DB-based aliases alias_db_lookup("dbaliases"); #!endif
if (!lookup("location")) { switch ($rc) { case -1: case -3: t_newtran(); t_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } }
# when routing via usrloc, log the missed calls also if (is_method("INVITE")) { setflag(FLT_ACCMISSED); } }
# Presence server route route[PRESENCE] { if(!is_method("PUBLISH|SUBSCRIBE")) return;
#!ifdef WITH_PRESENCE if (!t_newtran()) { sl_reply_error(); exit; };
if(is_method("PUBLISH")) { handle_publish(); t_release(); } else if( is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); } exit; #!endif # if presence enabled, this part will not be executed if (is_method("PUBLISH") || $rU==$null) { sl_send_reply("404", "Not here"); exit; } return; }
# Authentication route route[AUTH] { #!ifdef WITH_AUTH if (is_method("REGISTER")) { # authenticate the REGISTER requests (uncomment to enable auth) if (!www_authorize("$td", "subscriber")) { www_challenge("$td", "0"); exit; }
if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else {
#!ifdef WITH_IPAUTH if(allow_source_address()) { # source IP allowed return; } #!endif
# authenticate if from local subscriber if (from_uri==myself) { if (!proxy_authorize("$fd", "subscriber")) { proxy_challenge("$fd", "0"); exit; } if (is_method("PUBLISH")) { if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { if ($au!=$fU) { sl_send_reply("403","Forbidden auth ID"); exit; } }
consume_credentials(); # caller authenticated } else { # caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (!uri==myself) { sl_send_reply("403","Not relaying"); exit; } } } #!endif return; }
# Caller NAT detection route route[NAT] { #!ifdef WITH_NAT force_rport(); if (nat_uac_test("19")) { if (method=="REGISTER") { fix_nated_register(); } else { fix_nated_contact(); } setflag(FLT_NATS); } #!endif return; }
# RTPProxy control route[RTPPROXY] { #!ifdef WITH_NAT if (is_method("BYE")) { unforce_rtp_proxy(); } else if (is_method("INVITE")){ rtpproxy_offer(); } if (!has_totag()) add_rr_param(";nat=yes"); #!endif return; }
# Routing to foreign domains route[SIPOUT] { if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(RELAY); } }
# PSTN GW routing route[PSTN] { #!ifdef WITH_PSTN # check if PSTN GW IP is defined if (strempty($sel(cfg_get.pstn.gw_ip))) { xlog("SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n"); return; }
# route to PSTN dialed numbers starting with '+' or '00' # (international format) # - update the condition to match your dialing rules for PSTN routing if(!($rU=~"^(+|00)[1-9][0-9]{3,20}$")) return;
# only local users allowed to call if(from_uri!=myself) { sl_send_reply("403", "Not Allowed"); exit; }
$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
route(RELAY); exit; #!endif
return; }
# XMLRPC routing #!ifdef WITH_XMLRPC route[XMLRPC] { # allow XMLRPC from localhost if ((method=="POST" || method=="GET") && (src_ip==127.0.0.1)) { # close connection only for xmlrpclib user agents (there is a bug in # xmlrpclib: it waits for EOF before interpreting the response). if ($hdr(User-Agent) =~ "xmlrpclib") set_reply_close(); set_reply_no_connect(); dispatch_rpc(); exit; } send_reply("403", "Forbidden"); exit; } #!endif
# Sample branch router branch_route[BRANCH_ONE] { xdbg("new branch at $ru\n"); }
# Sample onreply route onreply_route[REPLY_ONE] { xdbg("incoming reply\n"); #!ifdef WITH_NAT if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB)) && status=~"(183)|(2[0-9][0-9])") {
rtpproxy_answer(); } if (isbflagset("6")) { fix_nated_contact(); } #!endif }
# Sample failure route failure_route[FAIL_ONE] { #!ifdef WITH_NAT if (is_method("INVITE") && (isbflagset(FLB_NATB) || isflagset(FLT_NATS))) { unforce_rtp_proxy(); } #!endif
if (t_is_canceled()) { exit; }
# uncomment the following lines if you want to block client # redirect based on 3xx replies. ##if (t_check_status("3[0-9][0-9]")) { ##t_reply("404","Not found"); ## exit; ##}
# uncomment the following lines if you want to redirect the failed # calls to a different new destination ##if (t_check_status("486|408")) { ## sethostport("192.168.2.100:5060"); ## append_branch(); ## # do not set the missed call flag again ## t_relay(); ##} }
On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on udp: 127.0.0.1:5080 tcp: 127.0.0.1:5060 tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080 -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.com SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080 ;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: sip:1010@my.domain.com. From: <sip:1000@my.domain.com
;tag=def4124455da8a0b8e97eafabd028e26-2c30.
CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
I don't remember any relevant updates to msilo lately. So it should be the same.
Unfortunately the heavy traveling I had lately added a lot of load for the moment to properly investigate you case. But msilo is running fine on many installations here, so I expect to be some problem with the config.
I haven't seen any sip trace taken on the server, which I asked, iirc. Did you monitored the loopback interface?
You can try to set the outbound proxy address to the kamailio's ip and port:
http://kamailio.org/docs/modules/stable/modules/msilo.html#idp121032
Then see what happens on the network interface.
Cheers, Daniel
On 17/07/14 14:10, Peter Villeneuve wrote:
I guess no one really knows why it isn't working either. The only option I have left seems to be to try and update to the 4.2 nightly and hope that whatever's wrong is a bug with 4.1.4 and not a simple mistake in my routing syntax or logic.
Daniel, is 4.2 nightly debian package stable enough for a production system? Would you recommend I upgrade?
Thanks
On Wed, Jul 16, 2014 at 9:37 PM, Peter Villeneuve <petervnv1@gmail.com mailto:petervnv1@gmail.com> wrote:
Can anyone help please? I was supposed to have this server up and running hours ago and I can't think of anything to do next to help debug this. Thanks On Wed, Jul 16, 2014 at 7:01 PM, Peter Villeneuve <petervnv1@gmail.com <mailto:petervnv1@gmail.com>> wrote: I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that. Why isn't kamailio sending the message back through the TLS socket? NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2 ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve <petervnv1@gmail.com <mailto:petervnv1@gmail.com>> wrote: And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back. Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying. ####### Routing Logic ######## # Main SIP request routing logic # - processing of any incoming SIP request starts with this route route { # per request initial checks route(REQINIT); # NAT detection route(NAT); # handle requests within SIP dialogs route(WITHINDLG); ### only initial requests (no To tag) # CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) t_relay(); exit; } if (is_method("MESSAGE")) { log(1,"-------------------------------------------------------->WE HAVE A NEW MESSAGE\n"); route(MSILO_MESSAGE); } t_check_trans(); # authentication route(AUTH); # record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf("Route"); if (is_method("INVITE|SUBSCRIBE")) record_route(); # account only INVITEs if (is_method("INVITE")) { setflag(FLT_ACC); # do accounting } # dispatch requests to foreign domains route(SIPOUT); ### requests for my local domains # handle presence related requests route(PRESENCE); # handle registrations route(REGISTRAR); if ($rU==$null) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; } # dispatch destinations to PSTN route(PSTN); # user location service route(LOCATION); route(RELAY); } route[RELAY] { #!ifdef WITH_NAT if (check_route_param("nat=yes")) { setbflag(FLB_NATB); } if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) { route(RTPPROXY); } #!endif /* example how to enable some additional event routes */ if (is_method("INVITE")) { #t_on_branch("BRANCH_ONE"); t_on_reply("REPLY_ONE"); t_on_failure("FAIL_ONE"); } if (!t_relay()) { sl_reply_error(); } exit; } ##storing offline messages route[MSILO_MESSAGE]{ if (lookup("location")){ t_on_failure("FAIL_MESSAGE"); t_relay(); xlog("L_NOTICE","---------------------------------MI: ($mi), MB: ($mb)\n"); }else{ xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, storing offline message ID: ($ru)\n"); m_store("$ru"); sl_send_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: location not found, stored offline message ID: ($ru)\n"); }; exit; }; failure_route[FAIL_MESSAGE]{ xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be reached, storing offline message ID: ($ou)\n"); m_store("$ou"); t_reply("202", "ACCEPTED"); xlog("L_NOTICE","------------------MESSAGE PROCESSING: user cannot be reached, stored offline message ID: ($ou)\n"); exit; } # Per SIP request initial checks route[REQINIT] { #!ifdef WITH_ANTIFLOOD # flood dection from same IP and traffic ban for a while # be sure you exclude checking trusted peers, such as pstn gateways # - local host excluded (e.g., loop to self) if(src_ip!=myself) { if($sht(ipban=>$si)!=$null) { # ip is already blocked xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n"); exit; } if (!pike_check_req()) { xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n"); $sht(ipban=>$si) = 1; exit; } } #!endif if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; } if(!sanity_check("1511", "7")) { xlog("Malformed SIP message from $si:$sp\n"); exit; } } # Handle requests within SIP dialogs route[WITHINDLG] { if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { if (is_method("BYE")) { setflag(FLT_ACC); # do accounting ... setflag(FLT_ACCFAILED); # ... even if the transaction fails } route(RELAY); } else { if (is_method("SUBSCRIBE") && uri == myself) { # in-dialog subscribe requests route(PRESENCE); exit; } if ( is_method("ACK") ) { if ( t_check_trans() ) { # no loose-route, but stateful ACK; # must be an ACK after a 487 # or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction ... ignore and discard exit; } } sl_send_reply("404","Not here"); } exit; } } # Handle SIP registrations route[REGISTRAR] { if (is_method("REGISTER")) { if(isflagset(FLT_NATS)) { setbflag(FLB_NATB); # uncomment next line to do SIP NAT pinging setbflag(FLB_NATSIPPING); } if (!save("location")) sl_reply_error(); # MSILO - dumping user's offline messages m_dump(); log(1,"-------------------------MESSAGE PROCESSING: dumping offline messages\n"); exit; } } # USER location service route[LOCATION] { #!ifdef WITH_ALIASDB # search in DB-based aliases alias_db_lookup("dbaliases"); #!endif if (!lookup("location")) { switch ($rc) { case -1: case -3: t_newtran(); t_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } } # when routing via usrloc, log the missed calls also if (is_method("INVITE")) { setflag(FLT_ACCMISSED); } } # Presence server route route[PRESENCE] { if(!is_method("PUBLISH|SUBSCRIBE")) return; #!ifdef WITH_PRESENCE if (!t_newtran()) { sl_reply_error(); exit; }; if(is_method("PUBLISH")) { handle_publish(); t_release(); } else if( is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); } exit; #!endif # if presence enabled, this part will not be executed if (is_method("PUBLISH") || $rU==$null) { sl_send_reply("404", "Not here"); exit; } return; } # Authentication route route[AUTH] { #!ifdef WITH_AUTH if (is_method("REGISTER")) { # authenticate the REGISTER requests (uncomment to enable auth) if (!www_authorize("$td", "subscriber")) { www_challenge("$td", "0"); exit; } if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { #!ifdef WITH_IPAUTH if(allow_source_address()) { # source IP allowed return; } #!endif # authenticate if from local subscriber if (from_uri==myself) { if (!proxy_authorize("$fd", "subscriber")) { proxy_challenge("$fd", "0"); exit; } if (is_method("PUBLISH")) { if ($au!=$tU) { sl_send_reply("403","Forbidden auth ID"); exit; } } else { if ($au!=$fU) { sl_send_reply("403","Forbidden auth ID"); exit; } } consume_credentials(); # caller authenticated } else { # caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (!uri==myself) { sl_send_reply("403","Not relaying"); exit; } } } #!endif return; } # Caller NAT detection route route[NAT] { #!ifdef WITH_NAT force_rport(); if (nat_uac_test("19")) { if (method=="REGISTER") { fix_nated_register(); } else { fix_nated_contact(); } setflag(FLT_NATS); } #!endif return; } # RTPProxy control route[RTPPROXY] { #!ifdef WITH_NAT if (is_method("BYE")) { unforce_rtp_proxy(); } else if (is_method("INVITE")){ rtpproxy_offer(); } if (!has_totag()) add_rr_param(";nat=yes"); #!endif return; } # Routing to foreign domains route[SIPOUT] { if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(RELAY); } } # PSTN GW routing route[PSTN] { #!ifdef WITH_PSTN # check if PSTN GW IP is defined if (strempty($sel(cfg_get.pstn.gw_ip))) { xlog("SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n"); return; } # route to PSTN dialed numbers starting with '+' or '00' # (international format) # - update the condition to match your dialing rules for PSTN routing if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$")) return; # only local users allowed to call if(from_uri!=myself) { sl_send_reply("403", "Not Allowed"); exit; } $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip); route(RELAY); exit; #!endif return; } # XMLRPC routing #!ifdef WITH_XMLRPC route[XMLRPC] { # allow XMLRPC from localhost if ((method=="POST" || method=="GET") && (src_ip==127.0.0.1)) { # close connection only for xmlrpclib user agents (there is a bug in # xmlrpclib: it waits for EOF before interpreting the response). if ($hdr(User-Agent) =~ "xmlrpclib") set_reply_close(); set_reply_no_connect(); dispatch_rpc(); exit; } send_reply("403", "Forbidden"); exit; } #!endif # Sample branch router branch_route[BRANCH_ONE] { xdbg("new branch at $ru\n"); } # Sample onreply route onreply_route[REPLY_ONE] { xdbg("incoming reply\n"); #!ifdef WITH_NAT if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB)) && status=~"(183)|(2[0-9][0-9])") { rtpproxy_answer(); } if (isbflagset("6")) { fix_nated_contact(); } #!endif } # Sample failure route failure_route[FAIL_ONE] { #!ifdef WITH_NAT if (is_method("INVITE") && (isbflagset(FLB_NATB) || isflagset(FLT_NATS))) { unforce_rtp_proxy(); } #!endif if (t_is_canceled()) { exit; } # uncomment the following lines if you want to block client # redirect based on 3xx replies. ##if (t_check_status("3[0-9][0-9]")) { ##t_reply("404","Not found"); ##exit; ##} # uncomment the following lines if you want to redirect the failed # calls to a different new destination ##if (t_check_status("486|408")) { ##sethostport("192.168.2.100:5060 <http://192.168.2.100:5060>"); ##append_branch(); ### do not set the missed call flag again ##t_relay(); ##} } On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve <petervnv1@gmail.com <mailto:petervnv1@gmail.com>> wrote: Thanks for your help Daniel. OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message. Listening on udp: 127.0.0.1:5080 <http://127.0.0.1:5080> tcp: 127.0.0.1:5060 <http://127.0.0.1:5060> tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:* U 2014/07/16 15:29:14.904285 127.0.0.1:5080 <http://127.0.0.1:5080> -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com> SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: <sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com>>. From: <sip:1000@my.domain.com <mailto:sip%3A1000@my.domain.com>>;tag=def4124455da8a0b8e97eafabd028e26-2c30. CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1 <mailto:16b126996f51d89c-12460@127.0.0.1>. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3 On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla <miconda@gmail.com <mailto:miconda@gmail.com>> wrote: Hello, can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like: ngrep -d any -qt -W byline "sip" port 5060 Cheers, Daniel On 14/07/14 19:56, Peter Villeneuve wrote:
Hi, This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives. Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution? Thanks DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com> DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8 _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -http://www.asipto.com http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi, We did have a working msilo implementation a while back, but we don’t use it any more, so I can only look back at the config files (which are a lot more complicated than yours).
We added the a modparam modparam("msilo", "outbound_proxy", "sip:MY_REAL_IP:MY_SIP_PORT;transport=tcp") which will make it arrive on the local machine on the given socket (instead of localhost) to be processed, but that probably isn’t your problem.
Is it possible that Kamailio is trying to establish a new connection, instead of reusing the existing connection to the client? That would be visible as TCP SYNs in a trace and would cause a 408 after the timeout. We are using a separate outbound enabled edge proxy so this isn’t a problem for us.
Regards, Hugh
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Peter Villeneuve Sent: 17 July 2014 13:10 To: Daniel-Constantin Mierla; Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Msilo not delivering message (status 408)
I guess no one really knows why it isn't working either. The only option I have left seems to be to try and update to the 4.2 nightly and hope that whatever's wrong is a bug with 4.1.4 and not a simple mistake in my routing syntax or logic.
Daniel, is 4.2 nightly debian package stable enough for a production system? Would you recommend I upgrade?
Thanks
On Wed, Jul 16, 2014 at 9:37 PM, Peter Villeneuve <petervnv1@gmail.commailto:petervnv1@gmail.com> wrote: Can anyone help please? I was supposed to have this server up and running hours ago and I can't think of anything to do next to help debug this.
Thanks
On Wed, Jul 16, 2014 at 7:01 PM, Peter Villeneuve <petervnv1@gmail.commailto:petervnv1@gmail.com> wrote: I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that. Why isn't kamailio sending the message back through the TLS socket?
NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages
ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2
ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found
On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve <petervnv1@gmail.commailto:petervnv1@gmail.com> wrote: And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back. Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying.
####### Routing Logic ########
… On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve <petervnv1@gmail.commailto:petervnv1@gmail.com> wrote: Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on udp: 127.0.0.1:5080http://127.0.0.1:5080 tcp: 127.0.0.1:5060http://127.0.0.1:5060 tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080http://127.0.0.1:5080 -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.commailto:sip%3A1010@my.domain.com SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: <sip:1010@my.domain.commailto:sip%3A1010@my.domain.com>. From: <sip:1000@my.domain.commailto:sip%3A1000@my.domain.com>;tag=def4124455da8a0b8e97eafabd028e26-2c30. CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1mailto:16b126996f51d89c-12460@127.0.0.1. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla <miconda@gmail.commailto:miconda@gmail.com> wrote: Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote: Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.commailto:sip%3A1010@my.domain.com DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
________________________________ This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
Thanks for helping out Hugh (and obviously Daniel)
I have made some progress by adding the modparam ("msilo", "outbound_proxy", "sip:my.domain.com:5061;transport=tls"). Now indeed the stored message gets delivered when a UAC registers.
But I just noticed that it was also filling up msilo db with "user xxx is offline!" messages, instead of sending that msg to the initial UAC sending the msg. This likely means I'm doing something wrong with the routing, as it feels like it's in an endless loop. I think Daniel earlier suggested adding if(src_ip != myself) t_on_failure("FAIL_MESSAGE") to another poster that was having trouble with the exact same routing config, but I'm not sure exactly where to insert it.
Can someone experienced with the routing syntax point out my - likely obvious - mistake?
Cheers, Peter
On Thu, Jul 17, 2014 at 3:11 PM, Waite, Hugh hugh.waite@acision.com wrote:
Hi,
We did have a working msilo implementation a while back, but we don’t use it any more, so I can only look back at the config files (which are a lot more complicated than yours).
We added the a modparam *modparam("msilo", "outbound_proxy", "sip:MY_REAL_IP:MY_SIP_PORT;transport=tcp")*
which will make it arrive on the local machine on the given socket (instead of localhost) to be processed, but that probably isn’t your problem.
Is it possible that Kamailio is trying to establish a new connection, instead of reusing the existing connection to the client? That would be visible as TCP SYNs in a trace and would cause a 408 after the timeout. We are using a separate outbound enabled edge proxy so this isn’t a problem for us.
Regards,
Hugh
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Peter Villeneuve *Sent:* 17 July 2014 13:10 *To:* Daniel-Constantin Mierla; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Msilo not delivering message (status 408)
I guess no one really knows why it isn't working either.
The only option I have left seems to be to try and update to the 4.2 nightly and hope that whatever's wrong is a bug with 4.1.4 and not a simple mistake in my routing syntax or logic.
Daniel, is 4.2 nightly debian package stable enough for a production system? Would you recommend I upgrade?
Thanks
On Wed, Jul 16, 2014 at 9:37 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Can anyone help please? I was supposed to have this server up and running hours ago and I can't think of anything to do next to help debug this.
Thanks
On Wed, Jul 16, 2014 at 7:01 PM, Peter Villeneuve petervnv1@gmail.com wrote:
I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that.
Why isn't kamailio sending the message back through the TLS socket?
NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages
ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2
ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found
On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve petervnv1@gmail.com wrote:
And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back.
Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying.
####### Routing Logic ########
…
On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case).
I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on
udp: 127.0.0.1:5080 tcp: 127.0.0.1:5060 tls: 79.my.server.IP1:5061
Aliases:
tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080 -> 79.my.server.IP1:5060
MESSAGE sip:1010@my.domain.com SIP/2.0.
Via: SIP/2.0/UDP 127.0.0.1:5080 ;branch=z9hG4bKcde3.542219f4000000000000000000000000.0.
From: sip:1000@my.domain.com;tag=def4124455da8a0b8e97eafabd028e26-2c30.
CSeq: 10 MESSAGE.
Call-ID: 16b126996f51d89c-12460@127.0.0.1.
Max-Forwards: 70.
Content-Length: 58.
User-Agent: kamailio (4.1.4 (x86_64/linux)).
Date: Wed, 16 Jul 2014 15:22:31 GMT.
Content-Type: text/plain.
.
[Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com
DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called
DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1
DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8
DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0
DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21
DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1
DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0
DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed
DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered
DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13]
DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully
DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8
DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0
DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed
DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered
DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12]
DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully
DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Well I've been experimenting with this for hours and still no joy :( Hair pulling continues
Here's what I did to help debug. I updated to 4.2 and I started using the default TCP listener on 5060 and have turned off the TLS listener to make debugging easier. I have also tried using the routing config from here http://telephonynetworks.blogspot.pt/2012/08/configuracion-de-kamailio-33-con-nat.html but I get the exact same results as with the routing posted above, which tends to rule out any config issues (I think).
Here's what I found so far.
If I don't set the msilo outbound proxy like Daniel suggested, I get the dreaded "no socket found" error I mentioned earlier.
If I do set the proxy, the offline message does get delivered as expected. The problem is that once I send a new message to an offline user, the caller doesn't receive the "user whatever is offline" message, but simply a 202. Then I look in msilo DB and suddenly I have 7k messages and growing and have to shut down kamailio and clean the db.
Example to make understanding this weird behavior easier. Msilo outbound proxy set:
1010 sends msg "testing 123" to 1000 (offline). Msilo stores the msg correctly, although 1010 never does receive the "***User 1000 is offline!" message, only a 202 I see in ngrep. I then look in the msilo db and confirm the "testing 123" msg is there. But right after there is another message stored in msilo, which is what should have been sent to 1000 instead of being stored in the silo.
sip:registrar@my.domain.comsip:1010@my.domain.com1010my.domain.com2014-07-17 14:11:00*** User 1000 is offline! And then registrar storing a message for registrar saying 1010 is offline (which is obviously wrong since 1010 just sent the msg)
sip:registrar@my.domain.comsip:registrar@my.domain.comregistrarmy.domain.com 2014-07-17 14:11:00*** User 1010 is offline!
And then it gets simply crazy with over 7K repeating messages in the silo saying the user registrar is offline.
sip:registrar@my.domain.comsip:registrar@my.domain.comregistrarmy.domain.com 2014-07-17 14:11:00*** User registrar is offline!
To top it all off I see this in the sip trace
What's puzzling me is this: 79.my.server.IP1:58487 -> 79.my.server.IP1:5060
Why does kamailio send to itself from port 58487 to 5060 and not from 5060 to the UAC's public IP?
Sorry to dump so much info here but I'm hoping to resolve this before I go nuts.
Daniel, when you have the time can you take a look please?
Thanks, Peter
T 2014/07/17 21:10:30.383043 85.xx.xx.xx:50235 -> 79.my.server.IP1:5060 [AP] MESSAGE sip:1000@my.domain.com SIP/2.0. v: SIP/2.0/TCP 192.168.1.4:50235 ;rport;branch=z9hG4bKPjCYikazjsY44q1jqMtDzapRCfqofgZ.3O;alias. Max-Forwards: 70. f: sip:1010@my.domain.com;tag=s.HDD1ArN1dDgnwxgeWWK7meY98dkvrS. t: sip:1000@my.domain.com. i: p8PAwoJ6ZLCy7ClSqe8sXD8FWMTU3LQ9. CSeq: 64674 MESSAGE. Accept: text/plain, application/im-iscomposing+xml. User-Agent: PJSIP_m3-19/r2423. Route: sip:my.domain.com;transport=tcp;lr. c: text/plain. l: 25. . msg from 1010 to 1000
T 2014/07/17 21:10:30.390095 *79.my.server.IP1:58487 -> 79.my.server.IP1:5060* [AP] MESSAGE sip:1010@my.domain.com SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK17.50c7d2e1000000000000000000000000.0. To: sip:1010@my.domain.com. From: <sip:registrar@my.domain.com
;tag=416b6f80e891b334140ffeafcc1fa032-ecd9.
CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f619-29814@79.my.server.IP1. Max-Forwards: 70. Content-Length: 25. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User 1000 is offline!
T 2014/07/17 21:10:30.390156 79.my.server.IP1:5060 -> 85.xx.xx.xx:50235 [AP] SIP/2.0 202 ACCEPTED. v: SIP/2.0/TCP 192.168.1.4:50235 ;rport=50235;branch=z9hG4bKPjCYikazjsY44q1jqMtDzapRCfqofgZ.3O;alias;received=85.xx.xx.xx. f: sip:1010@my.domain.com;tag=s.HDD1ArN1dDgnwxgeWWK7meY98dkvrS. t: sip:1000@my.domain.com;tag=83a51ef5beb3f269619e74eb008b8b4e.7652. i: p8PAwoJ6ZLCy7ClSqe8sXD8FWMTU3LQ9. CSeq: 64674 MESSAGE. Server: kamailio (4.2.0-dev7 (x86_64/linux)). Content-Length: 0. .
T 2014/07/17 21:10:30.390441 79.my.server.IP1:5060 -> 85.xx.xx.xx:50235 [AP] MESSAGE sip:1010@85.xx.xx.xx:50235;transport=TCP SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK17.f09631e651d35b19e10d44b11fe53d81.0;i=3. Via: SIP/2.0/TCP 79.my.server.IP1;rport=58487;branch=z9hG4bK17.50c7d2e1000000000000000000000000.0. To: sip:1010@my.domain.com. From: <sip:registrar@my.domain.com
;tag=416b6f80e891b334140ffeafcc1fa032-ecd9.
CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f619-29814@79.my.server.IP1. Max-Forwards: 69. Content-Length: 25. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User 1000 is offline!
T 2014/07/17 21:11:00.357394 79.my.server.IP1:58487 -> 79.my.server.IP1:5060 [AP] MESSAGE sip:registrar@my.domain.com SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK24f7.237c32d3000000000000000000000000.0. To: sip:registrar@my.domain.com. From: <sip:registrar@my.domain.com
;tag=416b6f80e891b334140ffeafcc1fa032-a22d.
CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f618-29809@79.my.server.IP1. Max-Forwards: 70. Content-Length: 25. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User 1010 is offline!
T 2014/07/17 21:11:00.358375 79.my.server.IP1:5060 -> 79.my.server.IP1:58487 [AP] SIP/2.0 202 ACCEPTED. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK17.50c7d2e1000000000000000000000000.0;rport=58487. To: sip:1010@my.domain.com;tag=9916224dd8b1ec9235e0f958cedf67cc-fe6b. From: <sip:registrar@my.domain.com
;tag=416b6f80e891b334140ffeafcc1fa032-ecd9.
CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f619-29814@79.my.server.IP1. Server: kamailio (4.2.0-dev7 (x86_64/linux)). Content-Length: 0. .
T 2014/07/17 21:11:00.359438 79.my.server.IP1:58487 -> 79.my.server.IP1:5060 [AP] MESSAGE sip:registrar@my.domain.com SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK810c.0eb84110000000000000000000000000.0. To: sip:registrar@my.domain.com. From: <sip:registrar@my.domain.com
;tag=416b6f80e891b334140ffeafcc1fa032-2a02.
CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f618-29816@79.my.server.IP1. Max-Forwards: 70. Content-Length: 30. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User registrar is offline!
T 2014/07/17 21:11:00.359495 79.my.server.IP1:5060 -> 79.my.server.IP1:58487 [AP] SIP/2.0 202 ACCEPTED. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK24f7.237c32d3000000000000000000000000.0;rport=58487. To: sip:registrar@my.domain.com;tag=83a51ef5beb3f269619e74eb008b8b4e.a9f2. From: <sip:registrar@my.domain.com
;tag=416b6f80e891b334140ffeafcc1fa032-a22d.
CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f618-29809@79.my.server.IP1. Server: kamailio (4.2.0-dev7 (x86_64/linux)). Content-Length: 0. .
On Thu, Jul 17, 2014 at 3:35 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Thanks for helping out Hugh (and obviously Daniel)
I have made some progress by adding the modparam ("msilo", "outbound_proxy", "sip:my.domain.com:5061;transport=tls"). Now indeed the stored message gets delivered when a UAC registers.
But I just noticed that it was also filling up msilo db with "user xxx is offline!" messages, instead of sending that msg to the initial UAC sending the msg. This likely means I'm doing something wrong with the routing, as it feels like it's in an endless loop. I think Daniel earlier suggested adding if(src_ip != myself) t_on_failure("FAIL_MESSAGE") to another poster that was having trouble with the exact same routing config, but I'm not sure exactly where to insert it.
Can someone experienced with the routing syntax point out my - likely obvious - mistake?
Cheers, Peter
On Thu, Jul 17, 2014 at 3:11 PM, Waite, Hugh hugh.waite@acision.com wrote:
Hi,
We did have a working msilo implementation a while back, but we don’t use it any more, so I can only look back at the config files (which are a lot more complicated than yours).
We added the a modparam *modparam("msilo", "outbound_proxy", "sip:MY_REAL_IP:MY_SIP_PORT;transport=tcp")*
which will make it arrive on the local machine on the given socket (instead of localhost) to be processed, but that probably isn’t your problem.
Is it possible that Kamailio is trying to establish a new connection, instead of reusing the existing connection to the client? That would be visible as TCP SYNs in a trace and would cause a 408 after the timeout. We are using a separate outbound enabled edge proxy so this isn’t a problem for us.
Regards,
Hugh
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Peter Villeneuve *Sent:* 17 July 2014 13:10 *To:* Daniel-Constantin Mierla; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Msilo not delivering message (status 408)
I guess no one really knows why it isn't working either.
The only option I have left seems to be to try and update to the 4.2 nightly and hope that whatever's wrong is a bug with 4.1.4 and not a simple mistake in my routing syntax or logic.
Daniel, is 4.2 nightly debian package stable enough for a production system? Would you recommend I upgrade?
Thanks
On Wed, Jul 16, 2014 at 9:37 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Can anyone help please? I was supposed to have this server up and running hours ago and I can't think of anything to do next to help debug this.
Thanks
On Wed, Jul 16, 2014 at 7:01 PM, Peter Villeneuve petervnv1@gmail.com wrote:
I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that.
Why isn't kamailio sending the message back through the TLS socket?
NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages
ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2
ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found
On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve petervnv1@gmail.com wrote:
And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back.
Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying.
####### Routing Logic ########
…
On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve petervnv1@gmail.com wrote:
Thanks for your help Daniel.
OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case).
I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message.
Listening on
udp: 127.0.0.1:5080 tcp: 127.0.0.1:5060 tls: 79.my.server.IP1:5061
Aliases:
tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:*
U 2014/07/16 15:29:14.904285 127.0.0.1:5080 -> 79.my.server.IP1:5060
MESSAGE sip:1010@my.domain.com SIP/2.0.
Via: SIP/2.0/UDP 127.0.0.1:5080 ;branch=z9hG4bKcde3.542219f4000000000000000000000000.0.
From: sip:1000@my.domain.com;tag=def4124455da8a0b8e97eafabd028e26-2c30.
CSeq: 10 MESSAGE.
Call-ID: 16b126996f51d89c-12460@127.0.0.1.
Max-Forwards: 70.
Content-Length: 58.
User-Agent: kamailio (4.1.4 (x86_64/linux)).
Date: Wed, 16 Jul 2014 15:22:31 GMT.
Content-Type: text/plain.
.
[Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3
On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla < miconda@gmail.com> wrote:
Hello,
can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like:
ngrep -d any -qt -W byline "sip" port 5060
Cheers, Daniel
On 14/07/14 19:56, Peter Villeneuve wrote:
Hi,
This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives.
Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution?
Thanks
DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com
DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called
DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1
DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8
DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0
DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21
DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1
DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0
DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed
DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered
DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13]
DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully
DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8
DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0
DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed
DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered
DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12]
DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully
DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
You should not call m_store() if src_ip==myself -- in this way you avoid to store notification messages that cannot be delivered.
Why notifications are not delivered has to be troubleshooted there. Have you tried also with UDP?
Cheers, Daniel
On 17/07/14 23:46, Peter Villeneuve wrote:
Well I've been experimenting with this for hours and still no joy :( Hair pulling continues
Here's what I did to help debug. I updated to 4.2 and I started using the default TCP listener on 5060 and have turned off the TLS listener to make debugging easier. I have also tried using the routing config from here http://telephonynetworks.blogspot.pt/2012/08/configuracion-de-kamailio-33-con-nat.html but I get the exact same results as with the routing posted above, which tends to rule out any config issues (I think).
Here's what I found so far.
If I don't set the msilo outbound proxy like Daniel suggested, I get the dreaded "no socket found" error I mentioned earlier.
If I do set the proxy, the offline message does get delivered as expected. The problem is that once I send a new message to an offline user, the caller doesn't receive the "user whatever is offline" message, but simply a 202. Then I look in msilo DB and suddenly I have 7k messages and growing and have to shut down kamailio and clean the db.
Example to make understanding this weird behavior easier. Msilo outbound proxy set:
1010 sends msg "testing 123" to 1000 (offline). Msilo stores the msg correctly, although 1010 never does receive the "***User 1000 is offline!" message, only a 202 I see in ngrep. I then look in the msilo db and confirm the "testing 123" msg is there. But right after there is another message stored in msilo, which is what should have been sent to 1000 instead of being stored in the silo.
sip:registrar@my.domain.com sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com 1010 my.domain.com http://my.domain.com 2014-07-17 14:11:00 *** User 1000 is offline!
And then registrar storing a message for registrar saying 1010 is offline (which is obviously wrong since 1010 just sent the msg)
sip:registrar@my.domain.com sip:registrar@my.domain.com registrar my.domain.com 2014-07-17 14:11:00 *** User 1010 is offline!
And then it gets simply crazy with over 7K repeating messages in the silo saying the user registrar is offline.
sip:registrar@my.domain.com sip:registrar@my.domain.com registrar my.domain.com 2014-07-17 14:11:00 *** User registrar is offline!
To top it all off I see this in the sip trace
What's puzzling me is this: 79.my.server.IP1:58487 -> 79.my.server.IP1:5060
Why does kamailio send to itself from port 58487 to 5060 and not from 5060 to the UAC's public IP?
Sorry to dump so much info here but I'm hoping to resolve this before I go nuts.
Daniel, when you have the time can you take a look please?
Thanks, Peter
T 2014/07/17 21:10:30.383043 85.xx.xx.xx:50235 -> 79.my.server.IP1:5060 [AP] MESSAGE sip:1000@my.domain.com mailto:sip%3A1000@my.domain.com SIP/2.0. v: SIP/2.0/TCP 192.168.1.4:50235;rport;branch=z9hG4bKPjCYikazjsY44q1jqMtDzapRCfqofgZ.3O;alias. Max-Forwards: 70. f: <sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com>;tag=s.HDD1ArN1dDgnwxgeWWK7meY98dkvrS. t: <sip:1000@my.domain.com mailto:sip%3A1000@my.domain.com>. i: p8PAwoJ6ZLCy7ClSqe8sXD8FWMTU3LQ9. CSeq: 64674 MESSAGE. Accept: text/plain, application/im-iscomposing+xml. User-Agent: PJSIP_m3-19/r2423. Route: <sip:my.domain.com http://my.domain.com;transport=tcp;lr>. c: text/plain. l: 25. . msg from 1010 to 1000
T 2014/07/17 21:10:30.390095 *79.my.server.IP1:58487 -> 79.my.server.IP1:5060* [AP] MESSAGE sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK17.50c7d2e1000000000000000000000000.0. To: <sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com>. From: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>;tag=416b6f80e891b334140ffeafcc1fa032-ecd9. CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f619-29814@79.my.server.IP1. Max-Forwards: 70. Content-Length: 25. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com mailto:registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User 1000 is offline!
T 2014/07/17 21:10:30.390156 79.my.server.IP1:5060 -> 85.xx.xx.xx:50235 [AP] SIP/2.0 202 ACCEPTED. v: SIP/2.0/TCP 192.168.1.4:50235;rport=50235;branch=z9hG4bKPjCYikazjsY44q1jqMtDzapRCfqofgZ.3O;alias;received=85.xx.xx.xx. f: <sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com>;tag=s.HDD1ArN1dDgnwxgeWWK7meY98dkvrS. t: <sip:1000@my.domain.com mailto:sip%3A1000@my.domain.com>;tag=83a51ef5beb3f269619e74eb008b8b4e.7652. i: p8PAwoJ6ZLCy7ClSqe8sXD8FWMTU3LQ9. CSeq: 64674 MESSAGE. Server: kamailio (4.2.0-dev7 (x86_64/linux)). Content-Length: 0. .
T 2014/07/17 21:10:30.390441 79.my.server.IP1:5060 -> 85.xx.xx.xx:50235 [AP] MESSAGE sip:1010@85.xx.xx.xx:50235;transport=TCP SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK17.f09631e651d35b19e10d44b11fe53d81.0;i=3. Via: SIP/2.0/TCP 79.my.server.IP1;rport=58487;branch=z9hG4bK17.50c7d2e1000000000000000000000000.0. To: <sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com>. From: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>;tag=416b6f80e891b334140ffeafcc1fa032-ecd9. CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f619-29814@79.my.server.IP1. Max-Forwards: 69. Content-Length: 25. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com mailto:registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User 1000 is offline!
T 2014/07/17 21:11:00.357394 79.my.server.IP1:58487 -> 79.my.server.IP1:5060 [AP] MESSAGE sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK24f7.237c32d3000000000000000000000000.0. To: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>. From: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>;tag=416b6f80e891b334140ffeafcc1fa032-a22d. CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f618-29809@79.my.server.IP1. Max-Forwards: 70. Content-Length: 25. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com mailto:registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User 1010 is offline!
T 2014/07/17 21:11:00.358375 79.my.server.IP1:5060 -> 79.my.server.IP1:58487 [AP] SIP/2.0 202 ACCEPTED. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK17.50c7d2e1000000000000000000000000.0;rport=58487. To: <sip:1010@my.domain.com mailto:sip%3A1010@my.domain.com>;tag=9916224dd8b1ec9235e0f958cedf67cc-fe6b. From: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>;tag=416b6f80e891b334140ffeafcc1fa032-ecd9. CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f619-29814@79.my.server.IP1. Server: kamailio (4.2.0-dev7 (x86_64/linux)). Content-Length: 0. .
T 2014/07/17 21:11:00.359438 79.my.server.IP1:58487 -> 79.my.server.IP1:5060 [AP] MESSAGE sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com SIP/2.0. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK810c.0eb84110000000000000000000000000.0. To: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>. From: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>;tag=416b6f80e891b334140ffeafcc1fa032-2a02. CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f618-29816@79.my.server.IP1. Max-Forwards: 70. Content-Length: 30. User-Agent: kamailio (4.2.0-dev7 (x86_64/linux)). Contact: registrar@my.domain.com mailto:registrar@my.domain.com;msilo=yes. Content-Type: text/plain. . *** User registrar is offline!
T 2014/07/17 21:11:00.359495 79.my.server.IP1:5060 -> 79.my.server.IP1:58487 [AP] SIP/2.0 202 ACCEPTED. Via: SIP/2.0/TCP 79.my.server.IP1;branch=z9hG4bK24f7.237c32d3000000000000000000000000.0;rport=58487. To: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>;tag=83a51ef5beb3f269619e74eb008b8b4e.a9f2. From: <sip:registrar@my.domain.com mailto:sip%3Aregistrar@my.domain.com>;tag=416b6f80e891b334140ffeafcc1fa032-a22d. CSeq: 10 MESSAGE. Call-ID: 6807412f0f15f618-29809@79.my.server.IP1. Server: kamailio (4.2.0-dev7 (x86_64/linux)). Content-Length: 0. .
On Thu, Jul 17, 2014 at 3:35 PM, Peter Villeneuve <petervnv1@gmail.com mailto:petervnv1@gmail.com> wrote:
Thanks for helping out Hugh (and obviously Daniel) I have made some progress by adding the modparam ("msilo", "outbound_proxy", "sip:my.domain.com:5061;transport=tls"). Now indeed the stored message gets delivered when a UAC registers. But I just noticed that it was also filling up msilo db with "user xxx is offline!" messages, instead of sending that msg to the initial UAC sending the msg. This likely means I'm doing something wrong with the routing, as it feels like it's in an endless loop. I think Daniel earlier suggested adding if(src_ip != myself) t_on_failure("FAIL_MESSAGE") to another poster that was having trouble with the exact same routing config, but I'm not sure exactly where to insert it. Can someone experienced with the routing syntax point out my - likely obvious - mistake? Cheers, Peter On Thu, Jul 17, 2014 at 3:11 PM, Waite, Hugh <hugh.waite@acision.com <mailto:hugh.waite@acision.com>> wrote: Hi, We did have a working msilo implementation a while back, but we don’t use it any more, so I can only look back at the config files (which are a lot more complicated than yours). We added the a modparam *modparam("msilo", "outbound_proxy", "sip:MY_REAL_IP:MY_SIP_PORT;transport=tcp")* which will make it arrive on the local machine on the given socket (instead of localhost) to be processed, but that probably isn’t your problem. Is it possible that Kamailio is trying to establish a new connection, instead of reusing the existing connection to the client? That would be visible as TCP SYNs in a trace and would cause a 408 after the timeout. We are using a separate outbound enabled edge proxy so this isn’t a problem for us. Regards, Hugh *From:*sr-users-bounces@lists.sip-router.org <mailto:sr-users-bounces@lists.sip-router.org> [mailto:sr-users-bounces@lists.sip-router.org <mailto:sr-users-bounces@lists.sip-router.org>] *On Behalf Of *Peter Villeneuve *Sent:* 17 July 2014 13:10 *To:* Daniel-Constantin Mierla; Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Msilo not delivering message (status 408) I guess no one really knows why it isn't working either. The only option I have left seems to be to try and update to the 4.2 nightly and hope that whatever's wrong is a bug with 4.1.4 and not a simple mistake in my routing syntax or logic. Daniel, is 4.2 nightly debian package stable enough for a production system? Would you recommend I upgrade? Thanks On Wed, Jul 16, 2014 at 9:37 PM, Peter Villeneuve <petervnv1@gmail.com <mailto:petervnv1@gmail.com>> wrote: Can anyone help please? I was supposed to have this server up and running hours ago and I can't think of anything to do next to help debug this. Thanks On Wed, Jul 16, 2014 at 7:01 PM, Peter Villeneuve <petervnv1@gmail.com <mailto:petervnv1@gmail.com>> wrote: I removed the localhost listeners on TCP and UDP, and, as I suspected, Kamailio doesn't seem to like that. Why isn't kamailio sending the message back through the TLS socket? NOTICE: <script>: -------------------------MESSAGE PROCESSING: dumping offline messages ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2 ERROR: tm [uac.c:266]: t_uac_prepare(): t_uac: no socket found On Wed, Jul 16, 2014 at 4:44 PM, Peter Villeneuve <petervnv1@gmail.com <mailto:petervnv1@gmail.com>> wrote: And here's the full routing block. I copied it from someone else on the list that was troubleshooting msilo a while back. Also, I can confirm the message never gets delivered because it remains in msilo DB and kamailio logs shows it trying and trying. ####### Routing Logic ######## … On Wed, Jul 16, 2014 at 4:38 PM, Peter Villeneuve <petervnv1@gmail.com <mailto:petervnv1@gmail.com>> wrote: Thanks for your help Daniel. OK I ngrepped port 5060 and indeed the message tries to get delivered. However it never arrives at the client (1010 in this case). I have added localhost listeners for UDP and TCP, even though all clients register through TLS only (could this be the root of the problem?). I added localhost listeners because I was getting the no socket found error message. Listening on udp: 127.0.0.1:5080 <http://127.0.0.1:5080> tcp: 127.0.0.1:5060 <http://127.0.0.1:5060> tls: 79.my.server.IP1:5061 Aliases: tcp: localhost:5060 udp: localhost:5080 *: my.domain.com:* U 2014/07/16 15:29:14.904285 127.0.0.1:5080 <http://127.0.0.1:5080> -> 79.my.server.IP1:5060 MESSAGE sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com> SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1:5080;branch=z9hG4bKcde3.542219f4000000000000000000000000.0. To: <sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com>>. From: <sip:1000@my.domain.com <mailto:sip%3A1000@my.domain.com>>;tag=def4124455da8a0b8e97eafabd028e26-2c30. CSeq: 10 MESSAGE. Call-ID: 16b126996f51d89c-12460@127.0.0.1 <mailto:16b126996f51d89c-12460@127.0.0.1>. Max-Forwards: 70. Content-Length: 58. User-Agent: kamailio (4.1.4 (x86_64/linux)). Date: Wed, 16 Jul 2014 15:22:31 GMT. Content-Type: text/plain. . [Offline message - Wed Jul 16 15:22:31 2014] Test 1,2,3 On Wed, Jul 16, 2014 at 8:58 AM, Daniel-Constantin Mierla <miconda@gmail.com <mailto:miconda@gmail.com>> wrote: Hello, can you watch the sip traffic on the network to see if the sip messages is sent out? You can use ngrep, like: ngrep -d any -qt -W byline "sip" port 5060 Cheers, Daniel On 14/07/14 19:56, Peter Villeneuve wrote: Hi, This is most likely a stupid mistake on my route config, but msilo correctly stores messages for offline users, but when they come back online, the message never arrives. Looking through the debug logs indeed there is an error, with status 408, which suggests kamaiio can't find a route to the user that just logged. Before I spend hours looking through all the routing blocks, perhaps someone more exprienced in kamailio can see the problem right away and offer a solution? Thanks DEBUG: msilo [msilo.c:1148]: m_dump(): msg [1-12] for: sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com> DEBUG: <core> [io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x8e3040, 9, -1, 0x10) fd_no=2 called DEBUG: <core> [tcp_read.c:1437]: release_tcpconn(): releasing con 0x7f61ced1b1b0, state 1, fd=9, id=1 DEBUG: <core> [tcp_read.c:1438]: release_tcpconn(): extra_data 0x7f61ced1c4f8 DEBUG: <core> [tcp_main.c:3385]: handle_tcp_child(): handle_tcp_child: reader response= 7f61ced1b1b0, 1 from 0 DEBUG: <core> [io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x89ec40, 26, 2, 0x7f61ced1b1b0), fd_no=21 DEBUG: <core> [tcp_main.c:3515]: handle_tcp_child(): handle_tcp_child: CONN_RELEASE 0x7f61ced1b1b0 refcnt= 1 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced1d868, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): *completed with status 408* [mid: 140058058335472/13] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <13> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:13 fl:8 DEBUG: tm [t_reply.c:1304]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408 DEBUG: tm [t_reply.c:2086]: local_reply(): DEBUG: local_reply: branch=0, save=0, winner=0 DEBUG: tm [t_reply.c:2123]: local_reply(): DEBUG: local transaction completed DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0x7f61ced5f098, callback type 1024, id 0 entered DEBUG: msilo [msilo.c:1317]: m_tm_callback(): completed with status 408 [mid: 140058058329184/12] DEBUG: msilo [msilo.c:1325]: m_tm_callback(): message <12> was not sent successfully DEBUG: msilo [ms_msg_list.c:236]: msg_list_set_flag(): mid:12 fl:8 _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla -http://www.asipto.com http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users ------------------------------------------------------------------------ This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding. _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Friday, July 18, 2014 12:01:41 AM Daniel-Constantin Mierla wrote:
You should not call m_store() if src_ip==myself -- in this way you avoid to store notification messages that cannot be delivered.
Why notifications are not delivered has to be troubleshooted there. Have you tried also with UDP?
Cheers, Daniel
On 17/07/14 23:46, Peter Villeneuve wrote: Well I've been experimenting with this for hours and still no joy :( Hair pulling continues
Peter, I'm trying to accomplish something similar, also as a new user to Kamailio and initially starting from the guide at http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb though I am using Asterisk 12 and Kamailio devel (built for Fedora here https://messinet.com/rpms/browser/kamailio)
My goal is that Kamailio does MESSAGE processing with MSILO storage *only* for users who actually exist -- not just any username in my domain, but a user who is in the subscribers table -- there is no sense storing a message for a username who will never register to receive it.
Here are the relevant blocks in my kamailio.cfg -- I've included full routing blocks so you can see how the route is laid out. I admit that I am equally not sure that this is the right way or the most efficient way to do it, but it does work with UDP, TCP, and TLS including notifications.
Now that I have it "working," and understand more about routing in Kamailio, I'm likely going to consolidate duplication. For instance, since I don't want to store messages for invalid or non-existent accounts, I will probably do the if(is_subscriber("$ou", "ps_auths", "1")) and add t_on_failure("MANAGE_FAILURE"); in the request_route, etc.
Perhaps 1) this will help you, and 2) others may be able to give advice on my configuration.
#!define WITH_AUTH #!define WITH_MSILO
#!ifdef WITH_AUTH loadmodule "auth.so" loadmodule "auth_db.so" #!ifdef WITH_IPAUTH loadmodule "permissions.so" #!endif #!endif
#!ifdef WITH_MSILO loadmodule "msilo.so" #!endif
#!ifdef WITH_AUTH # ----- auth_db params ----- modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "load_credentials", "")
#!ifdef WITH_ASTERISK modparam("auth_db", "user_column", "username") modparam("auth_db", "domain_column", "realm") modparam("auth_db", "password_column", "password") # Workaround http://lists.sip-router.org/pipermail/sr-users/2013-August/079267.html modparam("auth_db", "load_credentials", "username") # End workaround modparam("auth_db", "db_url", DBASTURL) modparam("auth_db", "version_table", 0) #!else modparam("auth_db", "db_url", DBURL) modparam("auth_db", "password_column", "password") modparam("auth_db", "use_domain", MULTIDOMAIN) #!endif
#!ifdef WITH_IPAUTH # ----- permissions params ----- modparam("permissions", "db_url", DBURL) modparam("permissions", "db_mode", 1) #!endif #!endif
#!ifdef WITH_MSILO # ----- msilo params ----- modparam("msilo", "db_url", DBURL) modparam("msilo", "from_address", "sip:$rU@my-domain.com") modparam("msilo", "offline_message", "I'll get my messages when I'm back online.") modparam("msilo", "content_type_hdr", "Content-Type: text/plain\r\n") modparam("msilo", "expire_time", 604800) #!endif
####################### route[RELAY] {
# enable additional event routes for forwarded requests # - serial forking, RTP relaying handling, a.s.o. if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) { if(!t_is_set("branch_route")) t_on_branch("MANAGE_BRANCH"); } if (is_method("INVITE|SUBSCRIBE|UPDATE")) { if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY"); } if (is_method("INVITE")) { if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE"); }
#!ifdef WITH_MSILO if (is_method("MESSAGE")) { if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE"); } #!endif
if (!t_relay()) { sl_reply_error(); } exit; }
####################### route[REGISTRAR] { if (is_method("REGISTER")) { if(isflagset(FLT_NATS)) { setbflag(FLB_NATB); # uncomment next line to do SIP NAT pinging ## setbflag(FLB_NATSIPPING); } if (!save("location")) sl_reply_error();
#!ifdef WITH_MSILO # Ensure we aren't unregistering # Right now, CSipSimple doesn't send an Allow header with an un-REGISTER, # so Kamailio skips to checking the Contact header for expires, and appears # to ignore the fact that an Expires: 0 header is present. if($hdr(Expires) != 0) m_dump(); #!endif
#!ifdef WITH_ASTERISK route(REGFWD); #!endif
exit; } }
####################### route[LOCATION] {
#!ifdef WITH_SPEEDDIAL # search for short dialing - 2-digit extension if($rU=~"^[0-9][0-9]$") if(sd_lookup("speed_dial")) route(SIPOUT); #!endif
#!ifdef WITH_ALIASDB # search in DB-based aliases if(alias_db_lookup("dbaliases")) route(SIPOUT); #!endif
#!ifdef WITH_ASTERISK if(is_method("INVITE") && (!route(FROMASTERISK))) { # if new call from out there - send to Asterisk # - non-INVITE request are routed directly by Kamailio # - traffic from Asterisk is routed also directy by Kamailio route(TOASTERISK); exit; } #!endif
$avp(oexten) = $rU; if (!lookup("location")) {
#!ifdef WITH_MSILO if(is_method("MESSAGE") && src_ip!=myself) { # Ensure we have a valid account for which to store MESSAGEs
#!ifdef WITH_ASTERISK if(is_subscriber("$ru", "ps_auths", "1")) { #!else if(is_subscriber("$ru", "subscriber", "1")) { #!endif
if(m_store("$ru")) { xlog("L_INFO", "MSILO: MESSAGE from $fu stored for offline user $ru\n"); send_reply("202", "Accepted"); } else { xlog("L_ERR", "MSILO: unable to store MESSAGE from $fu for offline user $ru\n"); send_reply("503", "Service Unavailable"); } } else { xlog("L_ERR", "MSILO: MESSAGE from $fu not stored for non-existent user $ru\n"); send_reply("404", "Not Found"); } exit; } #!endif
$var(rc) = $rc; route(TOVOICEMAIL); t_newtran(); switch ($var(rc)) { case -1: case -3: send_reply("404", "Not Found"); exit; case -2: send_reply("405", "Method Not Allowed"); exit; } }
# when routing via usrloc, log the missed calls also if (is_method("INVITE")) { setflag(FLT_ACCMISSED); } }
####################### route[AUTH] { #!ifdef WITH_MSILO # do not authenticate ourselves when dumping messages if(is_method("MESSAGE") && src_ip==myself) { return; } #!endif
# if caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (from_uri!=myself && uri!=myself) { sl_send_reply("403","Not relaying"); exit; }
#!ifdef WITH_AUTH
#!ifdef WITH_ASTERISK # do not auth traffic from Asterisk - trusted! if(route(FROMASTERISK)) return; #!endif
#!ifdef WITH_IPAUTH if((!is_method("REGISTER")) && allow_source_address()) { # source IP allowed return; } #!endif
if (is_method("REGISTER") || from_uri==myself) { # authenticate requests #!ifdef WITH_ASTERISK if (!auth_check("$fd", "ps_auths", "1")) { #!else if (!auth_check("$fd", "subscriber", "1")) { #!endif auth_challenge("$fd", "0"); exit; } # user authenticated - remove auth header if(!is_method("REGISTER|PUBLISH")) consume_credentials(); } #!endif return; }
####################### failure_route[MANAGE_FAILURE] { route(NATMANAGE);
if (t_is_canceled()) { exit; }
#!ifdef WITH_BLOCK3XX # block call redirect based on 3xx replies. if (t_check_status("3[0-9][0-9]")) { t_reply("404","Not found"); exit; } #!endif
#!ifdef WITH_MSILO # Manage MSILO transmission failures if(is_method("MESSAGE") && src_ip!=myself) {
# Ensure we have a valid account for which to store MESSAGEs #!ifdef WITH_ASTERISK if(is_subscriber("$ou", "ps_auths", "1")) { #!else if(is_subscriber("$ou", "subscriber", "1")) { #!endif
if (m_store("$ou")) { xlog("L_INFO", "MSILO: MESSAGE from $fu stored for unreachable user $ou\n"); send_reply("202", "Accepted"); } else { xlog("L_ERR", "MSILO: unable to store MESSAGE from $fu for unreachable user $ou\n"); send_reply("503", "Service Unavailable"); } } exit; } #!endif
#!ifdef WITH_VOICEMAIL # serial forking # - route to voicemail on busy or no answer (timeout) if (t_check_status("486|408")) { $du = $null; route(TOVOICEMAIL); exit; } #!endif }
You are a star Anthony! Thanks a lot for sharing your config. It is much appreciated. I'm going to study your config in detail and see if I can get it to work on my install.
Cheers, Peter
On Fri, Jul 18, 2014 at 6:39 PM, Anthony Messina amessina@messinet.com wrote:
On Friday, July 18, 2014 12:01:41 AM Daniel-Constantin Mierla wrote:
You should not call m_store() if src_ip==myself -- in this way you avoid
to
store notification messages that cannot be delivered.
Why notifications are not delivered has to be troubleshooted there. Have
you
tried also with UDP?
Cheers, Daniel
On 17/07/14 23:46, Peter Villeneuve wrote: Well I've been experimenting with this for hours and still no joy :( Hair pulling continues
Peter, I'm trying to accomplish something similar, also as a new user to Kamailio and initially starting from the guide at http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb though I am using Asterisk 12 and Kamailio devel (built for Fedora here https://messinet.com/rpms/browser/kamailio)
My goal is that Kamailio does MESSAGE processing with MSILO storage *only* for users who actually exist -- not just any username in my domain, but a user who is in the subscribers table -- there is no sense storing a message for a username who will never register to receive it.
Here are the relevant blocks in my kamailio.cfg -- I've included full routing blocks so you can see how the route is laid out. I admit that I am equally not sure that this is the right way or the most efficient way to do it, but it does work with UDP, TCP, and TLS including notifications.
Now that I have it "working," and understand more about routing in Kamailio, I'm likely going to consolidate duplication. For instance, since I don't want to store messages for invalid or non-existent accounts, I will probably do the if(is_subscriber("$ou", "ps_auths", "1")) and add t_on_failure("MANAGE_FAILURE"); in the request_route, etc.
Perhaps 1) this will help you, and 2) others may be able to give advice on my configuration.
#!define WITH_AUTH #!define WITH_MSILO
#!ifdef WITH_AUTH loadmodule "auth.so" loadmodule "auth_db.so" #!ifdef WITH_IPAUTH loadmodule "permissions.so" #!endif #!endif
#!ifdef WITH_MSILO loadmodule "msilo.so" #!endif
#!ifdef WITH_AUTH # ----- auth_db params ----- modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "load_credentials", "")
#!ifdef WITH_ASTERISK modparam("auth_db", "user_column", "username") modparam("auth_db", "domain_column", "realm") modparam("auth_db", "password_column", "password") # Workaround http://lists.sip-router.org/pipermail/sr-users/2013-August/079267.html modparam("auth_db", "load_credentials", "username") # End workaround modparam("auth_db", "db_url", DBASTURL) modparam("auth_db", "version_table", 0) #!else modparam("auth_db", "db_url", DBURL) modparam("auth_db", "password_column", "password") modparam("auth_db", "use_domain", MULTIDOMAIN) #!endif
#!ifdef WITH_IPAUTH # ----- permissions params ----- modparam("permissions", "db_url", DBURL) modparam("permissions", "db_mode", 1) #!endif #!endif
#!ifdef WITH_MSILO # ----- msilo params ----- modparam("msilo", "db_url", DBURL) modparam("msilo", "from_address", "sip:$rU@my-domain.com") modparam("msilo", "offline_message", "I'll get my messages when I'm back online.") modparam("msilo", "content_type_hdr", "Content-Type: text/plain\r\n") modparam("msilo", "expire_time", 604800) #!endif
####################### route[RELAY] {
# enable additional event routes for forwarded requests # - serial forking, RTP relaying handling, a.s.o. if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) { if(!t_is_set("branch_route")) t_on_branch("MANAGE_BRANCH"); } if (is_method("INVITE|SUBSCRIBE|UPDATE")) { if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY"); } if (is_method("INVITE")) { if(!t_is_set("failure_route"))
t_on_failure("MANAGE_FAILURE"); }
#!ifdef WITH_MSILO if (is_method("MESSAGE")) { if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE"); } #!endif
if (!t_relay()) { sl_reply_error(); } exit;
}
####################### route[REGISTRAR] { if (is_method("REGISTER")) { if(isflagset(FLT_NATS)) { setbflag(FLB_NATB); # uncomment next line to do SIP NAT pinging ## setbflag(FLB_NATSIPPING); } if (!save("location")) sl_reply_error();
#!ifdef WITH_MSILO # Ensure we aren't unregistering # Right now, CSipSimple doesn't send an Allow header with an un-REGISTER, # so Kamailio skips to checking the Contact header for expires, and appears # to ignore the fact that an Expires: 0 header is present. if($hdr(Expires) != 0) m_dump(); #!endif
#!ifdef WITH_ASTERISK route(REGFWD); #!endif
exit; }
}
####################### route[LOCATION] {
#!ifdef WITH_SPEEDDIAL # search for short dialing - 2-digit extension if($rU=~"^[0-9][0-9]$") if(sd_lookup("speed_dial")) route(SIPOUT); #!endif
#!ifdef WITH_ALIASDB # search in DB-based aliases if(alias_db_lookup("dbaliases")) route(SIPOUT); #!endif
#!ifdef WITH_ASTERISK if(is_method("INVITE") && (!route(FROMASTERISK))) { # if new call from out there - send to Asterisk # - non-INVITE request are routed directly by Kamailio # - traffic from Asterisk is routed also directy by Kamailio route(TOASTERISK); exit; } #!endif
$avp(oexten) = $rU; if (!lookup("location")) {
#!ifdef WITH_MSILO if(is_method("MESSAGE") && src_ip!=myself) { # Ensure we have a valid account for which to store MESSAGEs
#!ifdef WITH_ASTERISK if(is_subscriber("$ru", "ps_auths", "1")) { #!else if(is_subscriber("$ru", "subscriber", "1")) { #!endif
if(m_store("$ru")) { xlog("L_INFO", "MSILO: MESSAGE from
$fu stored for offline user $ru\n"); send_reply("202", "Accepted"); } else { xlog("L_ERR", "MSILO: unable to store MESSAGE from $fu for offline user $ru\n"); send_reply("503", "Service Unavailable"); } } else { xlog("L_ERR", "MSILO: MESSAGE from $fu not stored for non-existent user $ru\n"); send_reply("404", "Not Found"); } exit; } #!endif
$var(rc) = $rc; route(TOVOICEMAIL); t_newtran(); switch ($var(rc)) { case -1: case -3: send_reply("404", "Not Found"); exit; case -2: send_reply("405", "Method Not Allowed"); exit; } } # when routing via usrloc, log the missed calls also if (is_method("INVITE")) { setflag(FLT_ACCMISSED); }
}
####################### route[AUTH] { #!ifdef WITH_MSILO # do not authenticate ourselves when dumping messages if(is_method("MESSAGE") && src_ip==myself) { return; } #!endif
# if caller is not local subscriber, then check if it calls # a local destination, otherwise deny, not an open relay here if (from_uri!=myself && uri!=myself) { sl_send_reply("403","Not relaying"); exit; }
#!ifdef WITH_AUTH
#!ifdef WITH_ASTERISK # do not auth traffic from Asterisk - trusted! if(route(FROMASTERISK)) return; #!endif
#!ifdef WITH_IPAUTH if((!is_method("REGISTER")) && allow_source_address()) { # source IP allowed return; } #!endif
if (is_method("REGISTER") || from_uri==myself) { # authenticate requests
#!ifdef WITH_ASTERISK if (!auth_check("$fd", "ps_auths", "1")) { #!else if (!auth_check("$fd", "subscriber", "1")) { #!endif auth_challenge("$fd", "0"); exit; } # user authenticated - remove auth header if(!is_method("REGISTER|PUBLISH")) consume_credentials(); } #!endif return; }
####################### failure_route[MANAGE_FAILURE] { route(NATMANAGE);
if (t_is_canceled()) { exit; }
#!ifdef WITH_BLOCK3XX # block call redirect based on 3xx replies. if (t_check_status("3[0-9][0-9]")) { t_reply("404","Not found"); exit; } #!endif
#!ifdef WITH_MSILO # Manage MSILO transmission failures if(is_method("MESSAGE") && src_ip!=myself) {
# Ensure we have a valid account for which to store
MESSAGEs #!ifdef WITH_ASTERISK if(is_subscriber("$ou", "ps_auths", "1")) { #!else if(is_subscriber("$ou", "subscriber", "1")) { #!endif
if (m_store("$ou")) { xlog("L_INFO", "MSILO: MESSAGE from $fu
stored for unreachable user $ou\n"); send_reply("202", "Accepted"); } else { xlog("L_ERR", "MSILO: unable to store MESSAGE from $fu for unreachable user $ou\n"); send_reply("503", "Service Unavailable"); } } exit; } #!endif
#!ifdef WITH_VOICEMAIL # serial forking # - route to voicemail on busy or no answer (timeout) if (t_check_status("486|408")) { $du = $null; route(TOVOICEMAIL); exit; } #!endif }
-- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Friday, July 18, 2014 07:32:21 PM Peter Villeneuve wrote:
You are a star Anthony! Thanks a lot for sharing your config. It is much appreciated. I'm going to study your config in detail and see if I can get it to work on my install.
Cheers, Peter
Sure, Peter. One thing I noticed during testing (and after restarting Kamailio between changes), I needed to un-REGISTER and re-REGISTER the CSipSimple client that was going to send the MESSAGE to the offline user. If I didn't do that, it would never receive the "User offline" reply message and Kamailio would continually try to resend it.
-A
Hi again,
I've been playing around with Anthony's config posted above, and I believe I'm almost there getting msilo to work properly, although it seems that kamailio doesn't correctly recognize the callee is a local subscriber so it rejects the message instead of storing it. Shouldn't the is_subscriber function return true since user 1010 is in fact a subscriber? I don't understand why it throws the invalid parameter error, but it's late and I'm tired of staring at the config file for endless hours. Am I forgetting something basic? The user (1000 in my example) registers fine, so obviously kamailio can properly poll the DB.
Any clues?
Cheers
Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: registrar [lookup.c:158]: lookup(): '1010' Not found in usrloc Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 14==14 && [85.xx.xx.xx] == [79.my.server.IP1] Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [forward.c:454]: check_self(): check_self: host != me Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: auth_db [authdb_mod.c:291]:* w_is_subscriber(): uri [sip:1010@my.domain.com sip%3A1010@my.domain.com]* table [subscriber] flags [1] Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: *<core> [db_ut.c:280]: db_print_columns(): Invalid parameter value* Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: auth_db [authorize.c:97]: fetch_credentials(): failed to query database Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: <script>: MSILO: MESSAGE from sip:1000@my.domain.com not stored for non-existent user sip:1010@my.domain.com Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: sl [sl.c:288]: send_reply(): reply in stateless mode (sl)
On Fri, Jul 18, 2014 at 7:48 PM, Anthony Messina amessina@messinet.com wrote:
On Friday, July 18, 2014 07:32:21 PM Peter Villeneuve wrote:
You are a star Anthony! Thanks a lot for sharing your config. It is much appreciated. I'm going to study your config in detail and see if I can get it to work
on
my install.
Cheers, Peter
Sure, Peter. One thing I noticed during testing (and after restarting Kamailio between changes), I needed to un-REGISTER and re-REGISTER the CSipSimple client that was going to send the MESSAGE to the offline user. If I didn't do that, it would never receive the "User offline" reply message and Kamailio would continually try to resend it.
-A
-- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Friday, July 18, 2014 11:34:27 PM Peter Villeneuve wrote:
Hi again,
I've been playing around with Anthony's config posted above, and I believe I'm almost there getting msilo to work properly, although it seems that kamailio doesn't correctly recognize the callee is a local subscriber so it rejects the message instead of storing it. Shouldn't the is_subscriber function return true since user 1010 is in fact a subscriber? I don't understand why it throws the invalid parameter error, but it's late and I'm tired of staring at the config file for endless hours. Am I forgetting something basic? The user (1000 in my example) registers fine, so obviously kamailio can properly poll the DB.
Any clues?
Cheers
Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: registrar [lookup.c:158]: lookup(): '1010' Not found in usrloc Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 14==14 && [85.xx.xx.xx] == [79.my.server.IP1] Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [forward.c:454]: check_self(): check_self: host != me Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: auth_db [authdb_mod.c:291]: w_is_subscriber(): uri [sip:1010@my.domain.com] table [subscriber] flags [1] Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: <core> [db_ut.c:280]: db_print_columns(): Invalid parameter value Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: auth_db [authorize.c:97]: fetch_credentials(): failed to query database Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: <script>: MSILO: MESSAGE from sip:1000@my.domain.com not stored for non-existent user sip:1010@my.domain.com Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: sl [sl.c:288]: send_reply(): reply in stateless mode (sl)
You have to set auth_db's "load_credentials" variable to something--I chose username since that was present in my db:
# Workaround http://lists.sip-router.org/pipermail/sr-users/2013-August/079267.html modparam("auth_db", "load_credentials", "username")
Yup, that was it thanks.
Now I'm back to my original problem. I just have 1 tls listener on 5061. I'm going to try and enable other transports and set the outbound proxy and see if that fixes it.
Cheers
ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2
On Fri, Jul 18, 2014 at 11:57 PM, Anthony Messina amessina@messinet.com wrote:
On Friday, July 18, 2014 11:34:27 PM Peter Villeneuve wrote:
Hi again,
I've been playing around with Anthony's config posted above, and I
believe
I'm almost there getting msilo to work properly, although it seems that kamailio doesn't correctly recognize the callee is a local subscriber so
it
rejects the message instead of storing it. Shouldn't the is_subscriber function return true since user 1010 is in fact a subscriber? I don't understand why it throws the invalid parameter error, but it's late and
I'm
tired of staring at the config file for endless hours. Am I forgetting something basic? The user (1000 in my example) registers fine, so
obviously
kamailio can properly poll the DB.
Any clues?
Cheers
Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: registrar [lookup.c:158]: lookup(): '1010' Not found in usrloc Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 14==14 && [85.xx.xx.xx] == [79.my.server.IP1] Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [forward.c:454]: check_self(): check_self: host != me Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: auth_db [authdb_mod.c:291]: w_is_subscriber(): uri [sip:1010@my.domain.com] table [subscriber] flags [1] Jul 18 21:30:50
pbx
/usr/sbin/kamailio[16778]: ERROR: <core> [db_ut.c:280]:
db_print_columns():
Invalid parameter value Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: auth_db [authorize.c:97]: fetch_credentials(): failed to query database Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: <script>: MSILO: MESSAGE from sip:1000@my.domain.com not stored for non-existent
user
sip:1010@my.domain.com Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: sl [sl.c:288]: send_reply(): reply in stateless mode (sl)
You have to set auth_db's "load_credentials" variable to something--I chose username since that was present in my db:
# Workaround http://lists.sip-router.org/pipermail/sr-users/2013-August/079267.html modparam("auth_db", "load_credentials", "username")
-- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Just to update the list in case anyone cares. Indeed I have finally managed to get msilo working properly by setting the outbound proxy for msilo. And it works fine with just the TLS transport.
I really appreciate your help Anthony. Your config file was invaluable to me.
Cheers, Peter
On Sat, Jul 19, 2014 at 12:40 AM, Peter Villeneuve petervnv1@gmail.com wrote:
Yup, that was it thanks.
Now I'm back to my original problem. I just have 1 tls listener on 5061. I'm going to try and enable other transports and set the outbound proxy and see if that fixes it.
Cheers
ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2
On Fri, Jul 18, 2014 at 11:57 PM, Anthony Messina amessina@messinet.com wrote:
On Friday, July 18, 2014 11:34:27 PM Peter Villeneuve wrote:
Hi again,
I've been playing around with Anthony's config posted above, and I
believe
I'm almost there getting msilo to work properly, although it seems that kamailio doesn't correctly recognize the callee is a local subscriber
so it
rejects the message instead of storing it. Shouldn't the is_subscriber function return true since user 1010 is in fact a subscriber? I don't understand why it throws the invalid parameter error, but it's late and
I'm
tired of staring at the config file for endless hours. Am I forgetting something basic? The user (1000 in my example) registers fine, so
obviously
kamailio can properly poll the DB.
Any clues?
Cheers
Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: registrar [lookup.c:158]: lookup(): '1010' Not found in usrloc Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 14==14 && [85.xx.xx.xx] == [79.my.server.IP1] Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: <core> [forward.c:454]: check_self(): check_self: host != me Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: auth_db [authdb_mod.c:291]: w_is_subscriber(): uri [sip:1010@my.domain.com] table [subscriber] flags [1] Jul 18 21:30:50
pbx
/usr/sbin/kamailio[16778]: ERROR: <core> [db_ut.c:280]:
db_print_columns():
Invalid parameter value Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: auth_db [authorize.c:97]: fetch_credentials(): failed to query database Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: <script>: MSILO: MESSAGE from sip:1000@my.domain.com not stored for non-existent
user
sip:1010@my.domain.com Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: sl [sl.c:288]: send_reply(): reply in stateless mode (sl)
You have to set auth_db's "load_credentials" variable to something--I chose username since that was present in my db:
# Workaround http://lists.sip-router.org/pipermail/sr-users/2013-August/079267.html modparam("auth_db", "load_credentials", "username")
-- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 http://messinet.com/~amessina/gallery8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Maybe someone can make a blog post somewhere or an article on the wiki (http://www.kamailio.org/wiki/) with this topic, putting there the config, so it will help others in the future.
Cheers, Daniel
On 20/07/14 20:42, Peter Villeneuve wrote:
Just to update the list in case anyone cares. Indeed I have finally managed to get msilo working properly by setting the outbound proxy for msilo. And it works fine with just the TLS transport.
I really appreciate your help Anthony. Your config file was invaluable to me.
Cheers, Peter
On Sat, Jul 19, 2014 at 12:40 AM, Peter Villeneuve <petervnv1@gmail.com mailto:petervnv1@gmail.com> wrote:
Yup, that was it thanks. Now I'm back to my original problem. I just have 1 tls listener on 5061. I'm going to try and enable other transports and set the outbound proxy and see if that fixes it. Cheers ERROR: tm [ut.h:343]: uri2dst2(): no corresponding socket for af 2 On Fri, Jul 18, 2014 at 11:57 PM, Anthony Messina <amessina@messinet.com <mailto:amessina@messinet.com>> wrote: On Friday, July 18, 2014 11:34:27 PM Peter Villeneuve wrote: > Hi again, > > I've been playing around with Anthony's config posted above, and I believe > I'm almost there getting msilo to work properly, although it seems that > kamailio doesn't correctly recognize the callee is a local subscriber so it > rejects the message instead of storing it. Shouldn't the is_subscriber > function return true since user 1010 is in fact a subscriber? I don't > understand why it throws the invalid parameter error, but it's late and I'm > tired of staring at the config file for endless hours. Am I forgetting > something basic? The user (1000 in my example) registers fine, so obviously > kamailio can properly poll the DB. > > Any clues? > > Cheers > > Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: DEBUG: registrar > [lookup.c:158]: lookup(): '1010' Not found in usrloc Jul 18 21:30:50 pbx > /usr/sbin/kamailio[16778]: DEBUG: <core> [socket_info.c:583]: > grep_sock_info(): grep_sock_info - checking if host==us: 14==14 && > [85.xx.xx.xx] == [79.my.server.IP1] Jul 18 21:30:50 pbx > /usr/sbin/kamailio[16778]: DEBUG: <core> [forward.c:454]: check_self(): > check_self: host != me Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: > DEBUG: auth_db [authdb_mod.c:291]: w_is_subscriber(): uri > [sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com>] table [subscriber] flags [1] Jul 18 21:30:50 pbx > /usr/sbin/kamailio[16778]: ERROR: <core> [db_ut.c:280]: db_print_columns(): > Invalid parameter value Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: > ERROR: auth_db [authorize.c:97]: fetch_credentials(): failed to query > database Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: ERROR: <script>: > MSILO: MESSAGE from sip:1000@my.domain.com <mailto:sip%3A1000@my.domain.com> not stored for non-existent user > sip:1010@my.domain.com <mailto:sip%3A1010@my.domain.com> Jul 18 21:30:50 pbx /usr/sbin/kamailio[16778]: > DEBUG: sl [sl.c:288]: send_reply(): reply in stateless mode (sl) You have to set auth_db's "load_credentials" variable to something--I chose username since that was present in my db: # Workaround http://lists.sip-router.org/pipermail/sr-users/2013-August/079267.html modparam("auth_db", "load_credentials", "username") -- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 <http://messinet.com/%7Eamessina/gallery8F89> 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users