<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=utf-8"><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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
tt
{mso-style-priority:99;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:DE;}
span.hoenzb
{mso-style-name:hoenzb;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>There could be a constrain in OpenSIPS that the route name should be defined at the start of opensips process. Otherwise if a variable value for some reason does not match any defined route there will be a problem. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Greetings,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>xaled<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Users [mailto:users-bounces@lists.opensips.org] <b>On Behalf Of </b>Jim DeVito<br><b>Sent:</b> Donnerstag, 21. September 2017 14:58<br><b>To:</b> OpenSIPS users mailling list <users@lists.opensips.org><br><b>Subject:</b> Re: [OpenSIPS-Users] Feature request? Script Var / AVP variables in route function.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hmmm. I want to use the contents of <span style='font-size:8.0pt;font-family:"Courier New"'>$avp(carrier_id) as the route name. So if $avp(carrier_id) is 25 I want it to call the routing block route[25].</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Thu, Sep 21, 2017 at 8:52 AM, Răzvan Crainea <<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><p class=MsoNormal><tt><span style='font-size:10.0pt'>Hi, Jim!</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><br><tt>You should have a name for the route, such as:</tt><br><br><tt>route(route_name, $avp(carrier_id));</tt><br><br><tt>Best regards,</tt><br><br></span><o:p></o:p></p><pre>Răzvan Crainea<o:p></o:p></pre><pre>OpenSIPS Developer<o:p></o:p></pre><pre><a href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a><o:p></o:p></pre><div><p class=MsoNormal>On 09/21/2017 03:43 PM, Jim DeVito wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>Hi Razvan, <o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>So what am I doing wrong with <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>route($avp(carrier_id));<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>It produces...<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>...line 318, column 53-54: bad routeargument<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks!!<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Thu, Sep 21, 2017 at 8:31 AM, Răzvan Crainea <<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><p class=MsoNormal><tt><span style='font-size:10.0pt'>Hi, Jim!</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><br><tt>Script variables or AVPs are PV (pseudo-variables) themselves, so you should be able to use them.</tt><br><br><tt>Best regards,</tt><br><br></span><o:p></o:p></p><pre>Răzvan Crainea<o:p></o:p></pre><pre>OpenSIPS Developer<o:p></o:p></pre><pre><a href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a><o:p></o:p></pre><div><p class=MsoNormal>On 09/21/2017 03:14 PM, Jim DeVito wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><div><p class=MsoNormal>Hi All,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>It's my understanding only PV, integers and strings can be used in the core route function. Is there a reason I don't understand why we can not use script variables or AVP's?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks!!<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>------------- <o:p></o:p></p><div><p class=MsoNormal>Jim DeVito<o:p></o:p></p></div><div><p class=MsoNormal>Mobile <a href="tel:%28216%29%20507-9497" target="_blank">216.507.9497</a><o:p></o:p></p></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>Users mailing list<o:p></o:p></pre><pre><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><o:p></o:p></pre><pre><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre></blockquote><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><br><br clear=all><span class=hoenzb><span style='color:#888888'><o:p></o:p></span></span></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal><span class=hoenzb><span style='color:#888888'>-- </span><o:p></o:p></span></p><div><div><p class=MsoNormal><span style='color:#888888'>------------- </span><o:p></o:p></p><div><p class=MsoNormal><span style='color:#888888'>Jim DeVito<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:#888888'>Mobile <a href="tel:(216)%20507-9497" target="_blank">216.507.9497</a><o:p></o:p></span></p></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><span class=hoenzb><o:p> </o:p></span></p><pre><span style='color:#888888'>_______________________________________________<o:p></o:p></span></pre><pre><span style='color:#888888'>Users mailing list<o:p></o:p></span></pre><pre><span style='color:#888888'><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><o:p></o:p></span></pre><pre><span style='color:#888888'><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></span></pre></blockquote><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><p class=MsoNormal>-------------<o:p></o:p></p><div><p class=MsoNormal>Jim DeVito<o:p></o:p></p></div><div><p class=MsoNormal>Mobile 216.507.9497<o:p></o:p></p></div></div></div></div></div></body></html>