<div dir="ltr"><div>Quick Version:  Is there some special way to set custom SIP headers when you are bridging a call from Javascript instead of XML?</div><div><br></div><div>Full Details:</div>We am using Voice Operator Panel (VOP) as a receptionist console.  We have multiple external numbers that all funnel into a few receptionist desks.  If I add a SIP Diversion header, then VOP will use that to show the receptionist which number the caller dialed to reach them, which would help things out a lot.<div><br></div><div>If I add it in an XML dialplan and then do a direct bridge to one of the receptionist numbers, it works great (snip of working direct dialplan):</div><div><br></div><div><action application="set" data="sip_h_Diversion=<sip:${<a href="mailto:destination_number%7D@pbx.example.org">destination_number}@pbx.example.org</a>>;privacy=off;reason=unconditional;counter=1;screen=no"/><br></div><div><action application="bridge" data="user/<a href="mailto:1000@pbx.example.org">1000@pbx.example.org</a>"/><br></div><div><br></div><div>The problem is I need a bit of advanced logic to figure out which receptionist are online and then ring those, then fail over to other numbers and ultimately IVR if no one answers, so I instead pass calls to them off to javascript, so the bridge line above becomes something link:<br></div><div><br></div><div><action application="javascript" data="${jslib}/frontdesk.js ${dialed_extension} ${domain_name} ${destination_number}" /><br></div><div><br></div><div>I've tried setting the SIP header in the XML above the javascript line and then exporting it</div><div><div>    <action application="set" data="sip_h_Diversion=<sip:${<a href="mailto:destination_number%7D@pbx.example.org">destination_number}@pbx.example.org</a>>;privacy=off;reason=unconditional;counter=1;screen=no"/>                                                                                  </div><div>        <action application="export" data="sip_h_Diversion" /></div></div><div><br></div><div>and setting it in the Javascript:</div><div><br></div><div><div>    var diversionHeader = 'sip_h_Diversion=<sip:' + $destination_number + '@<a href="http://pbx.example.org">pbx.example.org</a>>;privacy=off;reason=unconditional;counter=1;screen=no';</div><div><br></div><div>    session.execute('set',diversionHeader);</div><div>    session.execute('export','sip_h_Diversion');</div></div><div><br></div><div>but in both cases (or with both in place), the SIP header is never written.</div><div><br></div><div>Is there some magic to setting SIP headers in Javascript?  I can't seem to find any examples or documentation about it.</div><div><br></div><div>Thanks!</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>