Bogdan,<div>I just read the docs it says: </div><div>&quot;<span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">The module can take one optional parameter: the routing group the caller belongs to - this may be a static numerical value or an AVP specification. If none specified, the function will automatically try to query the dr_group table to get this information.&quot;</span></div>

<div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;">I have a request. A &quot;quick reference card&quot; that lists, in very abbreviated form all the module functions and parameters and the allowed values of the parameters.. Perhaps the parameters should be listed like &quot;C&quot; function declarations:</span></div>

<div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;">function do_routing(avp &quot;[group id]&quot;)</span></div>

<div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;">or if it supported avp and/or pv:</span></div>

<div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;">function do_routing(avp/pv &quot;[group id]&quot;)</span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br>

</span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;">Something like that. .a cheat sheet with one func per line would be really handy (hyperlinked, even better!!) :)</span></div>

<div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br></span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;">-Brett</span></div><div><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px;"><br>

</span></div><div><div><br><div class="gmail_quote">On Wed, Sep 2, 2009 at 8:01 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 Brett,<br>
<br>
:D oh...I&#39;m wrong - i forgot that DR accepts only avps and not generic<br>
PVs ; when a generic PV is evaluated, you can use transformations (as<br>
they will be used), but in this particular case (only AVPs), the<br>
transformation will not be automatically applied :(.<br>
<br>
So, you are right, here the correct way to do it is via an intermediary<br>
INT AVP.<br>
<br>
Regards,<br>
Bogdan<br>
<div class="im"><br>
Brett Nemeroff wrote:<br>
&gt; Bogdan,<br>
&gt; I&#39;m a little confused as to which modules can take avp transformations<br>
&gt; INSIDE of the parameters and which can&#39;t..<br>
&gt;<br>
&gt; For example, I didn&#39;t think this worked (as you suggested):<br>
</div>&gt;      do_routing(&quot;$(avp(dr_id){<a href="http://s.int" target="_blank">s.int</a> &lt;<a href="http://s.int" target="_blank">http://s.int</a>&gt;})<br>
<div class="im">&gt;<br>
&gt; I thought you had to do:<br>
</div>&gt;      $avp(n_dr_id) = $(avp(dr_id){<a href="http://s.int" target="_blank">s.int</a> &lt;<a href="http://s.int" target="_blank">http://s.int</a>&gt;});<br>
<div class="im">&gt;      do_routing(&quot;$avp(n_dr_id)&quot;);<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Brett<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Sep 2, 2009 at 3:34 AM, Bogdan-Andrei Iancu<br>
</div><div class="im">&gt; &lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a> &lt;mailto:<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hi Sebastian,<br>
&gt;<br>
&gt;     The problem is that the dialplan returns the 200 ID as string<br>
&gt;     value,the<br>
&gt;     &quot;200&quot; string, while the drouting module does expect an integer value.<br>
&gt;<br>
&gt;     So use a transformation to convert from string to integer :<br>
</div>&gt;         do_routing(&quot;$(avp(dr_id){<a href="http://s.int" target="_blank">s.int</a> &lt;<a href="http://s.int" target="_blank">http://s.int</a>&gt;})&quot;)<br>
<div><div></div><div class="h5">&gt;<br>
&gt;     See: <a href="http://www.opensips.org/Resources/DocsCoreTran15#toc2" target="_blank">http://www.opensips.org/Resources/DocsCoreTran15#toc2</a><br>
&gt;<br>
&gt;     Regards,<br>
&gt;     Bogdan<br>
&gt;<br>
&gt;     Sebastian Sastre wrote:<br>
&gt;     &gt; Hello<br>
&gt;     &gt;<br>
&gt;     &gt; As per bogdan&#39;s recommendation I used the dialplan module to<br>
&gt;     convert the<br>
&gt;     &gt; soruce ip to a group number, but drouting is not able to get it.<br>
&gt;     &gt; dp_translates the given ip to the correct group number, but when<br>
&gt;     passing it<br>
&gt;     &gt; to drouting, it can&#39;t find it.<br>
&gt;     &gt;<br>
&gt;     &gt; Any ideas?<br>
&gt;     &gt;<br>
&gt;     &gt; route[2]{<br>
&gt;     &gt;         xlog(&quot;-&gt; Route(2) - Enter\n&quot;);<br>
&gt;     &gt;         dp_translate(&quot;1&quot;, &quot;$fd/$avp(dr_id)&quot;);<br>
&gt;     &gt;         xlog(&quot;-&gt; HOST $fd got group $avp(dr_id) \n&quot;);<br>
&gt;     &gt;         if (!do_routing(&quot;$avp(dr_id)&quot;)){<br>
&gt;     &gt;                 xlog(&quot;-&gt; Route(2) - No routes found \n&quot;);<br>
&gt;     &gt;                 sl_send_reply(&quot;503&quot;, &quot;No available gateways route&quot;);<br>
&gt;     &gt;                 exit;<br>
&gt;     &gt;         }<br>
&gt;     &gt;         xlog(&quot;-&gt; Route(2) - Found Routes for request, routing...<br>
&gt;     \n&quot;);<br>
&gt;     &gt; }<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; This is the log<br>
&gt;     &gt;<br>
&gt;     &gt; /usr/sbin/opensips[8188]: -&gt; Route(2) - Enter<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_get_ivalue: integer value<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: dpid is 1<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_get_svalue: searching 20<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: input is<br>
&gt;     192.168.0.10<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:translate: regex operator<br>
&gt;     testing<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:test_match: test string<br>
&gt;     192.168.0.10<br>
&gt;     &gt; against a pattern 192.168.0.10<br>
&gt;     &gt;<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:test_match: test_match:[0]<br>
&gt;     &gt; 192.168.0.10<br>
&gt;     &gt;<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:translate: found a<br>
&gt;     matching rule<br>
&gt;     &gt; 0x7fa7fe6898d0: pr 0, match_exp 192.168.0.10<br>
&gt;     &gt;<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:rule_translate: simply<br>
&gt;     replace the<br>
&gt;     &gt; string, subst_comp (nil), n_escapes 0<br>
&gt;     &gt;<br>
&gt;     &gt; /usr/sbin/opensips[8188]: DBG:dialplan:dp_translate_f: input<br>
&gt;     192.168.0.10<br>
&gt;     &gt; with dpid 1 =&gt; output 100<br>
&gt;     &gt;<br>
&gt;     &gt; /usr/sbin/opensips[8188]: -&gt; HOST 192.168.0.10 got group 100<br>
&gt;     &gt; /usr/sbin/opensips[8188]: ERROR:drouting:do_routing: failed to<br>
&gt;     get group id<br>
&gt;     &gt; /usr/sbin/opensips[8188]: -&gt; Route(2) - No routes found<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Thanks again,<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Sebastian Sastre<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; _______________________________________________<br>
&gt;     &gt; Users mailing list<br>
</div></div>&gt;     &gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> &lt;mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&gt;<br>
<div class="im">&gt;     &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;     &gt;<br>
&gt;     &gt;<br>
&gt;<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     Users mailing list<br>
</div>&gt;     <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> &lt;mailto:<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&gt;<br>
<div><div></div><div class="h5">&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>
&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>
<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></div>