Bogdan,<div>I&#39;m a little confused as to which modules can take avp transformations INSIDE of the parameters and which can&#39;t..</div><div><br></div><div>For example, I didn&#39;t think this worked (as you suggested):</div>

<div>     do_routing(&quot;$(avp(dr_id){<a href="http://s.int" target="_blank">s.int</a>})<br></div><div><br></div><div>I thought you had to do:</div><div>     $avp(n_dr_id) = $(avp(dr_id){<a href="http://s.int">s.int</a>});</div>

<div>     do_routing(&quot;$avp(n_dr_id)&quot;);</div><div><br></div><div>Thanks,</div><div>Brett</div><div><br></div><div><br><div class="gmail_quote">On Wed, Sep 2, 2009 at 3:34 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Sebastian,<br>
<br>
The problem is that the dialplan returns the 200 ID as string value,the<br>
&quot;200&quot; string, while the drouting module does expect an integer value.<br>
<br>
So use a transformation to convert from string to integer :<br>
     do_routing(&quot;$(avp(dr_id){<a href="http://s.int" target="_blank">s.int</a>})&quot;)<br>
<br>
See: <a href="http://www.opensips.org/Resources/DocsCoreTran15#toc2" target="_blank">http://www.opensips.org/Resources/DocsCoreTran15#toc2</a><br>
<br>
Regards,<br>
<font color="#888888">Bogdan<br>
</font><div><div></div><div class="h5"><br>
Sebastian Sastre wrote:<br>
&gt; Hello<br>
&gt;<br>
&gt; As per bogdan&#39;s recommendation I used the dialplan module to convert the<br>
&gt; soruce ip to a group number, but drouting is not able to get it.<br>
&gt; dp_translates the given ip to the correct group number, but when passing it<br>
&gt; to drouting, it can&#39;t find it.<br>
&gt;<br>
&gt; Any ideas?<br>
&gt;<br>
&gt; route[2]{<br>
&gt;         xlog(&quot;-&gt; Route(2) - Enter\n&quot;);<br>
&gt;         dp_translate(&quot;1&quot;, &quot;$fd/$avp(dr_id)&quot;);<br>
&gt;         xlog(&quot;-&gt; HOST $fd got group $avp(dr_id) \n&quot;);<br>
&gt;         if (!do_routing(&quot;$avp(dr_id)&quot;)){<br>
&gt;                 xlog(&quot;-&gt; Route(2) - No routes found \n&quot;);<br>
&gt;                 sl_send_reply(&quot;503&quot;, &quot;No available gateways route&quot;);<br>
&gt;                 exit;<br>
&gt;         }<br>
&gt;         xlog(&quot;-&gt; Route(2) - Found Routes for request, routing... \n&quot;);<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; This is the log<br>
&gt;<br>
&gt; /usr/sbin/opensips[8188]: -&gt; Route(2) - Enter<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_get_ivalue: integer value<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: dpid is 1<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_get_svalue: searching 20<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: input is 192.168.0.10<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:translate: regex operator testing<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:test_match: test string 192.168.0.10<br>
&gt; against a pattern 192.168.0.10<br>
&gt;<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:test_match: test_match:[0]<br>
&gt; 192.168.0.10<br>
&gt;<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:translate: found a matching rule<br>
&gt; 0x7fa7fe6898d0: pr 0, match_exp 192.168.0.10<br>
&gt;<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:rule_translate: simply replace the<br>
&gt; string, subst_comp (nil), n_escapes 0<br>
&gt;<br>
&gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: input 192.168.0.10<br>
&gt; with dpid 1 =&gt; output 100<br>
&gt;<br>
&gt; /usr/sbin/opensips[8188]: -&gt; HOST 192.168.0.10 got group 100<br>
&gt; /usr/sbin/opensips[8188]: ERROR:drouting:do_routing: failed to get group id<br>
&gt; /usr/sbin/opensips[8188]: -&gt; Route(2) - No routes found<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Thanks again,<br>
&gt;<br>
&gt;<br>
&gt; Sebastian Sastre<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
&gt;<br>
<br>
<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><br>
</div></div></blockquote></div><br></div>