<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 8/29/13 5:24 PM, Helena Garcia-Nieto
      wrote:<br>
    </div>
    <blockquote cite="mid:007401cea4cb$d7b4f4c0$871ede40$@morodo.co.uk"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Thanks!
            Thank you very very much for your help.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">I’ll
            add the ngrep next time!<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">I’m
            absolutely new at kamailio and I’m doing the Subs on the
            main config file (</span><span
style="font-size:8.0pt;font-family:"Tahoma","sans-serif""
            lang="EN-US">/usr/local/etc/kamailio/kamailio.cfg) </span><span
            style="color:#1F497D" lang="EN-US">on the PSTN call
            detection route[PSTN] {:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$"))<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">               
            return;<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">               
            # only local users allowed to call<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">               
            if(from_uri!=myself) {<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">                              
            sl_send_reply("403", "Not Allowed");<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">                              
            exit;<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">               
            }<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">               
            if (strempty($sel(cfg_get.pstn.gw_port))) {<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">                              
            $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">               
            } else {<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">                              
            $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">                                                                             
            + $sel(cfg_get.pstn.gw_port);<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">               
            }<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">#
            modifications to acces env5<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">subst_uri('/^<a class="moz-txt-link-freetext" href="sip:00(.*)/sip:\1/i')">sip:00(.*)/sip:\1/i')</a>;
            #append delete the 00<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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 style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">And
            I cannot find the </span><span lang="EN-US">msg_apply_changes();
          </span><span style="color:#4F81BD" lang="EN-US">part on that
            file, can you tell me where I can better do the subs, in
            which file?</span></p>
      </div>
    </blockquote>
    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>
    <blockquote cite="mid:007401cea4cb$d7b4f4c0$871ede40$@morodo.co.uk"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#4F81BD" lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">I’m
            not actually moving the > just droping everything after
            it.</span></p>
      </div>
    </blockquote>
    <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>
    <blockquote cite="mid:007401cea4cb$d7b4f4c0$871ede40$@morodo.co.uk"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">I’m
            sure there is a better option to change the contact header,
            would you have any suggestion?</span></p>
      </div>
    </blockquote>
    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>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013
  - more details about Kamailio trainings at <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a> -
</pre>
  </body>
</html>