<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.StileMessaggioDiPostaElettronica18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi guys, I have a similar problem, maybe
easier. I&#8217;m new in openser so I&#8217;d like to have some help.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I&#8217;d like openser create a table in
MySQL db when receive an INVITE, a row with from uri, method and something else,
I&#8217;ve look into modules docs but I&#8217;ve not understanding at all&#8230;could
you help me, please?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks for reply<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Davide  <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=IT style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=IT style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>Da:</span></font></b><font size=2
face=Tahoma><span lang=IT style='font-size:10.0pt;font-family:Tahoma'>
users-bounces@openser.org [mailto:users-bounces@openser.org] <b><span
style='font-weight:bold'>Per conto di </span></b>Jayesh Nambiar<br>
<b><span style='font-weight:bold'>Inviato:</span></b> mercoledė 5 aprile 2006
15.53<br>
<b><span style='font-weight:bold'>A:</span></b> Bogdan-Andrei Iancu<br>
<b><span style='font-weight:bold'>Cc:</span></b> openser<br>
<b><span style='font-weight:bold'>Oggetto:</span></b> Re: [Users] using AVPs to
write into database</span></font><span lang=IT><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi Bogdan,<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Thanks for the reply and sorry for sending the earlier mail 4 times as
yahoo was not responding peoperly.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>When I do an avp_write(), why does the avp name get stored in the uuid
column?<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>username and other row with the value as forwarded number.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I get the following in my usr_preferences table after I dial 86
followed by&nbsp;any number.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>+-----------+----------+--------+-----------+------+-----------------------------+---------------------+<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:<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;if(uri=~&quot;^sip:86[0-9]*@&quot;) {<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&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(&quot;$ruri&quot;, &quot;s:callfwd&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
#avp_write(&quot;$from/username&quot;, &quot;i:999&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
#avp_db_store(&quot;i:999&quot;, &quot;i:/usr_preferences&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
avp_db_store(&quot;s:callfwd&quot;, &quot;s:callfwd/usr_preferences&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sl_send_reply(&quot;200&quot;, &quot;OK&quot;);<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><span style='font-weight:bold;font-style:italic'>Bogdan-Andrei Iancu
&lt;bogdan@voice-system.ro&gt;</span></i></b> wrote:<o:p></o:p></span></font></p>

</div>

<blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0in 0in 0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>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=~&quot;^sip:86[0-9]*@&quot;) {<br>
&gt; if(avp_db_load(&quot;$from/username&quot;, &quot;s:callfwd&quot;)) {
#check <br>
&gt; if call-fwd feature is enabled for the user<br>
&gt; log(1,&quot;AVP condition returned true&quot;);<br>
&gt; strip(2);<br>
&gt; avp_write(&quot;$ruri&quot;, &quot;s:callfwd&quot;);<br>
&gt; avp_print();<br>
&gt; log(1,&quot;AVP written&quot;);<br>
&gt; sl_send_reply(&quot;200&quot;, &quot;OK&quot;);<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; <br>
<HTTP: cricket in.sports.yahoo.com _x002a_http: mailcricket in mail us.rd.yahoo.com/>&gt;
Yahoo! Messenger Mobile <br>
&gt; <br>
<HTTP: _x002a_http: in mail us.rd.yahoo.com messenger new in.mobile.yahoo.com mailmobilemessenger/>&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;<o:p></o:p></span></font></p>

</blockquote>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=1 width="100%" align=center>

</span></font></div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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.<o:p></o:p></span></font></p>

</div>

</body>

</html>