R: [Users] avp_db_load problem

D'Addelfio Davide Davide.D'Addelfio at italtel.it
Fri Apr 14 10:22:04 CEST 2006


Hi Jayesh, I have a problem similar at yours, could you help me ?

 

I need to load data from acc table using avp_db_load. I setup my cfg file in this way:

 

modparam("avpops", "db_scheme", "scheme0:username_col=username;value_col=sip_callid;table=acc")

 

if (avp_db_load("$to", "$avp(s:sip_callid)/scheme0")) {

   xlog("L_INFO","Lettura OK");

};

 

But I have this error in the log:

 

Apr 14 01:07:55 localhost /usr/sbin/openser[6799]: ERROR:avpops:parse_avp_db: unknow alias"avp(s:sip_callid)/scheme0"

Apr 14 01:07:55 localhost /usr/sbin/openser[6799]: ERROR:avpops:fixup_db_avp: parse failed Apr 14 01:07:55 localhost /usr/sbin/openser[6799]: ERROR: fix_expr : fix_actions error

 

Any thought?

Thanks for help

Davide 

 

________________________________

Da: users-bounces at openser.org [mailto:users-bounces at openser.org] Per conto di Jayesh Nambiar
Inviato: mercoledì 12 aprile 2006 0.06
A: openser
Oggetto: [Users] avp_db_load problem

 

Hi all,

I was trying to do the following:

Whenever a user presses *86 and then any number, first openser should check

in the subscriber table, whether the value for features column is 1. (I've added an extra column features in the table subscriber with datatype int).

If the value is 0, he should be replied with the message Forbidden.

I tried doing the following:

 

modparam("avpops","db_scheme",
       "scheme1:username_col=username;value_col=features;table=subscriber")

 

if(uri=~"sip:\*86[0-9]*@") {
                log(1,"entered condition");
                if(avp_db_load("$fU", "$avp(s:features)/$scheme1")) {
                log(1,"db load succeeded");
                if(!avp_check("$avp(s:features)", "eq/1/g")) {
                        sl_send_reply("403", "Forbidden");
                        exit;
                };
                strip(3);
                log(1,"stripped");
                avp_db_query("insert into usr_preferences values('', '$fU', '', 'callfwd', '', '$ruri', 'CURRENT_TIMESTAMP')");
                sl_send_reply("200", "OK");
                exit;
        };

        };

But in the logs I only get "condition succeeded" which means it does not do the avp_db_load() properly.

 

Can someone please help me in what should be the exact syntax to load it from the db and then check the value.

 

thanks in advance,

jayesh

________________________________

Jiyo cricket on Yahoo! India cricket <http://us.rd.yahoo.com/mail/in/mailcricket/*http:/in.sports.yahoo.com/cricket/> 
Yahoo! Messenger Mobile <http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http:/in.mobile.yahoo.com/new/messenger/>  Stay in touch with your buddies all the time.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20060414/9dee979a/attachment.htm 


More information about the Users mailing list