[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-users
Subject:    Re: [SR-Users] Fw: Kamailio and freeswitch integration for SBC
From:       SamyGo <govoiper () gmail ! com>
Date:       2016-01-29 17:02:54
Message-ID: CAJUJwtiw3USXqkrJRArkF5j7=jC65JBXuT3b1HFVaQZW8u2-Ew () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Sorry for last email:
if (!lookup("location")) {
$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;
}
}
That is where you get 404 Not Found. What I see is that you're registering
users with domain as AbdulKamailioSIP.com but when your FreeSwitch sends
call to Kamailio the RURI becomes: *INVITE sip:7632689993@10.22.52.2
<sip%3A7632689993@10.22.52.2> SIP/2.0* Which is definitely not matching any
User like: INVITE sip:7632689993@*AbdulKamailioSIP.com* SIP/2.0 So, you
need to go in your FS dialplan and make sure you set the proper Domains
before sending call out, there are couple of ways to do this. *1 - *Using
FreeSWITCH to set FROM domain:
https://wiki.freeswitch.org/wiki/Variable_sip_invite_domain *2 - *Use
custom SIP header from FS to contain a domain name, and in Kamailio set
headers as you require; something like this: Attach a SIP Header in FS
dialplan before sending call out to Kamailio, say X-USER-DOMAIN:
AbdulKamailioSIP.com Next when I receive call in Kamailio.cfg I detect this
header if(is_present_hf("X-USER-DOMAIN")) { $ru = "sip:" + $rU + "@" +
$hdr(X-USER-DOMAIN); $td = $hdr(X-USER-DOMAIN); } In option 2 you must do
it before executing record_route() functions, so possibly need to do this
inside your FSINBOUND route. I prefer option 1. PS: Wireshark highlights
any custom SIP headers in sky blue, that doesn't mean there is any error in
there.

Regards,
Sammy


On Fri, Jan 29, 2016 at 11:47 AM, SamyGo <govoiper@gmail.com> wrote:

> Hi Abdul,
>
> This is where you are getting your 404 NOT Found from Kamailio:
>
>
>
> On Thu, Jan 28, 2016 at 4:30 PM, malik sherif <asherif74@hotmail.com>
> wrote:
>
>> I will also run the commands that suggested.
>>
>>
>> ------------------------------
>> *From:* sr-users <sr-users-bounces@lists.sip-router.org> on behalf of
>> SamyGo <govoiper@gmail.com>
>> *Sent:* Thursday, January 28, 2016 6:08 PM
>> *To:* Kamailio (SER) - Users Mailing List
>> *Subject:* Re: [SR-Users] Fw: Kamailio and freeswitch integration for SBC
>>
>> I believe Daniel is busy with FOSDEM ,
>>
>>
>> Abdul can you confirm that you're still getting this output in FS
>> console:
>>
>> 2016-01-13 05:37:29.572184 [INFO] mod_dialplan_xml.c:635 Processing
>> 7632689991 <7632689991>->kb-7632689993 in context default
>> 2016-01-13 05:37:29.572184 [CRIT] mod_dptools.c:1638 WARNING WARNING
>> WARNING WARNING WARNING WARNING WARNING WARNING WARNING
>> 2016-01-13 05:37:29.572184 [CRIT] mod_dptools.c:1638 Open
>> /usr/local/freeswitch/conf/vars.xml and change the default_password.
>> 2016-01-13 05:37:29.572184 [CRIT] mod_dptools.c:1638 Once changed type
>> 'reloadxml' at the console.
>> 2016-01-13 05:37:29.572184 [CRIT] mod_dptools.c:1638 WARNING WARNING
>> WARNING WARNING WARNING WARNING WARNING WARNING WARNING
>> 2016-01-13 05:37:39.632245 [NOTICE] switch_channel.c:1055 New Channel
>> sofia/internal/7632689993@10.22.52.2
>> [d52b6ef9-c4f6-4edf-aff9-8a8da3761788]
>> 2016-01-13 05:37:39.632245 [NOTICE] sofia.c:7539 Hangup sofia/internal/
>> 7632689993@10.22.52.2 [CS_ROUTING] [UNALLOCATED_NUMBER]
>>
>> Please paste your complete dialplan here as well, though this clearly
>> states that the number it tried to dial is not registered or unable to dial
>> to.
>> please paste out the content of the following command just before dialing:
>>
>> * fs_cli> show registrations *
>> Also, it will help you find out useful info about why it shows you
>> UNALLOCATED NUMBER if you enable the sofia sip debug by using the following
>> command.
>>
>> *fs_cli> sofia global siptrace on *
>> Once you execute the above command make a call to destination and see
>> what FreeeSWITCH is trying to do.
>>
>> Thanks,
>> Sammy.
>>
>> On Thu, Jan 28, 2016 at 11:23 AM, malik sherif <asherif74@hotmail.com>
>> wrote:
>>
>>>
>>> Any hint?
>>>
>>> ------------------------------
>>> *From:* sr-users <sr-users-bounces@lists.sip-router.org> on behalf of
>>> malik sherif <asherif74@hotmail.com>
>>> *Sent:* Tuesday, January 26, 2016 11:35 PM
>>> *To:* Kamailio (SER) - Users Mailing List; miconda@gmail.com
>>>
>>> *Subject:* Re: [SR-Users] Kamailio and freeswitch integration for SBC
>>>
>>>
>>> Thanks again and here is the pcap file.
>>>
>>> Thanks
>>>
>>> Abdul
>>>
>>>
>>> ------------------------------
>>> *From:* Daniel-Constantin Mierla <miconda@gmail.com>
>>> *Sent:* Friday, January 22, 2016 8:46 AM
>>> *To:* malik sherif; Kamailio (SER) - Users Mailing List
>>> *Subject:* Re: [SR-Users] Kamailio and freeswitch integration for SBC
>>>
>>> Can you attach the pcap file - copy&paste inline makes it imposible to
>>> read and digest it with a traffic analyzer (e.g., wireshark).
>>>
>>> Cheers,
>>> Daniel
>>>
>>> On 21/01/16 18:31, malik sherif wrote:
>>>
>>>
>>>
>>>
>>> ------------------------------
>>> *From:* sr-users <sr-users-bounces@lists.sip-router.org>
>>> <sr-users-bounces@lists.sip-router.org> on behalf of malik sherif
>>> <asherif74@hotmail.com> <asherif74@hotmail.com>
>>> *Sent:* Wednesday, January 20, 2016 9:55 PM
>>> *To:* Kamailio (SER) - Users Mailing List
>>> *Subject:* Re: [SR-Users] Kamailio and freeswitch integration for SBC
>>>
>>>
>>> Copy and paste part of tcmdump and highlighted the 404. 10.22.52.2 is
>>> the server IP address
>>>
>>> Thanks again
>>>
>>> Abdul
>>>
>>>
>>> <http://kb.asipto.com/freeswitch:kamailio-3.3.x-freeswitch-1.2.x-sbc>
>>>
>>>
>>> --
>>> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>>> Book: SIP Routing With Kamailio - http://www.asipto.comhttp://miconda.eu
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>> _______________________________________________
>> 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
>>
>>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div><span class="" style="white-space:pre">Sorry for last email:

