Marius hi,<br><br>I got the value I needed with:<br><br>$avp(s:xroutetag) = $(hdr(Via){re.subst,/^SIP(.*)x-route-tag=&quot;tgrp:(.*)(&quot;)/\2/});<br><br>You are right about Daniels way so I will continue trying in that.<br>
<br>Thanks for your time<br><br>Alex<br><br><br><br><br><div class="gmail_quote">On Wed, Dec 1, 2010 at 10:26 AM, Marius Zbihlei <span dir="ltr">&lt;<a href="mailto:Marius.Zbihlei@1and1.ro">Marius.Zbihlei@1and1.ro</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;">Hello Alex,<br>
<br>
Can&#39;t test it right now, but it should work better with this :<br>
<div class="im"><br>
$var(s:xroutetag) = $(hdr(Via){re.subst,/^.*;x-route-tag=&quot;(.*)&quot;/\1/})<br>
<br>
</div>You want to substitute (only affects $var) the whole via header with the regex found between () and referenced by \1. Keep in mind that Daniel&#39;s solution is more elegant and should work for you.<br>
<br>
Marius<br>
<br>
________________________________________<br>
From: alex pappas [<a href="mailto:rebel.pappas@gmail.com">rebel.pappas@gmail.com</a>]<br>
Sent: Wednesday, December 01, 2010 9:15 AM<br>
To: Marius Zbihlei<br>
Cc: <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
Subject: Re: [SR-Users] VIA header x-route-tag<br>
<div class="im"><br>
Marius hi,<br>
<br>
Thank you for your replay.<br>
With the regular expression you provided me I get &quot;SIP/2.0/UDP  172.16.0.13:5060;tgrp:TNDEM-ACR&quot;<br>
<br>
Can I isolate only tgrp:TNDEM-ACR ?<br>
<br>
Thank you<br>
Alex<br>
<br>
<br>
</div><div class="im">On Tue, Nov 30, 2010 at 5:07 PM, marius zbihlei &lt;<a href="mailto:marius.zbihlei@1and1.ro">marius.zbihlei@1and1.ro</a>&lt;mailto:<a href="mailto:marius.zbihlei@1and1.ro">marius.zbihlei@1and1.ro</a>&gt;&gt; wrote:<br>

On 11/30/2010 01:58 PM, alex pappas wrote:<br>
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 x-route-tag value to an AVP?<br>
<br>
Thank you in advance<br>
<br>
Alex<br>
<br>
</div>sample VIA header:  Via: SIP/2.0/UDP  <a href="http://10.0.0.15:5060" target="_blank">10.0.0.15:5060</a>&lt;<a href="http://10.0.0.15:5060" target="_blank">http://10.0.0.15:5060</a>&gt;;x-route-tag=&quot;tgrp:TANDEM-KOR&quot;<br>

<div class="im"><br>
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>
<br>
$var(s:xroutetag) = $(hdr(Via){re.subst,/x-route-tag=&quot;(.*)&quot;/\1/});<br>
<br>
<br>
<br>
<br>
Cheers,<br>
Marius<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
</div><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&lt;mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
<div><div></div><div class="h5"><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>
<br>
</div></div></blockquote></div><br>