Hi,I'm trying to achieve this configurationphone --> NAT --> kamailio loadbalancer --> kamailio sip/proxy--> kamailio sip/proxyWith the attached configuration I can make calls without any problemsbut when the callee hangs up the call does not end only the caller can hang up.Btw I'm using tcp for signalling.Any ideas?Thanks#!define FLT_ACC 1#!define FLT_ACCMISSED 2#!define FLT_ACCFAILED 3#!define FLT_NATS 5#!define FLB_NATB 6#!define FLB_NATSIPPING 7mhomed=1####### Global Parameters ##########!ifdef WITH_DEBUGdebug=4log_stderror=yes#!elsedebug=2log_stderror=no#!endifmemdbg=5memlog=5log_facility=LOG_LOCAL0fork=yeschildren=4tcp_async=yestcp_connection_lifetime=3605port=5060sip_warning=yes####### Modules Section #########!ifdef WITH_SRCPATHmpath="modules_k:modules"#!elsempath="/usr/lib/x86_64-linux-gnu/kamailio/modules/"#!endifloadmodule "db_mysql.so"loadmodule "mi_fifo.so"loadmodule "kex.so"loadmodule "tm.so"loadmodule "tmx.so"loadmodule "sl.so"loadmodule "rr.so"loadmodule "pv.so"loadmodule "maxfwd.so"loadmodule "textops.so"loadmodule "siputils.so"loadmodule "xlog.so"loadmodule "sanity.so"loadmodule "ctl.so"loadmodule "mi_rpc.so"loadmodule "acc.so"loadmodule "usrloc.so"loadmodule "registrar.so"loadmodule "dispatcher.so"loadmodule "nathelper.so"loadmodule "rtpproxy.so"loadmodule "path.so"# ----------------- setting module-specific parameters ---------------# ----- mi_fifo params -----modparam("mi_fifo", "fifo_name", "/var/run/kamailio/kamailio_fifo")# ----- rr params -----# add value to ;lr param to cope with most of the UAsmodparam("rr", "enable_full_lr", 1)# do not append from tag to the RR (no need for this script)modparam("rr", "append_fromtag", 1)modparam("rr", "enable_double_rr", 0)# ----- tm params -----modparam("tm", "failure_reply_mode", 3)modparam("tm", "fr_timer", 3000)modparam("tm", "fr_inv_timer", 120000)# ----- dispatcher params -----modparam("dispatcher", "db_url","mysql://kamailio:kamailiorw@localhost/kamailio")modparam("dispatcher", "table_name", "dispatcher")modparam("dispatcher", "flags", 2)#modparam("dispatcher", "force_dst", 1)modparam("dispatcher", "setid_col", "setid")modparam("dispatcher", "destination_col", "destination")modparam("dispatcher", "flags_col", "flags")modparam("dispatcher", "priority_col", "priority")modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")modparam("path", "use_received", 1)modparam("registrar", "use_path", 1)modparam("registrar", "path_mode", 0)modparam("registrar", "path_use_received", 1)modparam("nathelper", "natping_interval", 30)modparam("nathelper", "ping_nated_only", 1)modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)modparam("nathelper", "sipping_from", "sip:pinger@kamailio.org")# params needed for NAT traversal in other modulesmodparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")modparam("usrloc", "nat_bflag", FLB_NATB)####### Routing Logic ######### main request routing logicrequest_route {xlog("L_NOTICE", "*** loose routing enforced before: $rm, $ru, $si, $du\n");# per request initial checksroute(REQINIT);loose_route();# handle requests within SIP dialogsroute(WITHINDLG);### only initial requests (no To tag)# CANCEL processingif (is_method("CANCEL")){if (t_check_trans())t_relay();exit;}t_check_trans();# record routing for dialog forming requests (in case they are routed)# - remove preloaded route headers#remove_hf("Route");if (is_method("INVITE")){record_route();}if(is_method("REGISTER")){add_path_received();fix_nated_register();}else{add_contact_alias();}# dispatch destinationsroute(DISPATCH);route(RELAY);}route[RELAY] {if (!t_relay()) {sl_reply_error();}exit;}# Per SIP request initial checksroute[REQINIT] {if (!mf_process_maxfwd_header("10")) {sl_send_reply("483","Too Many Hops");exit;}if(!sanity_check("1511", "7")){xlog("L_NOTICE", "*** loose routing enforced before: $rm, $ru, $si, $du\n");xlog("Malformed SIP message from $si:$sp\n");exit;}}# Handle requests within SIP dialogsroute[WITHINDLG] {if (has_totag()) {# sequential request withing a dialog should# take the path determined by record-routingif (loose_route()) {if (is_method("BYE")) {setflag(1); # do accounting ...setflag(3); # ... 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() ) {# non loose-route, but stateful ACK;# must be ACK after a 487 or e.g. 404 from upstream servert_relay();exit;} else {# ACK without matching transaction ... ignore and discard.exit;}}sl_send_reply("404","Not here");}exit;}}# Dispatch requestsroute[DISPATCH] {# round robin dispatching on gateways group '1'if(!ds_select_domain("1", "0")){send_reply("404", "No destination");exit;}xlog("L_DBG", "--- SCRIPT: going to <$ru> via <$du>\n");t_on_failure("RTF_DISPATCH");return;}# Sample failure routefailure_route[RTF_DISPATCH] {if (t_is_canceled()) {exit;}# next DST - only for 500 or local timeoutif (t_check_status("500")or (t_branch_timeout() and !t_branch_replied())){if(ds_next_domain()){xlog("L_NOTICE", "going to next dst\n");t_on_failure("RTF_DISPATCH");route(RELAY);exit;}}}
_______________________________________________
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