<div style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">	</span>if (!lookup(&quot;location&quot;)) {</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">		</span>$var(rc) = $rc;</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">		</span>route(TOVOICEMAIL);</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">		</span>t_newtran();</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">		</span>switch ($var(rc)) {</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">			</span>case -1:</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">			</span>case -3:</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">				</span>send_reply(&quot;404&quot;, &quot;Not \
Found&quot;);</font></div><div style="white-space:normal"><font face="monospace, \
monospace"><span class="" style="white-space:pre">				</span>exit;</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">			</span>case -2:</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">				</span>send_reply(&quot;405&quot;, &quot;Method Not \
Allowed&quot;);</font></div><div style="white-space:normal"><font face="monospace, \
monospace"><span class="" style="white-space:pre">				</span>exit;</font></div><div \
style="white-space:normal"><font face="monospace, monospace"><span class="" \
style="white-space:pre">		</span>}</font></div><div style="white-space:normal"><font \
face="monospace, monospace"><span class="" \
style="white-space:pre">	</span>}</font></div>

That is where you get 404 Not Found. 

What I see is that you&#39;re registering users with domain as AbdulKamailioSIP.com  \
but when your FreeSwitch sends call to Kamailio the RURI becomes: 

<b>INVITE <a href="mailto:sip%3A7632689993@10.22.52.2">sip:7632689993@10.22.52.2</a> \
SIP/2.0</b>

Which is definitely not matching any User like: INVITE \
sip:7632689993@<b>AbdulKamailioSIP.com</b> SIP/2.0

So, you need to go in your FS dialplan and make sure you set the proper Domains \
before sending call out, there are couple of ways to do this. 

<b>1 - </b>Using FreeSWITCH to set FROM domain: <a \
href="https://wiki.freeswitch.org/wiki/Variable_sip_invite_domain">https://wiki.freeswitch.org/wiki/Variable_sip_invite_domain</a>


<b>2 - </b>Use custom SIP header from FS to contain a domain name, and in Kamailio \
set headers as you require; something like this:

