[OpenSIPS-Users] drouting module
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Mon Aug 31 10:16:36 CEST 2009
Hi Sebastian,
As the error says, the drouting module accepts only AVPs as input
variable (and not script variables as in your script). try:
$avp(i:10) = 100;
do_routing("$avp(i:10)");
Regards,
Bogdan
Sebastian Sastre wrote:
> Bogdan,
>
> Thanks for your reply. I can't seem to pass the variable to drouting.
> I can do do_routing("100") and it would work fine, but when passing the
> argument as a $var I get this error.
>
> $var(dr_id) = 100;
> do_routing("$var(dr_id)");
>
> DBG:core:fix_actions: fixing engage_media_proxy, line 155
> DBG:core:fix_actions: fixing xlog, line 164
> DBG:core:fix_actions: fixing t_relay, line 165
> DBG:core:fix_actions: fixing sl_reply_error, line 166
> DBG:core:fix_actions: fixing xlog, line 182
> DBG:core:fix_actions: fixing t_on_failure, line 183
> DBG:core:fix_actions: fixing do_routing, line 185
> ERROR:drouting:fixup_do_routing: malformed or non AVP $var(dr_id) AVP
> definition
> ERROR:core:fix_actions: fixing failed (code=-6) at cfg line 185
> ERROR:core:main: failed to fix configuration with err code -6
> DBG:dialplan:destroy_rule: destroying rule with priority 0
> DBG:tm:tm_shutdown: tm_shutdown : start
>
>
>
> These are the modules I have loaded.
> loadmodule "db_mysql.so"
> loadmodule "signaling.so"
> loadmodule "sl.so"
> loadmodule "tm.so"
> loadmodule "rr.so"
> loadmodule "maxfwd.so"
> loadmodule "usrloc.so"
> loadmodule "registrar.so"
> loadmodule "textops.so"
> loadmodule "mi_fifo.so"
> loadmodule "uri_db.so"
> loadmodule "uri.so"
> loadmodule "xlog.so"
> loadmodule "acc.so"
> loadmodule "siptrace.so"
> loadmodule "drouting.so"
> loadmodule "dialog.so"
> loadmodule "mediaproxy.so"
> loadmodule "dialplan.so"
>
>
>
> Sebastian Sastre
> Next IP
> sebastian at next-ip.com
> + 305-507-8722- Main
> + 305-507-8728- Direct
>
> The information transmitted herein is intended only for the person or entity
> to which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipient is prohibited. If you received
> this in error, please contact the sender and delete the material from any
> computer.
> La información contenida en este mensaje electrónico tiene carácter
> CONFIDENCIAL, está dirigida únicamente al destinatario de la misma y sólo
> podrá ser usada por éste. Si el lector de este mensaje no es el destinatario
> del mismo, se le notifica que cualquier copia o distribución de éste se
> encuentra totalmente prohibida. Si usted ha recibido este mensaje por error,
> por favor notifique inmediatamente al remitente por este mismo medio y borre
> el mensaje de su sistema.
>
> -----Original Message-----
> From: users-bounces at lists.opensips.org
> [mailto:users-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
> Sent: Wednesday, August 26, 2009 1:02 PM
> To: OpenSIPS users mailling list
> Subject: Re: [OpenSIPS-Users] drouting module
>
> Hi Sebastian,
>
> Sebastian Sastre wrote:
>
>> Hi,
>>
>>
>>
>> When applying the do_routing function without specifying the group id,
>> what are the matching patterns that it will look for?
>>
>>
> As documented, if no group id is given to the function, it will try to
> discover the group Id by looking in the dr_group table for a record
> belonging to the FROM USER.
>
>
>>
>>
>> In other words If I want ALL the users behind domain test.com how
>> would I do it?
>>
>>
>>
>> Leaving the username field empty and putting test.com in the domain
>> did not work.
>>
>>
> I guess you did this is dr_group table, but this requires a full
> username and domain.
>
> Note that do_routing() does accept the group id via a variable also, so
> you can load the group id from a DB via whatever query (see
> avp_db_query()) function. Or you can use dialplan module to have a
> translation from domain names to group ids . Or, the most simple static cfg:
>
> $var(dr_id) = 0;
> switch($rd) {
> case "test.com" : $var(dr_id) = 1; break;
> case "probe.com" : $var(dr_id) = 2; break;
> ............................
> }
>
> do_routing("$var(dr_id)");
>
> Regards,
> Bogdan
>
>>
>>
>> Thanks
>>
>>
>>
>>
>>
>> Sebastian
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
More information about the Users
mailing list