<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=ES link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thanks! Thank you very very much for your help.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’ll add the ngrep next time!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’m absolutely new at kamailio and I’m doing the Subs on the main config file (</span><span lang=EN-US style='font-size:8.0pt;font-family:"Tahoma","sans-serif"'>/usr/local/etc/kamailio/kamailio.cfg) </span><span lang=EN-US style='color:#1F497D'>on the PSTN call detection route[PSTN] {:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$"))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                return;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                # only local users allowed to call<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                if(from_uri!=myself) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               sl_send_reply("403", "Not Allowed");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               exit;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                if (strempty($sel(cfg_get.pstn.gw_port))) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                } else {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                                                                              + $sel(cfg_get.pstn.gw_port);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'># modifications to acces env5<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>subst_uri('/^sip:00(.*)/sip:\1/i'); #append delete the 00<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>subst('/^Contact: (.*)>.*$/Contact: \1>/i');#delete the parameter that is anoying env5 on contact header<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>And I cannot find the </span><span lang=EN-US>msg_apply_changes(); </span><span lang=EN-US style='color:#4F81BD'>part on that file, can you tell me where I can better do the subs, in which file?</span><span lang=EN-US style='color:#4F81BD'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’m not actually moving the > just droping everything after it.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’m sure there is a better option to change the contact header, would you have any suggestion?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thanks in advanced<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Helena<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:ES'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:ES'> Daniel-Constantin Mierla [mailto:miconda@gmail.com] <br><b>Sent:</b> jueves, 29 de agosto de 2013 15:49<br><b>To:</b> Helena Garcia-Nieto; 'Kamailio (SER) - Users Mailing List'<br><b>Subject:</b> Re: [SR-Users] Server silently droping Bye message.<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>ngrep output is preferred, because expanded wireshark has to much garbage around actuall sip message content. If you have the wireshark capture, then you can export pcap file and then use 'ngrep -qt -W byline -I file.pcap' to get pure text format for sip messages (then replace your ip addresses as needed).<br><br>Anyhow, for this case the problem resides in the contact header you send out. The alias parameter has to be before the '>' but your subst() moves the '>' after the initial contact uri, leaving the new parameter alias out of URI itself, resulting in being a header parameter.<br><br>One solution is to do subst() before record_route() in the config and after it execute:<br><br>msg_apply_changes();<br><br>Cheers,<br>Daniel<o:p></o:p></p><div><p class=MsoNormal>On 8/29/13 3:31 PM, Helena Garcia-Nieto wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Sorry I thought I attached the complete trace, I captured it with wireshark on the server machine so I hope it is enough since you can see both sides.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Yes I realized the alias is added on the invite from the Kamailio to the PSTN GW:</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Contact: <a href="sip:AndroidAnumber@PrivateAndroidIP:35986;transport=tcp"><sip:AndroidAnumber@PrivateAndroidIP:35986;transport=tcp></a>;alias=PublicAndroidIP~35986~2</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>but it is not present on the BYE the PSTNGW send back to kamailio.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>But kamailio has the information on the database, so I though it  may be able to send the message anyway.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thanks </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Helena</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><o:p></o:p></p></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:ES'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>Daniel-Constantin Mierla - <a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre><pre><a href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre><pre>Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013<o:p></o:p></pre><pre>  - more details about Kamailio trainings at <a href="http://www.asipto.com">http://www.asipto.com</a> -<o:p></o:p></pre></div></body></html>