Attach a SIP Header in FS dialplan before sending call out to Kamailio, say <font \
face="monospace, monospace">X-USER-DOMAIN: AbdulKamailioSIP.com  </font>
Next when I receive call in Kamailio.cfg I detect this header 
<font face="monospace, monospace">
if(is_present_hf(&quot;X-USER-DOMAIN&quot;)) {
    $ru = &quot;sip:&quot; + $rU + &quot;@&quot; + $hdr(X-USER-DOMAIN);
    $td = $hdr(X-USER-DOMAIN); 
}
</font>In option 2 you must do it before executing record_route() functions, so \
possibly need to do this inside your FSINBOUND route.

I prefer option 1.

PS: Wireshark highlights any custom SIP headers in sky blue, that doesn&#39;t mean \
there is any error in there.</span></div><div><span class="" \
style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre"> \
Regards,</span></div><div><span class="" style="white-space:pre"> \
Sammy</span></div><div><span class="" \
style="white-space:pre"><br></span></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Fri, Jan 29, 2016 at 11:47 AM, SamyGo <span dir="ltr">&lt;<a \
href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div dir="ltr">Hi Abdul,<div><br>This is where you are \
getting your 404 NOT Found from \
Kamailio:</div><div><br></div><div><br></div></div><div class="HOEnZb"><div \
class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 28, 2016 \
at 4:30 PM, malik sherif <span dir="ltr">&lt;<a href="mailto:asherif74@hotmail.com" \
target="_blank">asherif74@hotmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">




