<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Put this snippet in a macro and call the
macro.&nbsp;&nbsp; That way the data lives for the duration of the incoming call.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Lenz Emilitri<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, February 18, 2009
3:05 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">Asterisk
 Users Mailing List - Non-Commercial Discussion</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> [asterisk-users] Setting
SIP header on agent calls made by a queue</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Hello
list,<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>I am
trying to set a custom SIP header on all calls that are made by the app queue
because I want to track a certain state at the SIP level.&nbsp;<br clear=all>
<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>If I use
the following code:<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>exten
=&gt; s,n,SIPAddHeader(X-Unique-ID: ${UNIQUEID})<br>
exten =&gt; s,n,Queue(myQueue)<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>this
works fine for the FIRST call made from the queue to an agent; but if that call
does not go through, it's not repeated on subsequent calls.&nbsp;<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>I know I
could use Local channels as members of the queue, but I was wondering if ther
was something more general and that worked whatever your channel configuration
might be. <o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>I also
tried exporting the variable by setting the URL field of the queue() call, but
it is not shown in the resulting SIP dialog.<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;Any
suggestion but patching the source?<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>l.<o:p></o:p></span></font></p>

<p style='margin-bottom:12.0pt'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
-- <br>
Loway - home of QueueMetrics - <a href="http://queuemetrics.com">http://queuemetrics.com</a><o:p></o:p></span></font></p>

</div>

</body>

</html>