Hi List, <div><br></div><div>I faced a problem with FS, concerning SIP messages with multiple same headers (for example, Diversion headers).</div><div>FS wasn't able to manage those headers, and only the first one was taken in account by FS.</div>
<div><br></div><div>After some searches in mod_sofia.c, I've made a patch, giving the ability to FS to display and manage multiple SIP Diversion headers (or other headers)</div><div>You can find it here : <a href="http://jira.freeswitch.org/browse/FS-5411">http://jira.freeswitch.org/browse/FS-5411</a></div>
<div><br></div><div>But, I'm facing a new problem : FS is able to <u>read</u> some identical headers and display them as "Diversion", "Diversion-1", "Diversion-2", etc... , but it's not able to <u>write</u> some identical headers</div>
<div><br></div><div>Here is an extract of my test dialplan</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<condition field="${sip_h_Diversion}" expression="\+(\d+).*;reason=(\w+);privacy=(\w+);counter=(\d{1})" break="never"><br> <action application="log" data="LOG Modifying first Diversion" /><br>
<b> <action application="set" data="sip_h_Diversion=<sip:+$1>;reason=$2;privacy=$3;counter=$4" /><br></b> </condition><br><condition field="${sip_h_Diversion-1}" expression="\+(\d+).*;reason=(\w+);privacy=(\w+);counter=(\d{1})" break="never"><br>
<action application="log" data="LOG Modifying second Diversion-1" /><br><b> <action application="set" data="sip_h_Diversion=<sip:+$1>;reason=$2;privacy=$3;counter=$4" /><br>
</b></condition></blockquote><div><br></div><div> </div><div>You can see that I'm trying to write two Diversion headers, because what I'd like to obtain is something like that : </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
INVITE sip:+123456789@fsbox.domain<br>From: ....<br>To : ....<br>........<br>Diversion: <<a href="mailto:sip%3A%2B987654321@domain.com">sip:+987654321@domain.com</a>>;reason=unavailable;privacy=off;counter=1<br>Diversion: <<a href="mailto:sip%3A%2B258147369@domain.com">sip:+258147369@domain.com</a>>;reason=do-not-disturb;privacy=off;counter=1</blockquote>
<div><br></div><div>But what I really obtain is : </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
INVITE sip:+123456789@fsbox.domain<br>From: ....<br>To : ....<br>........<br>Diversion: <<a href="mailto:sip%3A%2B987654321@domain.com">sip:+987654321@domain.com</a>>;reason=unavailable;privacy=off;counter=1<br><b>Diversion-1</b>: <<a href="mailto:sip%3A%2B258147369@domain.com">sip:+258147369@domain.com</a>>;reason=do-not-disturb;privacy=off;counter=1</blockquote>
<div><br></div><div>So, FS automatically write the second Diversion header with a "-1" at the end ... And it's really frustrating !</div><div><br></div><div>Moreover, I don't want to use a FS function to make every SIP headers copied automatically from A-leg to B-leg, because some of my SIP providers don't support every header, and I have to only send essential ones.</div>
<div><br></div><div><br></div><div>Do you have any idea / question / answer to help me, please ? Perhaps my patch may be corrected, but I don't know how... </div><div> </div></div><div>Thanks a lot, </div><div><br></div>
<div><br clear="all"><div><b><div><span style="font-weight:normal">Bien cordialement, </span></div><div><span style="font-weight:normal">Best Regards, </span></div><div><span style="font-weight:normal"><br></span></div></b><b>Kevin MATHY</b><div>
<b><br></b></div></div>
</div>
<br>
<img src="http://www.hexanet.fr/sites/files/hexanet/files/20130205_signature_hexanet.gif">