Hi,<br><br>Your configuration looks fine.<br><br>Can you try with 2 X-Lite phones on different machines just to narrow down the problem?<br><br><div class="gmail_quote">On Wed, Jan 6, 2010 at 4:29 PM, Chandrakant Solanki <span dir="ltr"><<a href="mailto:solanki.chandrakant@gmail.com">solanki.chandrakant@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br><br>Thanks for reply<br><br>Here is kamailio.cfg file<br>================================================================================================<br>
listen = 192.168.94.30<br>port = 5060<br>mpath = "/lib/kamailio/modules"<br>
debug = 9<br>fork = yes<br>disable_tcp = no<br>log_facility = LOG_LOCAL0<br>log_stderror = no<br>dns = no<br>rev_dns = no<br><br>loadmodule "usrloc.so"<br>modparam("usrloc", "user_column", "username")<br>
modparam("usrloc", "domain_column", "domain")<br>modparam("usrloc", "contact_column", "contact")<br>modparam("usrloc", "expires_column", "expires")<br>
modparam("usrloc", "q_column", "q")<br>modparam("usrloc", "callid_column", "callid")<br>modparam("usrloc", "cseq_column", "cseq")<br>
modparam("usrloc", "methods_column", "methods")<br>modparam("usrloc", "flags_column", "flags")<br>modparam("usrloc", "user_agent_column", "user_agent")<br>
modparam("usrloc", "received_column", "received")<br>modparam("usrloc", "socket_column", "socket")<br>modparam("usrloc", "use_domain", 0)<br>
modparam("usrloc", "desc_time_order", 0)<br>modparam("usrloc", "timer_interval", 60)<br>modparam("usrloc", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>
modparam("usrloc", "db_mode", 1)<br>modparam("usrloc", "matching_mode", 0)<br>modparam("usrloc", "cseq_delay", 20)<br>modparam("usrloc", "nat_bflag", 6)<br>
<br>loadmodule "pv.so"<br><br>loadmodule "registrar.so"<br>modparam("registrar", "default_expires", 3600)<br>modparam("registrar", "min_expires", 60)<br>modparam("registrar", "max_expires", 0)<br>
modparam("registrar", "default_q", 0)<br>modparam("registrar", "append_branches", 1)<br>modparam("registrar", "case_sensitive", 0)<br>modparam("registrar", "received_param", "received")<br>
modparam("registrar", "max_contacts", 100)<br>modparam("registrar", "retry_after", 0)<br>modparam("registrar", "method_filtering", 0)<br>modparam("registrar", "path_mode", 2)<br>
modparam("registrar", "path_use_received", 0)<br>modparam("registrar", "received_avp", "$avp(i:801)")<br><br>loadmodule "rr.so"<br>modparam("rr", "enable_full_lr", 0)<br>
modparam("rr", "append_fromtag", 1)<br>modparam("rr", "enable_double_rr", 1)<br>modparam("rr", "add_username", 0)<br><br>loadmodule "tm.so"<br>modparam("tm", "fr_timer", 3)<br>
modparam("tm", "fr_inv_timer", 35)<br>modparam("tm", "wt_timer", 5)<br>modparam("tm", "delete_timer", 2)<br>modparam("tm", "ruri_matching", 1)<br>
modparam("tm", "via1_matching", 1)<br>modparam("tm", "unix_tx_timeout", 2)<br>modparam("tm", "restart_fr_on_each_reply", 1)<br>modparam("tm", "pass_provisional_replies", 0)<br>
modparam("tm", "fr_inv_timer_avp", "$avp(s:callee_fr_inv_timer)")<br><br>loadmodule "xlog.so"<br>modparam("xlog", "buf_size", 4096)<br>modparam("xlog", "force_color", 0)<br>
<br>loadmodule "mi_fifo.so"<br>modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")<br><br>loadmodule "domain.so"<br>modparam("domain", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>
modparam("domain", "db_mode", 1)<br>modparam("domain", "domain_table", "domain")<br>modparam("domain", "domain_col", "domain")<br><br>loadmodule "nathelper.so"<br>
modparam("nathelper", "natping_interval", 60)<br>modparam("nathelper", "ping_nated_only", 1)<br>modparam("nathelper", "sipping_method", "OPTIONS")<br>
modparam("nathelper", "received_avp", "$avp(i:801)")<br>
<br>loadmodule "textops.so"<br><br>loadmodule "sl.so"<br>modparam("sl", "enable_stats", 1)<br><br>loadmodule "maxfwd.so"<br>modparam("maxfwd", "max_limit", 256)<br>
<br>loadmodule "db_mysql.so"<br>modparam("db_mysql", "ping_interval", 300)<br>modparam("db_mysql", "auto_reconnect", 1)<br><br>loadmodule "auth.so"<br>modparam("auth", "nonce_expire", 300)<br>
modparam("auth", "rpid_suffix", ";party=calling;id-type=subscriber;screen=yes")<br>modparam("auth", "rpid_avp", "$avp(s:rpid)")<br><br>loadmodule "auth_db.so"<br>
modparam("auth_db", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>modparam("auth_db", "user_column", "username")<br>
modparam("auth_db", "domain_column", "domain")<br>modparam("auth_db", "password_column", "password")<br>modparam("auth_db", "password_column_2", "ha1b")<br>
modparam("auth_db", "calculate_ha1", 1)<br>modparam("auth_db", "use_domain", 1)<br>modparam("auth_db", "load_credentials", "$avp(s:caller_uuid)=uuid")<br>
<br>loadmodule "uri_db.so"<br>modparam("uri_db", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>
<br>loadmodule "avpops.so"<br>
modparam("avpops", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>modparam("avpops", "avp_table", "usr_preferences")<br>
modparam("avpops", "use_domain", 1)<br>modparam("avpops", "uuid_column", "uuid")<br>modparam("avpops", "username_column", "username")<br>modparam("avpops", "domain_column", "domain")<br>
modparam("avpops", "attribute_column", "attribute")<br>modparam("avpops", "value_column", "value")<br>modparam("avpops", "type_column", "type")<br>
<br>loadmodule "lcr.so"<br>modparam("lcr", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>
modparam("lcr", "gw_table", "gw")<br>
modparam("lcr", "gw_name_column", "gw_name")<br>modparam("lcr", "ip_addr_column", "ip_addr")<br>modparam("lcr", "port_column", "port")<br>
modparam("lcr", "uri_scheme_column", "uri_scheme")<br>modparam("lcr", "transport_column", "transport")<br>modparam("lcr", "grp_id_column", "grp_id")<br>
modparam("lcr", "lcr_table", "lcr")<br>modparam("lcr", "strip_column", "strip")<br>modparam("lcr", "prefix_column", "prefix")<br>modparam("lcr", "from_uri_column", "from_uri")<br>
modparam("lcr", "priority_column", "priority")<br>modparam("lcr", "flags_avp", "$avp(i:712)")<br>modparam("lcr", "gw_uri_avp", "$avp(i:1400)")<br>
modparam("lcr", "ruri_user_avp", "$avp(i:1402)")<br>modparam("lcr", "fr_inv_timer_avp", "$avp(s:fr_inv_timer_avp)")<br>modparam("lcr", "fr_inv_timer", 90)<br>
modparam("lcr", "fr_inv_timer_next", 30)<br>modparam("lcr", "rpid_avp", "$avp(s:rpid)")<br><br>loadmodule "alias_db.so"<br>modparam("alias_db", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>
modparam("alias_db", "user_column", "username")<br>modparam("alias_db", "domain_column", "domain")<br>modparam("alias_db", "alias_user_column", "alias_username")<br>
modparam("alias_db", "alias_domain_column", "alias_domain")<br>modparam("alias_db", "use_domain", 0)<br><br>loadmodule "uac.so"<br>modparam("uac", "rr_store_param", "vsf")<br>
modparam("uac", "from_restore_mode", "auto")<br>modparam("uac", "from_passwd", "s1p:Wiz4rd!")<br><br>loadmodule "acc.so"<br>modparam("acc", "db_url", "mysql://<a href="http://database:database@192.168.90.12/openser" target="_blank">database:database@192.168.90.12/openser</a>")<br>
modparam("acc", "db_flag", 1)<br>modparam("acc", "db_missed_flag", 2)<br>modparam("acc", "log_flag", 1)<br>modparam("acc", "log_missed_flag", 2)<br>
modparam("acc", "log_extra", "src_user=$fU;src_domain=$fd;dst_user=$rU;dst_domain=$rd")<br>modparam("acc", "db_extra", "src_user=$fU;src_domain=$fd;dst_user=$rU;dst_domain=$rd")<br>
<br>loadmodule "mi_datagram.so"<br>modparam("mi_datagram", "socket_name", "udp:<a href="http://127.0.0.1:8080" target="_blank">127.0.0.1:8080</a>" )<br>modparam("mi_datagram", "children_count", 3 )<br>
modparam("mi_datagram", "unix_socket_mode", 0600 )<br>modparam("mi_datagram", "unix_socket_group", "root" )<br>modparam("mi_datagram", "unix_socket_user", "root" )<br>
modparam("mi_datagram", "socket_timeout", 2000 )<br><br>loadmodule "mediaproxy.so"<br>modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy/dispatcher.sock")<br>
modparam("mediaproxy", "mediaproxy_timeout", 500)<br>modparam("mediaproxy", "signaling_ip_avp", "$avp(s:nat_ip)")<br>modparam("mediaproxy", "media_relay_avp", "$avp(s:media_relay)")<br>
<br>loadmodule "nat_traversal.so" <br>modparam("nat_traversal", "keepalive_interval", 90) <br>modparam("nat_traversal", "keepalive_method", "OPTIONS") <br>modparam("nat_traversal", "keepalive_from", "<a href="mailto:sip%3Akeepalive@mydomain.com" target="_blank">sip:keepalive@mydomain.com</a>")<br>
<br>route[0]<br>{<br> xlog("L_DBG", "New Request - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> force_rport();<br><br> if(msg:len > max_len)<br> {<br> xlog("L_DBG", "Message too big - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
sl_send_reply("513", "Message Too Big");<br> exit;<br> }<br> if (!mf_process_maxfwd_header("10"))<br> {<br> xlog("L_DBG", "Too many hops - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
sl_send_reply("483", "Too Many Hops");<br> exit;<br> }<br> if(!is_method("REGISTER"))<br> {<br> if(nat_uac_test("19"))<br>
{<br> record_route(";nat=yes");<br> }<br> else<br> {<br> record_route();<br> }<br> }<br>
if (is_method("SUBSCRIBE")) {<br> # challenge/response<br> if (!www_authorize("", "subscriber")) {<br> www_challenge("", "0");<br>
exit;<br> }<br> exit;<br> }<br><br> if(is_method("CANCEL") || is_method("BYE"))<br> {<br> end_media_session();<br>
}<br> if(loose_route())<br> {<br> if(nat_uac_test("19") || search("^Route:.*;nat=yes"))<br> {<br> fix_nated_contact();<br> setbflag(6);<br>
}<br> route(8);<br> }<br> if(is_method("REGISTER"))<br> {<br> route(7);<br> }<br> if(is_method("INVITE"))<br> {<br>
use_media_proxy();<br> route(9);<br> }<br> if(is_method("CANCEL") || is_method("ACK"))<br> {<br> route(13);<br> }<br> route(14);<br>
}<br><br>########################################################################<br># Request route 'clear-usr-preferences-caller'<br>########################################################################<br>route[1]<br>
{<br> xlog("L_DBG", "Clear caller preferences - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> avp_delete("$avp(s:caller_cli)/g");<br> avp_delete("$avp(s:clir)/g");<br>
}<br><br>########################################################################<br># Request route 'clear-usr-preferences-callee'<br>########################################################################<br>route[2]<br>
{<br> xlog("L_DBG", "Clear callee preferences - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> avp_delete("$avp(s:callee_fr_inv_timer)/g");<br> avp_delete("$avp(s:cfu)/g");<br>
avp_delete("$avp(s:cfc)/g");<br>}<br><br>########################################################################<br># Request route 'usr-preferences-caller'<br>########################################################################<br>
route[3]<br>{<br> route(1);<br> xlog("L_DBG", "Load caller preferences for uuid '$avp(s:caller_uuid)' - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>ID=$ci\n");<br> # load caller avps<br>
avp_db_load("$avp(s:caller_uuid)", "*");<br> avp_copy("$avp(s:cli)", "$avp(s:caller_cli)/d");<br> if(is_avp_set("$avp(s:clir)/n") && avp_check("$avp(s:clir)", "eq/i:1"))<br>
{<br> # mark for anonymization<br> setflag(28);<br> }<br>}<br><br>########################################################################<br># Request route 'usr-preferences-callee'<br>
########################################################################<br>route[4]<br>{<br> xlog("L_DBG", "Load callee preferences for uuid '$avp(s:callee_uuid)' - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>
ID=$ci\n");<br> # load callee avps<br> avp_db_load("$avp(s:callee_uuid)", "*");<br> if(is_avp_set("$avp(s:cfu)/s"))<br> {<br> xlog("L_DBG", "Call-forward-unconditional to '$avp(s:cfu)' found - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>
ID=$ci\n");<br> avp_delete("$avp(s:caller_uuid)/g");<br> avp_copy("$avp(s:callee_uuid)", "$avp(s:caller_uuid)/d");<br> avp_pushto("$ru", "$avp(s:cfu)");<br>
<br> route(3);<br> route(10);<br> exit;<br> }<br> if(is_avp_set("$avp(s:ringtimeout)/n"))<br> {<br> xlog("L_DBG", "Setting ring timeout to $avp(s:ringtimeout) secs - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>
ID=$ci\n");<br> avp_copy("$avp(s:ringtimeout)", "$avp(s:callee_fr_inv_timer)/d");<br> }<br>}<br><br>########################################################################<br>
# Request route 'clir'<br>########################################################################<br>route[5]<br>{<br> if(isflagset(28) && !isflagset(27))<br> {<br> setflag(27);<br>
<br> xlog("L_DBG", "Anonymize caller - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> uac_replace_from("Anonymous","sip:anonymous@anonymous.invalid");<br>
if(is_present_hf("Privacy"))<br> {<br> remove_hf("Privacy");<br> }<br> append_hf("Privacy: id\r\n");<br> }<br>
}<br><br>########################################################################<br># Request route 'stop-rtp-proxy'<br>########################################################################<br>route[6]<br>{<br>
if(isflagset(22))<br> {<br> end_media_session();<br> }<br>}<br><br>########################################################################<br># Request route 'base-route-register'<br>
########################################################################<br>route[7]<br>{<br> sl_send_reply("100", "Trying");<br> if(!www_authorize("", "subscriber")) <br>
{<br> xlog("L_DBG", "Register authentication failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> www_challenge("", "0");<br> exit;<br>
}<br> if(!check_to()) <br> {<br><br> xlog("L_DBG", "Spoofed To-URI detected - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> sl_send_reply("403", "Spoofed To-URI Detected");<br>
exit;<br> }<br> consume_credentials();<br> if(!search("^Contact:[ ]*\*") && nat_uac_test("19")) <br> {<br> fix_nated_register();<br> setbflag(6);<br>
}<br><br> if(!save("location")) <br> {<br> xlog("L_ERR", "Saving contact failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> sl_reply_error();<br>
exit;<br> }<br> xlog("L_DBG", "Registration successful - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> exit;<br>}<br><br>########################################################################<br>
# Request route 'base-outbound'<br>########################################################################<br>route[8]<br>{<br> if(is_present_hf("P-Asserted-Identity"))<br> {<br> remove_hf("P-Asserted-Identity");<br>
}<br> if(is_present_hf("Remote-Party-ID"))<br> {<br> remove_hf("Remote-Party-ID");<br> }<br> if(is_avp_set("$avp(s:caller_cli)/s"))<br> {<br>
if(!isflagset(28))<br> {<br> xlog("L_DBG", "Set caller CLI '$avp(s:caller_cli)' - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>ID=$ci\n");<br> append_hf("P-Asserted-Identity: <$avp(s:caller_cli)>\r\n");<br>
}<br> }<br><br> route(5);<br> if(isbflagset(6))<br> {<br> if(!isflagset(22) && !search("^Content-Length:[ ]*0"))<br> {<br> setflag(22);<br>
# use_media_proxy();<br> }<br> t_on_reply("2");<br> }<br> else<br> {<br> t_on_reply("1");<br> }<br> if(!isflagset(21))<br>
{<br> t_on_failure("2");<br> }<br> if(isflagset(29))<br> {<br> append_branch();<br> }<br> if(is_present_hf("Proxy-Authorization"))<br>
{<br># consume_credentials();<br> }<br><br> xlog("L_DBG", "Request leaving server, D-URI='$du' - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> # no 100 (we already sent it) and no DNS blacklisting<br>
if(!t_relay("0x05"))<br> {<br> sl_reply_error();<br> if(is_method("INVITE") && isbflagset(6))<br> {<br> end_media_session();<br>
}<br> }<br> exit;<br>}<br><br>########################################################################<br># Request route 'base-route-invite'<br>########################################################################<br>
route[9]<br>{<br> sl_send_reply("100", "Trying");<br> if(from_gw())<br> {<br> $avp(s:caller_uuid)="0";<br> xlog("L_DBG", "Call from PSTN' - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
setflag(23);<br> $avp(s:ringtimeout)=1000;<br><br> route(3);<br> if (nat_uac_test("3")) <br> {<br> xlog("L_DBG", "Inside NATed INVITE Processing\n");<br>
fix_nated_contact();<br><br> fix_nated_sdp("3");<br><br> t_on_reply("1");<br> }<br> else <br> {<br>
t_on_reply("1");<br> }<br><br> if(nat_uac_test("19"))<br> {<br> setbflag(6);<br> }<br><br> route(51);<br>
}<br> else<br> {<br> if(!proxy_authorize("", "subscriber")) <br> {<br> xlog("L_DBG", "Proxy authentication failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
proxy_challenge("", "0");<br> exit;<br> }<br> if(!check_from()) <br> {<br> xlog("L_DBG", "Spoofed From-URI detected - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
sl_send_reply("403", "Spoofed From-URI Detected");<br> exit;<br> }<br><br> route(3);<br> if(nat_uac_test("19"))<br>
{<br> fix_nated_contact();<br> setbflag(6);<br> }<br> route(10);<br> }<br>}<br><br>########################################################################<br>
# Request route 'invite-find-callee'<br>########################################################################<br>route[10]<br>{<br> if(alias_db_lookup("dbaliases"))<br> {<br> xlog("L_DBG", "Callee was aliased - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
}<br><br> route(2);<br> if(!is_domain_local("$rd"))<br> {<br> setflag(20);<br> $avp(s:callee_uuid) = "0";<br> route(12);<br> }<br>
avp_delete("$avp(s:callee_uuid)");<br> avp_db_query("select uuid from subscriber where username = '$rU'", "$avp(s:callee_uuid)");<br> if(is_avp_set("$avp(s:callee_uuid)/s"))<br>
{<br> xlog("L_DBG", "Callee is local, uuid='$avp(s:callee_uuid)' - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>ID=$ci\n");<br> route(11);<br> }<br> else<br>
{<br> $avp(s:callee_uuid) = "0";<br> xlog("L_DBG", "Callee is not local - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>#<br># *86 - sending user direct to access voicemail from sip client<br>
#<br> if($rU=="*86")<br> {<br> route(12);<br> }<br> else<br> {<br> if($(rU{s.len})<=7)<br>
{<br> route(11);<br> }<br> else<br> {<br> route(12);<br> }<br>
}<br> }<br> exit;<br>}<br><br>########################################################################<br># Request route 'invite-to-internal'<br>########################################################################<br>
<br>route[11]<br>{<br> route(4);<br><br><br> revert_uri();<br> seturi("sip:*<a href="mailto:89@openser.org" target="_blank">89@openser.org</a>");<br><br> rewritehostport("<a href="http://voicemailserver.databasepbx.com:5060" target="_blank">voicemailserver.databasepbx.com:5060</a>");<br>
route(8);<br> exit;<br>}<br><br>########################################################################<br># TEST ROUTE 51<br>########################################################################<br>route[51]<br>
{<br> if(alias_db_lookup("dbaliases"))<br> {<br> xlog("L_DBG", "Callee was aliased - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> }<br><br> route(2);<br>
if(!is_domain_local("$rd"))<br> {<br> setflag(20);<br> $avp(s:callee_uuid) = "0";<br> route(12);<br> }<br> avp_delete("$avp(s:callee_uuid)");<br>
avp_db_query("select uuid from subscriber where username = '$rU'", "$avp(s:callee_uuid)");<br> if(is_avp_set("$avp(s:callee_uuid)/s"))<br> {<br> xlog("L_DBG", "Callee is local, uuid='$avp(s:callee_uuid)' - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>
ID=$ci\n");<br> route(52);<br> }<br> else<br> {<br> $avp(s:callee_uuid) = "0";<br> xlog("L_DBG", "Callee is not local - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
route(12);<br> }<br> exit;<br>}<br><br>########################################################################<br>#TEST 52<br>########################################################################<br>
route[52]<br>{<br> route(4);<br> if(!lookup("location")) <br> {<br> xlog("L_DBG", "Local user offline - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> sl_send_reply("404", "User Offline");<br>
}<br> else<br> {<br> xlog("L_DBG", "Local user online - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> avp_delete("$avp(s:callee_srcip)");<br>
avp_db_query("select received from location where username = '$rU'", "$avp(s:callee_srcip)");<br> avp_printf("$avp(i:13)", "$(du{s.select,1,:})" );<br>
avp_printf("$avp(i:14)", "$(avp(s:callee_srcip){s.select,1,:})" );<br> xlog("L_DBG", "source IP [$avp(i:13)] destination IP [$avp(i:14)]\n");<br> if (avp_check("$avp(i:13)","eq/$avp(i:14)/i")) <br>
{<br> xlog("L_INFO", "Detected Two Clients Behind the Same NAT - Disabling Mediaproxy"); <br> # Do not use mediaproxy as the clients seem to be behind the same NAT <br>
xlog("L_DBG", "source IP is the same as destination IP \n");<br> resetflag(2);<br> resetflag(3);<br> }<br> avp_delete("$avp(i:13)/g");<br>
avp_delete("$avp(i:14)/g");<br> route(8);<br> }<br> exit;<br>}<br><br>########################################################################<br># Request route 'invite-to-external'<br>
########################################################################<br>route[12]<br>{<br> if(isflagset(20))<br> {<br> xlog("L_DBG", "Call to foreign domain - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
route(8);<br> exit;<br> }<br> if(!isflagset(23))<br> {<br> if(uri =~ "^sip:\*86@.*")<br> {<br> xlog("L_DBG", "User accessing Voicemail - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
rewritehostport("<a href="http://voicemailserver.databasepbx.com:5060" target="_blank">voicemailserver.databasepbx.com:5060</a>");<br> route(8);<br> }<br>
# don't allow calls relaying from PSTN to PSTN, if not explicitely forwarded<br>
else if(uri =~ "^sip:[0-9]+@")<br> {<br> # only route numeric users to PSTN<br> if(!load_gws())<br> {<br> xlog("L_ERR", "Error loading PSTN gateways - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>
ID=$ci\n");<br> sl_send_reply("503", "PSTN Termination Currently Unavailable");<br> exit;<br> }<br> if(!next_gw())<br>
{<br> xlog("L_ERR", "No PSTN gateways available - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>ID=$ci\n");<br> sl_send_reply("503", "PSTN Termination Currently Unavailable");<br>
exit;<br> }<br> setflag(21);<br> t_on_failure("1");<br> route(8);<br> }<br>
}<br><br> xlog("L_DBG", "Call to unknown user - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> sl_send_reply("404", "User Not Found");<br> exit;<br>
}<br>
<br>########################################################################<br># Request route 'base-route-local'<br>########################################################################<br>route[13]<br>{<br>
t_on_reply("1");<br>
if(t_check_trans())<br> {<br> xlog("L_DBG", "Request leaving server - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> }<br> else<br> {<br> xlog("L_DBG", "Dropping mis-routed request - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
exit;<br> }<br> if(!t_relay())<br> {<br> sl_reply_error();<br> }<br> exit;<br>}<br><br><br>########################################################################<br>
# Request route 'base-route-generic'<br>########################################################################<br>route[14]<br>{<br> xlog("L_DBG", "Method not supported - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
sl_send_reply("501", "Method Not Supported Here");<br> exit;<br>}<br><br>########################################################################<br># Request route 'base-filter-failover'<br>
########################################################################<br>route[15]<br>{<br> if(!t_check_status("408|500|503"))<br> {<br> xlog("L_DBG", "No failover routing needed for this response code - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>
ID=$ci\n");<br> route(6);<br> exit;<br> }<br>}<br><br><br>########################################################################<br>#Send the call out<br>########################################################################<br>
<br>route[16]<br>{<br> #send the call outward<br> if(method=="INVITE" && !isflagset(10))<br> {<br> t_on_failure("2");<br> }<br> <br> if (!t_relay()) <br>
{<br> xlog("L_WARN", "ERROR: t_relay failed");<br> sl_reply_error();<br> }<br>}<br><br>########################################################################<br>
# Request route 'Voicemail and Asterisk for further processing'<br>########################################################################<br>failure_route[3]<br>{<br> if(!t_was_cancelled())<br> {<br>
revert_uri();<br> rewritehostport("<a href="http://voicemailserver.databasepbx.com:5060" target="_blank">voicemailserver.databasepbx.com:5060</a>");<br> append_branch();<br>
#PREVENT SOME CRAZY VOICEMAIL LOOP<br>
xlog("L_DBG", "No Answer Sending the call to Voicemail - M=$rm RURI=$ru F=$fu T=$tu IP=$si <br>ID=$ci\n");<br> setflag(10);<br> route(8);<br> }<br>
}<br><br>########################################################################<br># Reply route 'base-standard-reply'<br>########################################################################<br>onreply_route[1]<br>
{<br> xlog("L_DBG", "Reply - S=$rs D=$rr F=$fu T=$tu IP=$si ID=$ci\n");<br> if (nat_uac_test("1")) <br> {<br> fix_nated_contact();<br> }<br> exit;<br>
}<br><br>########################################################################<br># Reply route 'base-nat-reply'<br>########################################################################<br>onreply_route[2]<br>
{<br> xlog("L_DBG", "NAT-Reply - S=$rs D=$rr F=$fu T=$tu IP=$si ID=$ci\n");<br> if(nat_uac_test("1"))<br> {<br> fix_nated_contact();<br> xlog("L_DBG", "NAT-Reply==[Fix_nated_contact] - S=$rs D=$rr F=$fu T=$tu IP=$si ID=$ci\n");<br>
}<br><br> if(isbflagset(6) && status=~"(180)|(183)|2[0-9][0-9]") <br> {<br> if(!search("^Content-Length:[ ]*0"))<br> {<br> use_media_proxy();<br>
xlog("L_DBG", "NAT-Reply==[Force Rtp proxy] - S=$rs D=$rr F=$fu T=$tu IP=$si ID=$ci\n");<br> }<br> }<br> exit;<br>}<br><br>########################################################################<br>
# Failure route 'pstn-failover'<br>########################################################################<br>failure_route[1]<br>{<br> xlog("L_DBG", "Failure route for PSTN entered - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
route(15);<br> if(!next_gw())<br> {<br> xlog("L_ERR", "Failed to select next PSTN gateway - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> route(6);<br>
exit;<br> }<br><br> t_on_failure("3");<br> route(8);<br>}<br><br>########################################################################<br># Failure route 'base-standard-failure'<br>
########################################################################<br>failure_route[2]<br>{<br> if(!t_was_cancelled())<br> {<br> revert_uri();<br> route(10);<br> }<br>
if(t_check_status("422|481|487"))<br> {<br> xlog("L_DBG", "Final reply - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> route(6);<br> exit;<br>
}<br><br> t_on_branch("1");<br> xlog("L_DBG", "Redirect from UAC intercepted - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> route(10);<br> if($avp(s:cfc) != NULL)<br>
{<br> avp_pushto("$ru", "$avp(s:cfc)");<br> setflag(29);<br> append_branch();<br><br> t_on_branch("1");<br> xlog("L_DBG", "CFC detected - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
route(10);<br> }<br><br> route(15);<br> route(6);<br>}<br><br>########################################################################<br># Branch route 'cfc-drop-local'<br>########################################################################<br>
branch_route[1]<br>{<br> if(is_domain_local("$rd"))<br> {<br> xlog("L_DBG", "Dropping local branch - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> drop();<br>
}<br>}<br>===============================================================================================<br><br>MediaProxy's config.ini<br><br>;<br>; Configuration file for MediaProxy<br>;<br><br>[Relay]<br>
relay_ip = 192.168.94.30<br>
dispatchers = 192.168.94.30<br>port_range = 8000:20000<br>log_level = DEBUG<br>on_hold_timeout = 1800<br>stream_timeout = 90<br><br>[Dispatcher]<br>socket = /var/run/mediaproxy/dispatcher.sock<br>listen = 192.168.94.30<br>
listen_management = 192.168.94.30<br>log_level = DEBUG<br>management_use_tls = no<br><br>[TLS]<br>certs_path = tls<br>verify_interval = 300<br><br>[OpenSIPS]<br>max_connections = 100<br><br>Is there any problem in config file then please suggest me. This configuration was running with other phone but not with <b><font size="2"><font color="#000000">PolycomSoundPointIP-SPIP_600-UA/3.1.3.0439</font></font></b>.<div class="im">
<br>
<br>Thanks in advance<br>-- <br>Regards,<br><br>Chandrakant Solanki<br><br></div><div><div></div><div class="h5"><div class="gmail_quote">On Wed, Jan 6, 2010 at 3:38 PM, Ramu <span dir="ltr"><<a href="mailto:contactramu@gmail.com" target="_blank">contactramu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>You have to do NATing if the UAs are behind NAT when REGISTER and INVITE packet comes to Kamailio.<br>
<br>You have to call use_media_proxy() function for INVITE and 200 OK messages.<br><br>Please send your kamailio.cfg file to resolve the issues.<br>
<br><br><div class="gmail_quote"><div><div></div><div>On Wed, Jan 6, 2010 at 11:12 AM, Chandrakant Solanki <span dir="ltr"><<a href="mailto:solanki.chandrakant@gmail.com" target="_blank">solanki.chandrakant@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
Hello<br><br>I have installed kamailio - 1.5.2 with MediaProxy.<br><br>I registered <a href="mailto:101@domain.com" target="_blank">101@domain.com</a> and <a href="mailto:102@domain.com" target="_blank">102@domain.com</a> from <b><font size="2"><font color="#000000">PolycomSoundPointIP-SPIP_600-UA/3.1.3.0439</font></font></b>.<br>
<br>But when I look for location table into database, I show received field is NULL, while from other phone like X-Lite it shows some value in same field like sip:X.X.X.X:5061.<br><br>When I call from 101 to 102 using <b><font size="2"><font color="#000000">PolycomSoundPointIP </font></font></b><font size="2"><font color="#000000">phone, </font></font>The phone rings on the other
extension but when I pick up no voice is heard, the caller phone keeps hearing
the wait-for-other party.<br><br>Is there any changes required into kamailio.cfg or not. ??<br><br>Thanks in advance<br><br>-- <br>Regards,<br><font color="#888888"><br>Chandrakant Solanki<br>
</font><br></div></div>_______________________________________________<br>
Kamailio (OpenSER) - Users mailing list<br>
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a><br>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a><br>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br><br clear="all">Thanks,<br><font color="#888888">Ramu<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ramu<br>