<div dir="ltr"><div class="gmail_quote"><br><br><div dir="ltr">Hi Mates,<div>I am testing a Client in Nokia E65 using kamailio <a href="http://1.3.3." target="_blank">1.3.3.</a> I managed to successfull get it Registered but when i attempt to make a call i always get the "404 Not Found" message in the INVITE. Strangely enough, the Client appears to still be ONLINE in the location table.</div>
<div><br></div><div>################################</div><div>kamailio config below</div><div>##############################</div><div><div>if(!is_method("REGISTER")){</div><div> if(nat_uac_test("19")){</div>
<div> record_route(";nat=yes");</div><div> } else {</div><div> record_route();</div><div> };</div><div> };</div><div><br></div><div> ##Loose_route packets</div><div> if (has_totag()) {</div>
<div><span style="white-space:pre">        </span> #sequential request withing a dialog should</div><div><span style="white-space:pre">        </span> # take the path determined by record-routing</div>
<div><span style="white-space:pre">        </span> if (loose_route()) {</div><div> if(method=="BYE") {</div><div><span style="white-space:pre">                </span> #Account BYE transactions</div>
<div><span style="white-space:pre">                </span> setflag(2);</div><div><span style="white-space:pre">                </span>};</div><div><span style="white-space:pre">        </span> #Check authentication of re-invites</div>
<div><span style="white-space:pre">        </span> if(method=="INVITE" && (!allow_trusted())) {<span style="white-space:pre">        </span></div><div> if (!proxy_authorize("","subscriber")) {</div>
<div><span style="white-space:pre">        </span> proxy_challenge("","0");</div><div><span style="white-space:pre">        </span> exit;</div>
<div><span style="white-space:pre">        </span> } else if (!check_from()) {</div><div><span style="white-space:pre">        </span> sl_send_reply("403", "Forbidden, use From=ID");</div>
<div><span style="white-space:pre">        </span> exit;</div><div><span style="white-space:pre">        </span> };</div><div> };</div><div><span style="white-space:pre">                </span>if(method=="BYE" || method=="CANCEL") {</div>
<div><span style="white-space:pre">                </span> end_media_session();</div><div><span style="white-space:pre">                </span>};</div><div><span style="white-space:pre">                </span>##Detect requests in the dialog behind NAT and flag with 6</div>
<div> if(nat_uac_test("19") || search("^Route:.*;nat=yes")){</div><div> append_hf("P-hint: LR|fixcontact,setflag6\r\n");</div><div> fix_contact();</div>
<div> setflag(6);</div><div> }; </div><div> route(1);</div><div> } else {</div><div> sl_send_reply("404","Not here");</div><div> }</div>
<div> exit;</div><div> }</div><div><br></div><div><br></div><div> ##Loose_route packets</div><div><div>if (loose_route()) {</div><div> if(!has_totag()){</div><div> sl_send_reply("403", "Initial Loose-Routing Rejected");</div>
<div> exit;</div><div> };</div><div><span style="white-space:pre">        </span></div><div> </div><div> route(1);</div><div> };</div><div><br></div><div> #CANCEL processing</div>
<div> if (is_method("CANCEL")) {</div><div><span style="white-space:pre">        </span> if (t_check_trans()) {</div><div> end_media_session(); </div><div> t_relay();</div>
<div> }; </div><div> exit;</div><div> }</div><div><br></div><div> t_check_trans();</div><div> # </div><div> # -- 3 -- Determine Request Target</div><div> #</div><div> if (method=="REGISTER") {</div>
<div> route(2);</div><div> } else {</div><div> route(3);</div><div> };</div><div>}</div><div><br></div><div>route[1] {</div><div> #</div><div> # -- 4 -- Forward request to target</div><div> #</div>
<div> # Forward statefully</div><div> t_on_reply("1");</div><div> t_on_failure("1");</div><div> if (!t_relay()) {</div><div># sl_reply_error();</div><div> };</div><div> exit;</div>
<div>}</div><div><div>route[2] {</div><div> ## Register request handler</div><div> if (is_uri_host_local()) {</div><div> if (!www_authorize("", "subscriber")) {</div><div> www_challenge("", "0");</div>
<div> exit;</div><div> };</div><div><br></div><div> if (!check_to()) {</div><div> sl_send_reply("403", "Forbidden");</div><div> exit;</div><div> };</div>
<div><br></div><div> if(!search("^Contact:[ ]*\*") && client_nat_test("7")) {</div><div> setflag(6);</div><div> fix_nated_register();</div><div> force_rport();</div>
<div> };</div><div> save("location");</div><div> exit;</div><div><br></div><div> } else if {</div><div><br></div><div> sl_send_reply("403", "Forbidden");</div>
<div>
<br></div><div> };</div><div>}</div><div><br></div><div>route[3] {</div><div> ## Requests handler </div><div> if (method=="INVITE") {</div><div> # Account INVITE packets</div><div> setflag(2);</div>
<div><span style="white-space:pre">        </span> # Account Missed calls</div><div><span style="white-space:pre">        </span> setflag(3);</div><div><span style="white-space:pre">        </span> # Radius Extra</div>
<div> # $avp(s:sip_proxy_ip)="<a href="http://127.0.0.1" target="_blank">127.0.0.1</a>";</div><div> };</div><div> if (is_from_local()){</div><div> # From an internal domain -> check the credentials and the FROM</div>
<div> if(!allow_trusted()){</div><div> if (!proxy_authorize("","subscriber")) {</div><div> proxy_challenge("","0");</div><div> exit;</div>
<div> } else if(!check_from()) {</div><div><div>sl_send_reply("403", "Forbidden, use From=ID");</div><div><span style="white-space:pre">        </span> exit;</div><div>
<span style="white-space:pre">        </span> };<span style="white-space:pre">        </span></div><div> };</div><div><br></div><div> if (client_nat_test("3")) {</div>
<div> append_hf("P-hint: route(3)|setflag7,forcerport,fix_contact\r\n");</div><div> setflag(7);</div><div> force_rport();</div><div> fix_contact();</div><div> };</div>
<div><br></div><div> #unconditional call forward</div><div> if(avp_db_load("$ru/username","$avp(s:callfwd)")) {</div><div> avp_pushto("$ru", "$avp(s:callfwd)");</div>
<div> route(1);</div><div> exit;</div><div> }</div><div><span style="white-space:pre">                </span></div><div> consume_credentials();</div><div><span style="white-space:pre">                </span></div>
<div> #verify aliases, if found replace R-URI. </div><div> lookup("aliases");</div><div><span style="white-space:pre">                                </span></div><div> if (is_uri_host_local()) {</div>
<div> # -- Inbound to Inbound</div><div> route(10);</div><div> } else {</div><div> # -- Inbound to outbound</div><div> route(11);</div><div> };</div><div><br></div>
<div> } else {</div><div><br></div><div> #From an external domain ->do not check credentials</div><div> #Verify aliases, if found replace R-URI. </div><div> lookup("aliases");</div><div>
if (is_uri_host_local()) {</div><div> #-- Outbound to inbound</div><div> route(12);</div><div> } else {</div><div> # -- Outbound to outbound</div><div> route(13);</div>
<div> };</div><div> };</div><div><div>}</div><div><br></div><div>route[4] {</div><div> # routing to the public network</div><div> rewritehostport("xx.xxx.xxx.xx:5065");</div><div> #t_on_failure("2");</div>
<div> if (!t_relay()) {</div><div> sl_reply_error();</div><div> };</div><div>exit;</div><div>}</div><div><br></div><div>route[6] {</div><div> #</div><div> # -- NAT handling --</div><div> #</div><div>
if (isflagset(6) || isflagset(7)) {</div><div> append_hf("P-hint: Route[6]: mediaproxy \r\n");</div><div> use_media_proxy();</div><div> };</div><div>}</div><div><br></div><div>route[10] {</div>
<div> #from an internal domain -> inbound</div><div> #Native SIP destinations are handled using the location table</div><div> #Gateway destinations are handled by regular expressions</div><div> append_hf("P-hint: inbound->inbound \r\n");</div>
<div> </div><div> if (uri=~"^sip:0[1-9][0-9]*@") {</div><div> if (is_user_in("credentials","local")) {</div><div> strip(1); </div><div> prefix("27");</div>
<div> route(6);</div><div> route(4);</div><div> exit;</div><div> } else {</div><div> sl_send_reply("403", "No permissions for local calls");</div><div>
exit;</div>
<div> };</div><div> };</div><div> </div><div> if (uri=~"^sip:00[1-9][0-9]*@") {</div><div> if (is_user_in("credentials","int")) {</div><div> strip(2);</div><div>
route(6);</div><div> route(4);</div><div><div>exit;</div><div> } else {</div><div> sl_send_reply("403", "No permissions for international calls");</div><div> };</div>
<div> };</div><div> </div><div> if (!lookup("location")) { </div><div> </div><div> route(6);</div><div><span style="white-space:pre">        </span> route(1);</div>
<div> } else {</div><div> sl_send_reply("404", "Not Found");</div><div><span style="white-space:pre">        </span> exit;</div><div> };<span style="white-space:pre">        </span> </div>
<div>route(6); </div><div>route(1);</div><div>}</div><div>route[11] {</div><div> # from an internal domain -> outbound</div><div> # Simply route the call outbound using DNS search</div><div> append_hf("P-hint: inbound->outbound \r\n");</div>
<div> route(1);</div><div>}</div><div><br></div><div>route[12] {</div><div> # From an external domain -> inbound</div><div> # Verify aliases, if found replace R-URI.</div><div> lookup("aliases");</div>
<div> if (!lookup("location")) {</div><div> sl_send_reply("404", "Not Found");</div><div> exit;</div><div> };</div><div> route(1);</div><div>}</div><div><br></div>
<div>route[13] {</div><div> #From an external domain outbound</div><div> #we are not accepting these calls</div><div><div> append_hf("P-hint: outbound->inbound \r\n");</div><div> sl_send_reply("403", "Forbidden");</div>
<div> exit;</div><div>}</div><div><br></div><div>failure_route[1] {</div><div> ##--</div><div> ##-- If cancelled, exit. </div><div> ##--</div><div> if (t_was_cancelled()) {</div><div> exit;</div>
<div> };</div><div> ##--</div><div> ##-- If busy send to the e-mail server, prefix the "b"</div><div> ##-- character to indicate busy. </div><div> ##--</div><div> if (t_check_status("486")) {</div>
<div> revert_uri();</div><div> prefix("b");</div><div> rewritehostport("xx.xxx.xxx.xx:5065");</div><div> append_branch();</div><div> route(1);</div>
<div> exit;</div><div> };</div><div> ##--</div><div> ##-- If timeout (408) or unavailable temporarily (480),</div><div> ##-- prefix the uri with the "u"character to indicate </div>
<div> ##-- unanswered and send to the e-mail</div><div> ##-- sever</div><div> ##--</div><div> if (t_check_status("408") || t_check_status("480")) {</div><div> revert_uri();</div>
<div> prefix("u");</div><div> rewritehostport("xx.xxx.xxx.xx:5065");</div><div> append_branch();</div><div> route(1);</div><div> exit;</div><div> };</div>
<div>}</div><div><br></div><div>failure_route[2] {</div><div> t_on_failure("2");</div><div> t_relay();</div><div><div>}</div><div><br></div><div><br></div><div>onreply_route[1] {</div><div><span style="white-space:pre">        </span>#</div>
<div><span style="white-space:pre">        </span>#-- On-replay block routing --</div><div><span style="white-space:pre">        </span>#</div><div><span style="white-space:pre">        </span>if (client_nat_test("1")) {</div>
<div> <span style="white-space:pre">        </span> append_hf("P-hint: Onreply-route - fixcontact \r\n");</div><div> <span style="white-space:pre">        </span> fix_contact();</div>
<div><span style="white-space:pre">        </span>};</div><div><br></div><div><span style="white-space:pre">        </span>if ((isflagset(6) || isflagset(7)) && (status=~"(180)|(183)|2[0-9][0-9]")) {</div>
<div> <span style="white-space:pre">        </span> if (search("^Content-Type:[ ]*application/sdp")) {</div><div> append_hf("P-hint: onreply_route|usemediaproxy \r\n");</div>
<div><span style="white-space:pre">        </span> use_media_proxy();</div><div> };</div><div> };</div><div> exit;</div><div>}</div><div><br></div></div></div></div></div></div>
</div></div></div><div>######################################################################</div><div>Captured Invite packets below.</div><div>#####################################################################</div>
<div><br></div><div>.</div><div>U 2008/12/12 20:41:19.227089 <a href="http://41.23.215.255:5060" target="_blank">41.23.215.255:5060</a> -> xx.xxx.xxx.xx:5060</div><div>INVITE sip:0123825710@xx.xxx.xxx.xx SIP/2.0.</div>
<div>Via: SIP/2.0/UDP 41.23.215.255:5060;branch=z9hG4bK5lvrd249rhhc6dbif4j3i48;rport.</div><div>From: <<a href="mailto:sip%3A1974@10.20.11.62" target="_blank">sip:1974@10.20.11.62</a>>;tag=gm8rd21tl9hc68h6f4j2.</div>
<div>To: <sip:0123825710@xx.xxx.xxx.xx>.</div>
<div>Contact: <<a href="mailto:sip%3A1974@41.23.215.255" target="_blank">sip:1974@41.23.215.255</a>>.</div><div>Accept-Contact: *;+media=audio.</div><div>CSeq: 953 INVITE.</div><div>Call-ID: -u6Sy5l7oIf2mTACTYE46_z8sRn-_f.</div>
<div>
User-Agent: Tuune Mobile.</div><div>Max-Forwards: 70.</div><div>Content-Type: application/sdp.</div><div>Content-Length: 172.</div><div>.</div><div>v=0.</div><div>o=- 54865261 0 IN IP4 <a href="http://41.23.215.255" target="_blank">41.23.215.255</a>.</div>
<div>s=Tuune Mobile.</div><div>c=IN IP4 <a href="http://41.23.215.255" target="_blank">41.23.215.255</a>.</div><div>t=0 0.</div><div>m=audio 5000 RTP/AVP 0 97.</div><div>a=sendrecv.</div><div>a=rtpmap:0 PCMU/8000.</div><div>
a=rtpmap:97 AMR/8000.</div>
<div><br></div><div><br></div><div>U 2008/12/12 20:41:19.227945 xx.xxx.xxx.xx:5060 -> <a href="http://41.23.215.255:5060" target="_blank">41.23.215.255:5060</a></div><div>SIP/2.0 404 Not Found.</div><div>Via: SIP/2.0/UDP 41.23.215.255:5060;branch=z9hG4bK5lvrd249rhhc6dbif4j3i48;rport=</div>
<div>5060.</div><div>From: <<a href="mailto:sip%3A1974@10.20.11.62" target="_blank">sip:1974@10.20.11.62</a>>;tag=gm8rd21tl9hc68h6f4j2.</div><div>To: <sip:0123825710@xx.xxx.xxx.xx>;tag=329cfeaa6ded039da25ff8cbb8668bd2.bf78.</div>
<div>CSeq: 953 INVITE.</div><div>Call-ID: -u6Sy5l7oIf2mTACTYE46_z8sRn-_f.</div><div>Server:Tuune Mobile Test.</div><div>Content-Length: 0.</div><div>.</div><div><div>####################################</div><div>It is online</div>
<div>############</div><div>41:/# openserctl ul show</div><div>database engine 'MYSQL' loaded</div><div>Control engine 'FIFO' loaded</div><div>entering fifo_cmd ul_dump</div><div>Domain:: aliases table=512 records=0 max_slot=0</div>
<div>Domain:: location table=512 records=1 max_slot=1</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AOR:: 1974</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>Contact:: <a href="mailto:sip%3A1974@41.22.248.8">sip:1974@41.22.248.8</a> Q=</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>Expires:: 932</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>Callid:: x1ySy9r2oIf1Ogj2Uzeht2FSEcYGxE</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>Cseq:: 957</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>User-agent:: n/a</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>State:: CS_SYNC</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>Flags:: 0</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>Cflag:: 0</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>Socket:: udp:xx.xxx.xxx.xx:5060</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>Methods:: 4294967295</div>
<div>FIFO command was:</div><div>:ul_dump:openser_receiver_15196</div><div><br></div></div><div><br></div><div><br></div><div><div>I hope some one can give a clue,</div><div>WBR,</div><div>Lu.</div></div><div> <br clear="all">
<br>-- <br>Luzango Mfupe<br>TUUNE MOBILE<br>
Tel:0128440528/0123825710<br>Tshwane-RSA<br><br>"...Ships are safe in harbor, but they were never meant to stay there......."<br>
</div></div>
</div><br><br clear="all"><br><br>
</div>