|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Dispatcher module questionIs there a way that I can pass variable into ds_select_dst(set, alg) on the set parameter so I can query from database table for setid; for instance, ds_select_dst("avp(customer_setid)", "4"). I've tried, but it did not work. Please advise. Thank you. _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@... http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users |
|
|
Re: Dispatcher module questionDJB wrote:
> Is there a way that I can pass variable into ds_select_dst(set, alg) on the > set parameter so I can query from database table for setid; for instance, > ds_select_dst("avp(customer_setid)", "4"). I've tried, but it did not > work. Please advise. A look in modules/dispatcher/dispatcher.c reveals that ds_*() functions do not parse pseudovariables, which is a problem with a lot of existing Kamailio code. Any arguments you pass to it will be interpreted as literal strings. In short, you can't do that. You may wish to put in a feature request to update these functions to take pseudovariables. -- Alex Balashov - Principal Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@... http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users |
|
|
Re: Dispatcher module questionFrom: users-bounces@... [mailto:users-bounces@...] On Behalf Of Alex Balashov Sent: Thursday, November 05, 2009 4:18 PM To: DJB Cc: users@... Subject: Re: [Kamailio-Users] Dispatcher module question DJB wrote: > Is there a way that I can pass variable into ds_select_dst(set, alg) on the > set parameter so I can query from database table for setid; for instance, > ds_select_dst("avp(customer_setid)", "4"). I've tried, but it did not > work. Please advise. A look in modules/dispatcher/dispatcher.c reveals that ds_*() functions do not parse pseudovariables, which is a problem with a lot of existing Kamailio code. Any arguments you pass to it will be interpreted as literal strings. In short, you can't do that. You may wish to put in a feature request to update these functions to take pseudovariables. -- I haven't looked at the code but I'm using the ds_select functions in more or less the same way in kam 1.5. I pull the setid from a match in the dialplan module instead of a db. if (ds_select_domain("$avp(s:dpattr)", "0")) { if ($avp(s:dispatcher-cnt) > 1) { # If there is more than one entry returned for the group arm the failure route t_on_failure("ROUTE_DP_FAILURE"); } route(ROUTE_RELAY); } else { xlog("L_WARN", "KAM_HOST: ($ci) $pr $mi route[$rm][0] $fu -> $ru - No dst gateways found\n"); sl_send_reply("404", "No destination gateways found\n"); exit; } OP - Did you try it? Bob -------------------------------------------------------------------------- This email with all information contained herein or attached hereto may contain confidential and/or privileged information intended for the addressee(s) only. If you have received this email in error, please contact the sender and immediately delete this email in its entirety and any attachments thereto. _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@... http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users |
|
|
Re: Dispatcher module questionIt appears I was mistaken. Upon further analysis of
fixup_get_ivalue(), I retract my statement. This function does parse PVs. Robert McGilvray wrote: > From: users-bounces@... > [mailto:users-bounces@...] On Behalf Of Alex Balashov > Sent: Thursday, November 05, 2009 4:18 PM > To: DJB > Cc: users@... > Subject: Re: [Kamailio-Users] Dispatcher module question > > DJB wrote: > >> Is there a way that I can pass variable into ds_select_dst(set, alg) > on the >> set parameter so I can query from database table for setid; for > instance, >> ds_select_dst("avp(customer_setid)", "4"). I've tried, but it did not >> work. Please advise. > > A look in modules/dispatcher/dispatcher.c reveals that ds_*() > functions do not parse pseudovariables, which is a problem with a lot > of existing Kamailio code. Any arguments you pass to it will be > interpreted as literal strings. > > In short, you can't do that. You may wish to put in a feature request > to update these functions to take pseudovariables. > -- Alex Balashov - Principal Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@... http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users |
|
|
Re: Dispatcher module questionFrom: users-bounces@... [mailto:users-bounces@...] On Behalf Of Robert McGilvray Sent: Thursday, November 05, 2009 4:31 PM To: Alex Balashov; DJB Cc: users@... Subject: Re: [Kamailio-Users] Dispatcher module question From: users-bounces@... [mailto:users-bounces@...] On Behalf Of Alex Balashov Sent: Thursday, November 05, 2009 4:18 PM To: DJB Cc: users@... Subject: Re: [Kamailio-Users] Dispatcher module question DJB wrote: > Is there a way that I can pass variable into ds_select_dst(set, alg) on the > set parameter so I can query from database table for setid; for instance, > ds_select_dst("avp(customer_setid)", "4"). I've tried, but it did not > work. Please advise. A look in modules/dispatcher/dispatcher.c reveals that ds_*() functions do not parse pseudovariables, which is a problem with a lot of existing Kamailio code. Any arguments you pass to it will be interpreted as literal strings. In short, you can't do that. You may wish to put in a feature request to update these functions to take pseudovariables. -- I haven't looked at the code but I'm using the ds_select functions in more or less the same way in kam 1.5. I pull the setid from a match in the dialplan module instead of a db. if (ds_select_domain("$avp(s:dpattr)", "0")) { if ($avp(s:dispatcher-cnt) > 1) { # If there is more than one entry returned for the group arm the failure route t_on_failure("ROUTE_DP_FAILURE"); } route(ROUTE_RELAY); } else { xlog("L_WARN", "KAM_HOST: ($ci) $pr $mi route[$rm][0] $fu -> $ru - No dst gateways found\n"); sl_send_reply("404", "No destination gateways found\n"); exit; } OP - Did you try it? Bob -- My bad, somehow I ignored the part of your email that stated you had already tried it. The problem your having is most likely that you're getting a string from your DB instead of an int. Here's a workaround I came up with, you may also be able to cast it in your sql query. $avp(s:dpattr) = $(avp(s:dpattr){s.int}); # dpattr returned from mysql is a string. It needs to be an INT Bob -------------------------------------------------------------------------- This email with all information contained herein or attached hereto may contain confidential and/or privileged information intended for the addressee(s) only. If you have received this email in error, please contact the sender and immediately delete this email in its entirety and any attachments thereto. _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@... http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users |
|
|
Re: Dispatcher module questionThank you, Robert.
You are correct. I overlooked at the return value. It's working now. ----- Original Message ---- From: Robert McGilvray <rmcgilvr@...> To: Alex Balashov <abalashov@...>; DJB <djbinter@...> Cc: users@... Sent: Thu, November 5, 2009 1:35:25 PM Subject: RE: [Kamailio-Users] Dispatcher module question From: users-bounces@... [mailto:users-bounces@...] On Behalf Of Robert McGilvray Sent: Thursday, November 05, 2009 4:31 PM To: Alex Balashov; DJB Cc: users@... Subject: Re: [Kamailio-Users] Dispatcher module question From: users-bounces@... [mailto:users-bounces@...] On Behalf Of Alex Balashov Sent: Thursday, November 05, 2009 4:18 PM To: DJB Cc: users@... Subject: Re: [Kamailio-Users] Dispatcher module question DJB wrote: > Is there a way that I can pass variable into ds_select_dst(set, alg) on the > set parameter so I can query from database table for setid; for instance, > ds_select_dst("avp(customer_setid)", "4"). I've tried, but it did not > work. Please advise. A look in modules/dispatcher/dispatcher.c reveals that ds_*() functions do not parse pseudovariables, which is a problem with a lot of existing Kamailio code. Any arguments you pass to it will be interpreted as literal strings. In short, you can't do that. You may wish to put in a feature request to update these functions to take pseudovariables. -- I haven't looked at the code but I'm using the ds_select functions in more or less the same way in kam 1.5. I pull the setid from a match in the dialplan module instead of a db. if (ds_select_domain("$avp(s:dpattr)", "0")) { if ($avp(s:dispatcher-cnt) > 1) { # If there is more than one entry returned for the group arm the failure route t_on_failure("ROUTE_DP_FAILURE"); } route(ROUTE_RELAY); } else { xlog("L_WARN", "KAM_HOST: ($ci) $pr $mi route[$rm][0] $fu -> $ru - No dst gateways found\n"); sl_send_reply("404", "No destination gateways found\n"); exit; } OP - Did you try it? Bob -- My bad, somehow I ignored the part of your email that stated you had already tried it. The problem your having is most likely that you're getting a string from your DB instead of an int. Here's a workaround I came up with, you may also be able to cast it in your sql query. $avp(s:dpattr) = $(avp(s:dpattr){s.int}); # dpattr returned from mysql is a string. It needs to be an INT Bob -------------------------------------------------------------------------- This email with all information contained herein or attached hereto may contain confidential and/or privileged information intended for the addressee(s) only. If you have received this email in error, please contact the sender and immediately delete this email in its entirety and any attachments thereto. _______________________________________________ Kamailio (OpenSER) - Users mailing list Users@... http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users |
| Free embeddable forum powered by Nabble | Forum Help |