<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <p>I will also run the commands that suggested.<br>
</p>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, \
sans-serif"><span><b>From:</b> sr-users &lt;<a \
href="mailto:sr-users-bounces@lists.sip-router.org" \
target="_blank">sr-users-bounces@lists.sip-router.org</a>&gt; on behalf of SamyGo \
&lt;<a href="mailto:govoiper@gmail.com" \
target="_blank">govoiper@gmail.com</a>&gt;<br> </span><b>Sent:</b> Thursday, January \
28, 2016 6:08 PM<span><br> <b>To:</b> Kamailio (SER) - Users Mailing List<br>
</span><b>Subject:</b> Re: [SR-Users] Fw: Kamailio and freeswitch integration for \
SBC</font> <div>  </div>
</div><div><div>
<div>
<div dir="ltr">I believe Daniel is busy with FOSDEM , <br>
<br>
<br>
Abdul can you confirm that you&#39;re still getting this output in FS console:  <br>
<font face="times new roman, serif"><br>
2016-01-13 05:37:29.572184 [INFO] mod_dialplan_xml.c:635 Processing 7632689991 \
&lt;7632689991&gt;-&gt;kb-7632689993 in context default<br> 2016-01-13 \
05:37:29.572184 [CRIT] mod_dptools.c:1638 WARNING WARNING WARNING WARNING WARNING \
WARNING WARNING WARNING WARNING <br>
2016-01-13 05:37:29.572184 [CRIT] mod_dptools.c:1638 Open \
/usr/local/freeswitch/conf/vars.xml and change the default_password.<br> 2016-01-13 \
05:37:29.572184 [CRIT] mod_dptools.c:1638 Once changed type &#39;reloadxml&#39; at \
the console.<br> 2016-01-13 05:37:29.572184 [CRIT] mod_dptools.c:1638 WARNING WARNING \
WARNING WARNING WARNING WARNING WARNING WARNING WARNING <br>
<font color="#ff0000">2016-01-13 05:37:39.632245 [NOTICE] switch_channel.c:1055 New \
Channel sofia/internal/<a href="mailto:7632689993@10.22.52.2" \
target="_blank">7632689993@10.22.52.2</a> \
[d52b6ef9-c4f6-4edf-aff9-8a8da3761788]</font><br> <font color="#ff0000">2016-01-13 \
05:37:39.632245 [NOTICE] sofia.c:7539 Hangup sofia/internal/<a \
href="mailto:7632689993@10.22.52.2" target="_blank">7632689993@10.22.52.2</a> \
[CS_ROUTING] [UNALLOCATED_NUMBER]</font><br> <br>
</font>Please paste your complete dialplan here as well, though this clearly states \
that the number it tried to dial is not registered or unable to dial to.<font \
face="times new roman, serif"><font color="#000000"><br> </font></font>please paste \
out the content of the following command just before dialing:<font face="times new \
roman, serif"><b style="color:rgb(255,0,0)"><br> fs_cli&gt; show registrations<br>
</b><br>
</font>Also, it will help you find out useful info about why it shows you UNALLOCATED \
NUMBER if you enable the sofia sip debug by using the following command.<font \
face="times new roman, serif"><br> <b style="color:rgb(255,0,0)">fs_cli&gt; sofia \
global siptrace on<br> </b><br>
</font>Once you execute the above command make a call to destination and see what \
FreeeSWITCH is trying to do. <br>
<br>
Thanks,<br>
Sammy.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jan 28, 2016 at 11:23 AM, malik sherif <span \
dir="ltr"> &lt;<a href="mailto:asherif74@hotmail.com" \
target="_blank">asherif74@hotmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <p><br>
</p>
<p>Any hint?<br>
</p>
<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, \
sans-serif"><span><b>From:</b> sr-users &lt;<a \
href="mailto:sr-users-bounces@lists.sip-router.org" \
target="_blank">sr-users-bounces@lists.sip-router.org</a>&gt; on behalf of malik  \
sherif &lt;<a href="mailto:asherif74@hotmail.com" \
target="_blank">asherif74@hotmail.com</a>&gt;<br> </span><b>Sent:</b> Tuesday, \
January 26, 2016 11:35 PM<br> <b>To:</b> Kamailio (SER) - Users Mailing List; <a \
href="mailto:miconda@gmail.com" target="_blank"> miconda@gmail.com</a>
<div>
<div><br>
<b>Subject:</b> Re: [SR-Users] Kamailio and freeswitch integration for SBC</div>
</div>
</font>
<div>  </div>
</div>
<div>
<div>
<div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <p>Thanks again and here is the pcap file.</p>
<p>Thanks</p>
<p>Abdul<br>
</p>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, \
sans-serif"><b>From:</b> Daniel-Constantin Mierla &lt;<a \
href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;<br> \
<b>Sent:</b> Friday, January 22, 2016 8:46 AM<br> <b>To:</b> malik sherif; Kamailio \
(SER) - Users Mailing List<br> <b>Subject:</b> Re: [SR-Users] Kamailio and freeswitch \
integration for SBC</font> <div>  </div>
</div>
<div>Can you attach the pcap file - copy&amp;paste inline makes it imposible to read \
and digest it with a traffic analyzer (e.g., wireshark).<br> <br>
Cheers,<br>
Daniel<br>
<br>
<div>On 21/01/16 18:31, malik sherif wrote:<br>
</div>
<blockquote type="cite">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <p><br>
</p>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, \
sans-serif"><b>From:</b> sr-users <a \
href="mailto:sr-users-bounces@lists.sip-router.org" \
target="_blank">&lt;sr-users-bounces@lists.sip-router.org&gt;</a> on behalf of malik \
sherif <a href="mailto:asherif74@hotmail.com" \
target="_blank">&lt;asherif74@hotmail.com&gt;</a><br> <b>Sent:</b> Wednesday, January \
20, 2016 9:55 PM<br> <b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Kamailio and freeswitch integration for SBC</font>
<div>  </div>
</div>
<div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <p>Copy and paste part of tcmdump and highlighted the 404. 10.22.52.2 is the server \
IP address</p> <p>Thanks again</p>
<p>Abdul<br>
</p>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <div style="color:rgb(0,0,0)">
<div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <div style="color:rgb(0,0,0)">
<div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <div style="color:rgb(0,0,0)">
<div>
<blockquote type="cite">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <div style="color:rgb(0,0,0)">
<div>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
 <div style="color:rgb(0,0,0)">
<div><a href="http://kb.asipto.com/freeswitch:kamailio-3.3.x-freeswitch-1.2.x-sbc" \
style="display:table-cell;text-align:center" target="_blank"><img \
style="display:inline-block;max-width:250px;max-height:250px;min-height:49px;width:180px;border-width:0px;vertical-align:bottom" \
height="49" width="180" src="http://kb.asipto.com/_media/wiki:logo.png"></a> </div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<pre cols="72">-- 
Daniel-Constantin Mierla
<a href="http://twitter.com/#!/miconda" \
target="_blank">http://twitter.com/#!/miconda</a> - <a \
href="http://www.linkedin.com/in/miconda" \
                target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" \
target="_blank">http://www.asipto.com</a> <a href="http://miconda.eu" \
target="_blank">http://miconda.eu</a></pre> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" \
target="_blank">sr-users@lists.sip-router.org</a><br> <a \
href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" \
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br> \
<br> </blockquote>
</div>
<br>
</div>
</div>
</div></div></div>
</div>
</div>

<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" \
target="_blank">sr-users@lists.sip-router.org</a><br> <a \
href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" \
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br> \
<br></blockquote></div><br></div> </div></div></blockquote></div><br></div>



_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic