Bogdan,<div>I'm a little confused as to which modules can take avp transformations INSIDE of the parameters and which can't..</div><div><br></div><div>For example, I didn't think this worked (as you suggested):</div>
<div> do_routing("$(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("$avp(n_dr_id)");</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"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></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>
"200" 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("$(avp(dr_id){<a href="http://s.int" target="_blank">s.int</a>})")<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>
> Hello<br>
><br>
> As per bogdan's recommendation I used the dialplan module to convert the<br>
> soruce ip to a group number, but drouting is not able to get it.<br>
> dp_translates the given ip to the correct group number, but when passing it<br>
> to drouting, it can't find it.<br>
><br>
> Any ideas?<br>
><br>
> route[2]{<br>
> xlog("-> Route(2) - Enter\n");<br>
> dp_translate("1", "$fd/$avp(dr_id)");<br>
> xlog("-> HOST $fd got group $avp(dr_id) \n");<br>
> if (!do_routing("$avp(dr_id)")){<br>
> xlog("-> Route(2) - No routes found \n");<br>
> sl_send_reply("503", "No available gateways route");<br>
> exit;<br>
> }<br>
> xlog("-> Route(2) - Found Routes for request, routing... \n");<br>
> }<br>
><br>
><br>
> This is the log<br>
><br>
> /usr/sbin/opensips[8188]: -> Route(2) - Enter<br>
> /usr/sbin/opensips[8188]: DBG:dialplan:dp_get_ivalue: integer value<br>
> /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: dpid is 1<br>
> /usr/sbin/opensips[8188]: DBG:dialplan:dp_get_svalue: searching 20<br>
> /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: input is 192.168.0.10<br>
> /usr/sbin/opensips[8188]: DBG:dialplan:translate: regex operator testing<br>
> /usr/sbin/opensips[8188]: DBG:dialplan:test_match: test string 192.168.0.10<br>
> against a pattern 192.168.0.10<br>
><br>
> /usr/sbin/opensips[8188]: DBG:dialplan:test_match: test_match:[0]<br>
> 192.168.0.10<br>
><br>
> /usr/sbin/opensips[8188]: DBG:dialplan:translate: found a matching rule<br>
> 0x7fa7fe6898d0: pr 0, match_exp 192.168.0.10<br>
><br>
> /usr/sbin/opensips[8188]: DBG:dialplan:rule_translate: simply replace the<br>
> string, subst_comp (nil), n_escapes 0<br>
><br>
> /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: input 192.168.0.10<br>
> with dpid 1 => output 100<br>
><br>
> /usr/sbin/opensips[8188]: -> HOST 192.168.0.10 got group 100<br>
> /usr/sbin/opensips[8188]: ERROR:drouting:do_routing: failed to get group id<br>
> /usr/sbin/opensips[8188]: -> Route(2) - No routes found<br>
><br>
><br>
><br>
> Thanks again,<br>
><br>
><br>
> Sebastian Sastre<br>
><br>
><br>
><br>
><br>
><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>
><br>
><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>