<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’m new in openser so I’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> </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’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?<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> </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> </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> </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 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'> <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 | 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:<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'> <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'> if(uri=~"^sip:86[0-9]*@") {<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>
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><span style='font-weight:bold;font-style:italic'>Bogdan-Andrei Iancu
<bogdan@voice-system.ro></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>
> 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>
> <br>
<HTTP: cricket in.sports.yahoo.com _x002a_http: mailcricket in mail us.rd.yahoo.com/>>
Yahoo! Messenger Mobile <br>
> <br>
<HTTP: _x002a_http: in mail us.rd.yahoo.com messenger new in.mobile.yahoo.com mailmobilemessenger/>>
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>
><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> </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>