<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Option 2 should work fine.<div><br><div><div>On Apr 23, 2014, at 6:48 PM, Sanjiv Kumar <<a href="mailto:sanjiv@simple2call.com">sanjiv@simple2call.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);">I have tried following three options and I don’t multiple diversion header.<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);">OPTION 1<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);">If I use “push” application, I get the diversion field like below<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);">Diversion: ARRAY::<<a href="sip:18005551212@10.10.10.10" style="color: purple; text-decoration: underline;">sip:18005551212@10.10.10.10</a>>;reason=user-busy;counter=3;privacy=off|:<<a href="sip:18005552323" style="color: purple; text-decoration: underline;">sip:18005552323</a>>;reason=no-answer;counter=1;privacy=off<o:p></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><extension name="public_did"><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <condition field="destination_number" expression="^9999(\d{10})$"><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="ocn=18005551212"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="rdn=18005552323"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="push" data="sip_h_Diversion =<<a href="sip:$%7bocn%7d@$%7bnetwork_addr%7d" style="color: purple; text-decoration: underline;">sip:${ocn}@${network_addr}</a>>;reason=user-busy;counter=3;privacy=off"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="push" data="sip_h_Diversion =<<a href="sip:$%7brdn%7d@$%7bnetwork_addr%7d" style="color: purple; text-decoration: underline;">sip:${rdn}@${network_addr}</a>>;reason=no-answer;counter=1;privacy=off"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="hangup_after_bridge=true" /><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="continue_on_fail=true"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="transfer" data="1001 XML default"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> </condition><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"></extension><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">OPTION 2<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);">If I use export with “,” then I get the following results:<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);">Diversion: <<a href="sip:19082302337@216.1.185.103" style="color: purple; text-decoration: underline;">sip:19082302337@216.1.185.103</a>>;reason=user-busy;counter=3;privacy=off,<<a href="sip:13216938059@216.1.185.103" style="color: purple; text-decoration: underline;">sip:13216938059@216.1.185.103</a>>;reason=no-answer;counter=1;privacy=off<o:p></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><extension name="public_did"><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <condition field="destination_number" expression="^9999(\d{10})$"><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="ocn=18005551212"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="rdn=18005552323"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="export" data="sip_h_Diversion =<<a href="sip:$%7bocn%7d@$%7bnetwork_addr%7d" style="color: purple; text-decoration: underline;">sip:${ocn}@${network_addr}</a>>;reason=user-busy;counter=3;privacy=off, <<a href="sip:$%7brdn%7d@$%7bnetwork_addr%7d" style="color: purple; text-decoration: underline;">sip:${rdn}@${network_addr}</a>>;reason=no-answer;counter=1;privacy=off "/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="hangup_after_bridge=true" /><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="continue_on_fail=true"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="transfer" data="1001 XML default"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> </condition><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"></extension><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span class="mw-headline"><span lang="EN">OPTION 3<o:p></o:p></span></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span class="mw-headline"><span lang="EN">Setting a specific array element I get the following result<o:p></o:p></span></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);">Diversion: ARRAY::<<a href="sip:19082302337@216.1.185.103" style="color: purple; text-decoration: underline;">sip:19082302337@216.1.185.103</a>>;reason=user-busy;counter=3;privacy=off}|:<<a href="sip:13216938059@216.1.185.103" style="color: purple; text-decoration: underline;">sip:13216938059@216.1.185.103</a>>;reason=no-answer;counter=1;privacy=off<o:p></o:p></span></b></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><extension name="public_did"><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <condition field="destination_number" expression="^9999(\d{10})$"><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="ocn=18005551212"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="rdn=18005552323"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="sip_h_Diversion[0] =<<a href="sip:$%7bocn%7d@$%7bnetwork_addr%7d" style="color: purple; text-decoration: underline;">sip:${ocn}@${network_addr}</a>>;reason=user-busy;counter=3;privacy=off"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="sip_h_Diversion[1] =<<a href="sip:$%7brdn%7d@$%7bnetwork_addr%7d" style="color: purple; text-decoration: underline;">sip:${rdn}@${network_addr}</a>>;reason=no-answer;counter=1;privacy=off"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="hangup_after_bridge=true" /><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="set" data="continue_on_fail=true"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> <action application="transfer" data="1001 XML default"/><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"> </condition><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"></extension><o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(68, 84, 106);"> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif;"><span class="Apple-converted-space"> </span>Steven Ayre [<a href="mailto:steveayre@gmail.com">mailto:steveayre@gmail.com</a>]<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>Wednesday, April 23, 2014 5:56 AM<br><b>To:</b><span class="Apple-converted-space"> </span>FreeSWITCH Users Help<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [Freeswitch-users] Exporting Diversion Header Twice<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">You could also try whether mod_sofia supports arrays for that variable<o:p></o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><a href="http://wiki.freeswitch.org/wiki/Dialplan_ARRAYS" style="color: purple; text-decoration: underline;">http://wiki.freeswitch.org/wiki/Dialplan_ARRAYS</a><o:p></o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div></div></div><div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></p><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">On 23 April 2014 08:05, Dahlberg, David <<a href="mailto:david.dahlberg@fkie.fraunhofer.de" target="_blank" style="color: purple; text-decoration: underline;">david.dahlberg@fkie.fraunhofer.de</a>> wrote:<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">Am Dienstag, den 22.04.2014, 12:40 -0400 schrieb Sanjiv Kumar:<o:p></o:p></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">> I am trying to export sip_h_Diversion header twice but I only see the<br>> last attempt on leg-B. It appears that second export attempt<br>> overwrites the first one.<o:p></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">[..]<o:p></o:p></div><div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: 'Times New Roman', serif;">> <action application="export" data=" nolocal:sip_h_Diversion =<<a href="sip:%0b" style="color: purple; text-decoration: underline;">sip:<br></a>> ${ocn}@${network_addr}>;reason=user-busy;counter=3;privacy=off"/><br>> <action application="export" data=" nolocal:sip_h_Diversion =<<a href="sip:%0b" style="color: purple; text-decoration: underline;">sip:<br></a>> ${rdn}@${network_addr}>;reason=no-answer;counter=1;privacy=off"/><br>><o:p></o:p></p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;">(A) In Freeswitch/Sofia SIP you're not actually writing a header, but<br>you're writing a variable that in turn will tell mod_sofia to write a<br>header. If you write to the same variable a second time, you will<br>overwrite it.<br><br>(B) Sip (as good old RFC 822) allows for multiple headers in in multiple<br>formats. One possibility is actually adding multiple headers, the other<br>is having one header with multiple values, separated by comma.<br><br>So please try the following: Set the variable once, but with both<br>values, separated by comma. The result will be, that mod_sophia adds<br>indeed two separate headers.<br><br>Cheers<br> David<br><br>--<br>David Dahlberg<br><br>Fraunhofer FKIE, Dept. Communication Systems (KOM) | Tel:<span class="Apple-converted-space"> </span><a href="tel:%2B49-228-9435-845" style="color: purple; text-decoration: underline;">+49-228-9435-845</a><br>Fraunhoferstr. 20, 53343 Wachtberg, Germany | Fax:<span class="Apple-converted-space"> </span><a href="tel:%2B49-228-856277" style="color: purple; text-decoration: underline;">+49-228-856277</a><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org" style="color: purple; text-decoration: underline;">consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com/" target="_blank" style="color: purple; text-decoration: underline;">http://www.freeswitchsolutions.com</a><br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br><a href="http://www.cudatel.com/" target="_blank" style="color: purple; text-decoration: underline;">http://www.cudatel.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org/" target="_blank" style="color: purple; text-decoration: underline;">http://www.freeswitch.org</a><br><a href="http://wiki.freeswitch.org/" target="_blank" style="color: purple; text-decoration: underline;">http://wiki.freeswitch.org</a><br><a href="http://www.cluecon.com/" target="_blank" style="color: purple; text-decoration: underline;">http://www.cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" style="color: purple; text-decoration: underline;">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" style="color: purple; text-decoration: underline;">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" style="color: purple; text-decoration: underline;">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org/" target="_blank" style="color: purple; text-decoration: underline;">http://www.freeswitch.org</a><o:p></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;"><o:p> </o:p></div></div></div>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>http://www.freeswitchsolutions.com<br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>http://www.cudatel.com<br><br>Official FreeSWITCH Sites<br>http://www.freeswitch.org<br>http://wiki.freeswitch.org<br>http://www.cluecon.com<br><br>FreeSWITCH-users mailing list<br>FreeSWITCH-users@lists.freeswitch.org<br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org</div></blockquote></div><br></div></body></html>