<div>Hi Bogdan,</div> <div>Thanks for the reply and sorry for sending the earlier mail 4 times as yahoo was not responding peoperly.</div> <div>When I do an avp_write(), why does the avp name get stored in the uuid column?</div> <div>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</div> <div>username and other row with the value as forwarded number.</div> <div>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.</div> <div>I get the following in my usr_preferences table after I dial 86 followed by any number.</div> <div> </div> <div>+-----------+----------+--------+-----------+------+-----------------------------+---------------------+<BR>| uuid | username | domain | attribute | type |
value | modified |<BR>+-----------+----------+--------+-----------+------+-----------------------------+---------------------+<BR>| s:callfwd | | | callfwd | 0 | sip:5515551478@202.80.61.10 | 2006-04-05 19:10:49 |<BR>+-----------+----------+--------+-----------+------+-----------------------------+---------------------+<BR><BR>The script snippet is as follows:</div> <div> </div> <div> if(uri=~"^sip:86[0-9]*@") {</div>
<div> <BR> strip(2);<BR> avp_write("$ruri", "s:callfwd");<BR> #avp_write("$from/username", "i:999");<BR> #avp_db_store("i:999", "i:/usr_preferences");<BR> avp_db_store("s:callfwd",
"s:callfwd/usr_preferences");<BR> sl_send_reply("200", "OK");<BR> exit;<BR> }; <BR> <BR><BR><B><I>Bogdan-Andrei Iancu <bogdan@voice-system.ro></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi,<BR><BR>you need two steps:<BR>1) write the ruri (after strip) into an AVP - use avp_write()<BR>2) write the avp into the db - use avp_db_store()<BR><BR>regards,<BR>bogdan<BR><BR>Jayesh Nambiar wrote:<BR><BR>> Hi all,<BR>> I am trying to implement the call forwarding feature in openser. The <BR>> forwarding part is fine. But I have the follwing scenario:<BR>>
Whenever a user needs to change his forwarding number, he should be <BR>> able to do so from his end device only.<BR>> For eg: He first presses 86 and then the 10 digit number to be <BR>> forwarded. Here the 86 has to be stripped and the 10 digit number <BR>> should be inserted into the call forward value column of the <BR>> preferences table.<BR>> Also if he wants to remove the forwarded number, he can do so by <BR>> pressing say for eg: 87. on receiving this number openser should <BR>> delete that value from the<BR>> table.<BR>> Is this possible. I tried to do the following, but somehow it does not <BR>> change the<BR>> value.<BR>> if(uri=~"^sip:86[0-9]*@") {<BR>> if(avp_db_load("$from/username", "s:callfwd")) { #check <BR>> if call-fwd feature is enabled for the user<BR>> log(1,"AVP condition returned true");<BR>> strip(2);<BR>> avp_write("$ruri", "s:callfwd");<BR>> avp_print();<BR>> log(1,"AVP
written");<BR>> sl_send_reply("200", "OK");<BR>> exit;<BR>> };<BR>> };<BR>> Is avp_write the proper method or I guess avp_db_store can also help <BR>> me. The avp_print() function also does not show me anything in the <BR>> log. Are there any<BR>> logical mistakes or I have mis-interpreted the syntax of avpops functions.<BR>> Please help me in thsi regard.<BR>> Thanks a lot in advance.<BR>> Jayesh.<BR>><BR>> ------------------------------------------------------------------------<BR>> Jiyo cricket on Yahoo! India cricket <BR>> <HTTP: cricket in.sports.yahoo.com *http: mailcricket in mail us.rd.yahoo.com /><BR>> Yahoo! Messenger Mobile <BR>> <HTTP: *http: in mail us.rd.yahoo.com messenger new in.mobile.yahoo.com mailmobilemessenger /><BR>> Stay in touch with your buddies all the
time.<BR>><BR>>------------------------------------------------------------------------<BR>><BR>>_______________________________________________<BR>>Users mailing list<BR>>Users@openser.org<BR>>http://openser.org/cgi-bin/mailman/listinfo/users<BR>> <BR>><BR><BR></BLOCKQUOTE><BR><p>
        
        
                <hr size=1>
Jiyo cricket on <a href="http://us.rd.yahoo.com/mail/in/mailcricket/*http://in.sports.yahoo.com/cricket/">Yahoo! India cricket</a><br>
<a href="http://us.rd.yahoo.com/mail/in/mailmobilemessenger/*http://in.mobile.yahoo.com/new/messenger/">Yahoo! Messenger Mobile</a> Stay in touch with your buddies all the time.