<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
I have coded with while for treat all diversion headers.<br>
<br>
Ex:<br>
....<br>
<i>while ($var(i) < $(hdrcnt(Diversion)))</i><i><br>
</i><i>{</i><i><br>
</i><i>
if(!$(hdr(Diversion)[$var(i)]{param.value,counter}{s.int}) ||
!$(hdr(Diversion)[$var(i)]{param.value,privacy}) ||
!$(hdr(Diversion)[$var(i)]{param.value,reason}))</i><i><br>
</i><i> {</i><i><br>
</i><i> ....</i><br>
<br>
after all these treatments, I can not replace the good diversion
header, if I have multiple diversion.<br>
<br>
Ex:<br>
If I have: <br>
<br>
<i>Diversion: <a class="moz-txt-link-rfc2396E" href="mailto:sip:******@hexanet.fr"><sip:******@hexanet.fr></a>; reason="user-busy";
privacy="full" ;counter=3</i><i><br>
</i><i>Diversion: <a class="moz-txt-link-rfc2396E" href="mailto:sip:******@hexanet.fr"><sip:******@hexanet.fr></a>;
reason="user-busy"; privacy="off"</i><br>
<br>
and if I use:<br>
remove_hf("Diversion"), to rewrite the second diversion header.
Opensips delete the first diversion header.<br>
<br>
How can I rewrite the good diversion header, here the second ?<br>
<br>
thanks<br>
<br>
Le 02/05/2013 19:21, Saúl Ibarra Corretgé a écrit :<br>
</div>
<blockquote
cite="mid:452BA0F3-5BBE-4488-9C15-1CBF8EE0624C@ag-projects.com"
type="cite">
<pre wrap="">
On May 2, 2013, at 4:20 PM, Mickael HUBERT wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Thank you very much, it's perfect ;)
but, if I have many Diversion header in the same INVITE ? This command works ?
</pre>
</blockquote>
<pre wrap="">
You can index the call to hdr(Diversion), IIRC there is an example in the transformations page showing how to iterate through a list of headers with the same name.
--
Saúl Ibarra Corretgé
AG Projects
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>