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