<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Daniel,<br>
<br>
I found that I was able to do this, and openser accepts it, and inserts a database record...<br>
avp_db_query("insert into sip_responses (response_code, response_reason) values ('$rs','abc')");<br>
<br>
That is in a failure block. However, in the failure block, $rs is 0. I
tried putting the avp_db_query into the reply block, and openser tells
me that avp_db_query isn't allowed in the reply block, SO I then tried
putting this:<br>
<br>
avp_write("$rs","$avp(result)");<br>
<br>
into the reply block, and openser tells me that avp_write can't be used in a reply block.<br>
<br>
Argh!<br>
<br>
I just want to get a sip response code for the call and put it into the database.<br>
<br>
I'm using version 1.1.<br>
<br>
Douglas.<br>
<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Daniel-Constantin Mierla <daniel@voice-system.ro><br>To: Douglas Garstang <dougmig33@yahoo.com><br>Cc: users@lists.openser.org<br>Sent: Thursday, November 8, 2007 1:30:50 PM<br>Subject: Re: [OpenSER-Users] Storing SIP Response Codes with avpops?<br><br>
What version are you using? I just tested with trunk version and all
ok?<br><br>For the other issue, just set:<br>modparam("avpops", "avp_table", "usr_preferences")<br><br>Daniel<br><br><br>On 11/08/07 23:20, Douglas Garstang wrote:<br>> Thanks, but when I try that, I get the following error from openser:<br>><br>> Nov 7 23:17:32 localhost openser[7035]: ERROR:xl_parse_spec: bad
pvar <br>> name "rr{s.escape.common})') "<br>> Nov 7 23:17:32 localhost openser[7035]: <br>> ERROR:avpops:fixup_db_query_avp: wrong format[insert into <br>> sip_responses (response_code, response_reason) values ('$rs', <br>> '$(rr{s.escape.common})') ]<br>> Nov 7 23:17:32 localhost openser[7035]: ERROR: fix_actions: fixing <br>> failed (code=-1) at cfg line 139<br>><br>> OpenSER also complains that i need to specify an avp table, but since
<br>> I am specifying the table in the query, I don't understand why that's
<br>> required.<br>><br>> Douglas.<br>><br>><br>> ----- Original Message ----<br>> From: Daniel-Constantin Mierla <<a ymailto="mailto:daniel@voice-system.ro" href="mailto:daniel@voice-system.ro">daniel@voice-system.ro</a>><br>> To: Douglas Garstang <<a ymailto="mailto:dougmig33@yahoo.com" href="mailto:dougmig33@yahoo.com">dougmig33@yahoo.com</a>><br>> Cc: <a ymailto="mailto:users@lists.openser.org" href="mailto:users@lists.openser.org">users@lists.openser.org</a><br>> Sent: Thursday, November 8, 2007 11:57:35 AM<br>> Subject: Re: [OpenSER-Users] Storing SIP Response Codes with avpops?<br>><br>> Hello,<br>><br>> On 11/08/07 21:40, Douglas Garstang wrote:<br>> > All,<br>> ><br>> > I'd like to store SIP response codes in mysql using avpops. Is this<br>> > possible?<br>> ><br>> > I tried to do this a few years ago and couldn't find any<br>> > documentation.
Unfortunately, I still can't find any.<br>> ><br>> > Can someone post an example? All I can find online is reference<br>> > documentation for avpops.<br>> ><br>> > I'd really like to see a full example with the modparams defining
the<br>> > table structure, and how I would use avp_write and avp_db_store to<br>> > write the $rr response code.<br>> the easiest way is to use avp_db_query(), you can give as parameter
any<br>> sql query. In your case, you can use in onreply_route:<br>><br>> avp_db_query("insert into sip_responses (response_code,
response_reason)<br>> values ('$rs', '$(rr{s.escape.common})') ");<br>><br>> You need to create the table sip_responses, with the two string
columns.<br>><br>> Daniel<br>><br>> ><br>> > Thanks.<br>> > Douglas.<br>> ><br>> ><br>> > __________________________________________________<br>> > Do You Yahoo!?<br>> > Tired of spam? Yahoo! Mail has the best spam protection around<br>> > <a href="http://mail.yahoo.com" target="_blank">http://mail.yahoo.com</a><br>> >
------------------------------------------------------------------------<br>> ><br>> > _______________________________________________<br>> > Users mailing list<br>> > <a ymailto="mailto:Users@lists.openser.org" href="mailto:Users@lists.openser.org">Users@lists.openser.org</a> <mailto:<a ymailto="mailto:Users@lists.openser.org" href="mailto:Users@lists.openser.org">Users@lists.openser.org</a>><br>> > <a href="http://lists.openser.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser.org/cgi-bin/mailman/listinfo/users</a><br>> > <br>><br>><br>> __________________________________________________<br>> Do You Yahoo!?<br>> Tired of spam? Yahoo! Mail has the best spam protection around<br>> <a href="http://mail.yahoo.com" target="_blank">http://mail.yahoo.com</a> <br></div><br></div></div><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?
Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com </body></html>