<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello Everyone,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hope you’re all doing well,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As per the awesome suggestion of one of the users on this mailing list I have tryied using the AVP_DB_Querry function<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However it doesn’t look like I have it right or understand how to fully use it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Heres what I currently have in my routing logic:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">if (has_totag())<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> {<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> #here we check the Database to see which PBX our UAC belongs to, once Opensips get this info we store its value as a $avp variable it can later refrence in the routing logic<o:p></o:p></p>
<p class="MsoNormal"> avp_db_query("select PBX from pbx where CustomerContext like '%$tu%'", "$avp(PBX)");<o:p></o:p></p>
<p class="MsoNormal"> avp_pushto("$ru","$avp(PBX)");
<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> if (loose_route())<o:p></o:p></p>
<p class="MsoNormal"> {<o:p></o:p></p>
<p class="MsoNormal"> if (is_method("BYE"))<o:p></o:p></p>
<p class="MsoNormal"> {<o:p></o:p></p>
<p class="MsoNormal"> setflag(ACC_DO);<o:p></o:p></p>
<p class="MsoNormal"> setflag(ACC_FAILED);<o:p></o:p></p>
<p class="MsoNormal"> }<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">With that being programmed, shouldn’t the $avp(PBX) be pushed to the request URI or the sip packet?
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What I’m seeing is essentially nothing happening. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can anyone give me any idea as to where I went wrong or what I may not be getting?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any input is greatly appreciated! Thank you in advanced!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="line-height:115%"><b><span style="font-size:10.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">Travis Manson-Drake<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height:115%"><b><span style="font-size:10.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">Voice Systems Analyst L1<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:navy">Simply Bits, LLC</span></b><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:navy"><o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:8.0pt;font-family:"Arial",sans-serif;color:#FFC000">Now You’re Thinkin’ Smart!</span></i></b><span style="font-family:"Arial",sans-serif;color:navy"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:115%"><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">5225 N. Sabino Canyon Road
<br>
Tucson, AZ 85750<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:115%"><b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">Phone:</span></b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">
</span><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:#002060">520-545-0311</span><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:115%"><b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">Fax:</span></b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">
</span><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:#002060">520-545-7252<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:115%"><b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">Support Hotline</span></b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy">:
</span><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:#002060">5205450333</span><span style="font-size:8.0pt;line-height:115%;font-family:"Arial",sans-serif;color:navy"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#1F497D"><a href="http://www.simplybits.com/" title="http://www.simplybits.com/"><span style="font-size:8.0pt;font-family:"Times New Roman",serif;color:#0563C1">www.simplybits.com</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>