<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: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;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {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 style='color:#1F497D'>Thanks again Daniel<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’ve been reading deeply the module info and learning a lot. Your easy solution worked thou, using the </span><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:ES'>subst_hf</span><span lang=EN-US style='color:#1F497D'>  function instead of the normal subst the alias is added correctly and then the following bye is also correctly handled.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The final line I use is:<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle style='text-indent:35.4pt'><i><span lang=EN-US style='font-size:12.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:ES'>subst_hf("Contact", "/>.*$/>/", "a");<o:p></o:p></span></i></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 again for this great user mailing list! And for the kamailio itself<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'>BR,<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> viernes, 30 de agosto de 2013 9:48<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'>Hello,<o:p></o:p></p><div><p class=MsoNormal>On 8/29/13 5:24 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'>Thanks! Thank you very very much for your help.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I’ll add the ngrep next time!</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'>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] {:</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'>if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$"))</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                return;</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                # only local users allowed to call</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                if(from_uri!=myself) {</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               sl_send_reply("403", "Not Allowed");</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               exit;</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'>                if (strempty($sel(cfg_get.pstn.gw_port))) {</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                } else {</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                               $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                                                                              + $sel(cfg_get.pstn.gw_port);</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'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'># modifications to acces env5</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>subst_uri('/^<a href="sip:00(.*)/sip:\1/i')">sip:00(.*)/sip:\1/i')</a>; #append delete the 00</span><o:p></o:p></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</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'>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><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'>msg_apply_changes() is not used in default config file, you have to add it yourself -- it is part of textopsx module which is loaded in default config file -- see its readme for more details.<br><br><br><o:p></o:p></span></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'>I’m not actually moving the > just droping everything after it.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:ES'><br>Better said, you remove the contact header and then add only the part up to >, but the operations done inside are a bit different than people would might expect, by using data lumps (if you search in mailing list archive you can find more details).<br><br><br><o:p></o:p></span></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'>I’m sure there is a better option to change the contact header, would you have any suggestion?</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:ES'>You can give a try with:<br>subst_hf("Contact", ">.*$", ">");<br>but might result in same troubles, because alias parameter is added after this operation. So you have to use msg_apply_changes(). But don't forget to move the record_route() after msg_apply_changes().<br><br>Cheers,<br>Daniel<br><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>