Daniel hi,<br><br>When I&#39;m trying the bellow I get the following error:<br><br>Dec  1 10:06:17 opensips1 kamailio: ERROR: &lt;core&gt; [select.c:149]: parse_select: invalid index, no closing ] <br>Dec  1 10:06:17 opensips1 kamailio: ERROR: pv [pv_select.c:45]: invalid select name [@via.params[x-route-tag]] <br>
Dec  1 10:06:17 opensips1 kamailio: ERROR: &lt;core&gt; [pvapi.c:550]: pvar &quot;sel&quot; has an invalid name param [@via.params[x-route-tag]] <br>Dec  1 10:06:17 opensips1 kamailio: ERROR: &lt;core&gt; [pvapi.c:705]: wrong char [)/41] in [$sel(@via.params[x-route-tag])] at [29 (5)] <br>
Dec  1 10:06:17 opensips1 kamailio: : &lt;core&gt; [cfg.y:3328]: parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 705, column 23-52: unknown script pseudo variable $sel(@via.params[x-route-tag]) <br><br>
I also added an @ before the via<br><br>if (search(&quot;x-route-tag&quot;))<br>        {<br>                $avp(s:xroutetag) = $sel(<b>@</b>via.params[x-route-tag]);<br>                xlog(&quot;----- We have a x-route-tag in the SIP msg avp: $avp(s:xroutetag) -----&quot;);<br>
        };<br><br><br>Thank you<br>Alex<br><br><br><div class="gmail_quote">On Tue, Nov 30, 2010 at 10:47 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

  
    
  
  <div bgcolor="#ffffff" text="#000000"><div><div></div><div class="h5">
    <br>
    <br>
    On 11/30/10 4:07 PM, marius zbihlei wrote:
    <blockquote type="cite">
      
      On 11/30/2010 01:58 PM, alex pappas wrote:
      <blockquote type="cite">Dear All,<br>
        <br>
        We have some cisco gw that they send to the Kamailio in the
        first
        invite and inside the VIA header an x-route-tag=&quot;The Gateway
        that the
        call entered&quot;.<br>
        <br>
        I&#39;m trying to add this to the acc module in order to have it
        recorded
        but without sucess.<br>
        My config is this:<br>
        <br>
        if (search(&quot;x-route-tag&quot;))<br>
                {<br>
                        avp(s:xroutetag) = $sel(@via);<br>
                        xlog(&quot;----- We have a x-route-tag in the SIP msg
        avp:
        $avp(s:xroutetag) -----&quot;);<br>
                };<br>
        <br>
        I&#39;m trying to add the VIA header to an avp so I could manipulate
        the
        string but i cannot implement this.<br>
        <br>
        Does anyone can suggest a way to add the <b>x-route-tag</b>
        value to
        an AVP?<br>
        <br>
        Thank you in advance<br>
        <br>
        Alex<br>
        <br>
        sample VIA header:  Via: SIP/2.0/UDP  <a href="http://10.0.0.15:5060" target="_blank">10.0.0.15:5060</a>;<b>x-route-tag=&quot;tgrp:TANDEM-KOR&quot;</b><br>
        <br>
      </blockquote>
      Hello, <br>
      <br>
      You can use transformations
      <a href="http://kamailio.org/dokuwiki/doku.php/transformations:3.1.x" target="_blank">http://kamailio.org/dokuwiki/doku.php/transformations:3.1.x</a>
      . This
      should to the trick: (careful on needed modules)<br>
      <br>
      <pre>$var<span>(</span>s:xroutetag<span>)</span> <span>=</span> $<span>(</span>hdr(Via)<span>{</span>re.<span>subst</span><span>,/</span><span></span><span></span><span></span><span></span><span></span><span></span><span>x-route-tag=&quot;(.*)&quot;</span><span>/</span>\1<span>/</span><span>}</span><span>)</span><span>;


</span></pre>
    </blockquote></div></div>
    just as alternative, in this case it should works also with selects
    variables, you can try:<br>
    <br>
    $sel(via.params[x-route-tag])<br>
    <br>
    Cheers,<br>
    Daniel<br><font color="#888888">
    <pre cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
  </font></div>

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