Thanks, I've looked into but it works only with 1.1.x version...!!!
What's the different with avp_db_store command, may I use it to store something in my SQL DB? I'll try to do but I have some problems, he doesn't register...
I have another question: I need to work over sdp messages, is possible to do a parsing, always using the scripts language...?
Any thought? Thanks Davide
-----Messaggio originale----- Da: Daniel-Constantin Mierla [mailto:daniel@voice-system.ro] Inviato: mercoledì 5 aprile 2006 19.15 A: D'Addelfio Davide Cc: Jayesh Nambiar; Bogdan-Andrei Iancu; openser Oggetto: Re: R: [Users] using AVPs to write into database
Hello,
On 04/05/06 18:01, D'Addelfio Davide wrote:
Hi guys, I have a similar problem, maybe easier. I'm new in openser so I'd like to have some help.
I'd like openser create a table in MySQL db when receive an INVITE, a row with from uri, method and something else, I've look into modules docs but I've not understanding at all...could you help me, please?
if you are using openser development version, then take a look at avp_db_query() in avpops module http://openser.org/docs/modules/1.1.x/avpops.html#AEN239
Cheers, Daniel
Thanks for reply
Davide
*Da:* users-bounces@openser.org [mailto:users-bounces@openser.org] *Per conto di *Jayesh Nambiar *Inviato:* mercoledì 5 aprile 2006 15.53 *A:* Bogdan-Andrei Iancu *Cc:* openser *Oggetto:* Re: [Users] using AVPs to write into database
Hi Bogdan,
Thanks for the reply and sorry for sending the earlier mail 4 times as yahoo was not responding peoperly.
When I do an avp_write(), why does the avp name get stored in the uuid column?
I am not using any uuid as of now. I also tried to add the username of the person who is calling but it again creates two rows, one with the value as
username and other row with the value as forwarded number.
I thought if there is a way to insert the username also, it wud be easier to check, if the incoming call for that user is to be forwarded or not.
I get the following in my usr_preferences table after I dial 86 followed by any number.
+-----------+----------+--------+-----------+------+-----------------------------+---------------------+ | uuid | username | domain | attribute | type | value | modified | +-----------+----------+--------+-----------+------+-----------------------------+---------------------+ | s:callfwd | | | callfwd | 0 | sip:5515551478@202.80.61.10 | 2006-04-05 19:10:49 | +-----------+----------+--------+-----------+------+-----------------------------+---------------------+
The script snippet is as follows:
if(uri=~"^sip:86[0-9]*@") {
strip(2); avp_write("$ruri", "s:callfwd"); #avp_write("$from/username", "i:999"); #avp_db_store("i:999", "i:/usr_preferences"); avp_db_store("s:callfwd", "s:callfwd/usr_preferences"); sl_send_reply("200", "OK"); exit; };
*/Bogdan-Andrei Iancu bogdan@voice-system.ro/* wrote:
Hi, you need two steps: 1) write the ruri (after strip) into an AVP - use avp_write() 2) write the avp into the db - use avp_db_store() regards, bogdan Jayesh Nambiar wrote: > Hi all, > I am trying to implement the call forwarding feature in openser. The > forwarding part is fine. But I have the follwing scenario: > Whenever a user needs to change his forwarding number, he should be > able to do so from his end device only. > For eg: He first presses 86 and then the 10 digit number to be > forwarded. Here the 86 has to be stripped and the 10 digit number > should be inserted into the call forward value column of the > preferences table. > Also if he wants to remove the forwarded number, he can do so by > pressing say for eg: 87. on receiving this number openser should > delete that value from the > table. > Is this possible. I tried to do the following, but somehow it does not > change the > value. > if(uri=~"^sip:86[0-9]*@") { > if(avp_db_load("$from/username", "s:callfwd")) { #check > if call-fwd feature is enabled for the user > log(1,"AVP condition returned true"); > strip(2); > avp_write("$ruri", "s:callfwd"); > avp_print(); > log(1,"AVP written"); > sl_send_reply("200", "OK"); > exit; > }; > }; > Is avp_write the proper method or I guess avp_db_store can also help > me. The avp_print() function also does not show me anything in the > log. Are there any > logical mistakes or I have mis-interpreted the syntax of avpops functions. > Please help me in thsi regard. > Thanks a lot in advance. > Jayesh. > > ------------------------------------------------------------------------ > Jiyo cricket on Yahoo! India cricket > > Yahoo! Messenger Mobile > > Stay in touch with your buddies all the time. > >------------------------------------------------------------------------ > >_______________________________________________ >Users mailing list >Users@openser.org >http://openser.org/cgi-bin/mailman/listinfo/users > >
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.
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Hi, I would like to know if it is possible to use the avp_db_query() function to call a stored procedure instead of a raw query? I have not seen any documentation on this. Are there any examples of this? I receive an error : submit_query: PROCEDURE openser.sp_getrouteinfo can't return a result set in the given context whenever I attempt to do this. Any information on this would be greatly appreciated. M Nawrot