<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=411524307-30072008>Dear
all</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=411524307-30072008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=411524307-30072008>I use OpenSER with
the perl extension to publish presence states for non-SIMPLE/PUBLISH capable
devices using an outbound proxy. My idea is to send all SIP messages to an
outbound-proxy, that forwards them to the respective registrar/SIP proxy. The
outbound proxy uses SIP messages (INVITE, BYE, CANCEL...) as triggers to call a
perl script that publishes the presence state to a presence agent using
PUA_MI.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=411524307-30072008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=411524307-30072008>Currently,
registrar, presence agent and the publishing functionality are hosted on one
machine. But I think that should not have any impact on the whole
idea...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=411524307-30072008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=411524307-30072008>All what I wanted to
do works fine so far, except that after some time, I get MySQL errors. The Perl
script does not use the database, only from OpenSER script, actions are called.
I posted below some of the error messages I receive and after, the part of my
config performing database queries. Does anyone see a obvious mistake in there?
I tried OpenSER lastest branch and current trunk, both produce the error after
some time.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=411524307-30072008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=411524307-30072008>Thanks for your
help!</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=411524307-30072008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=411524307-30072008>Sebastian</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jul 30 11:07:30 [4329]
ERROR:mysql:db_mysql_submit_query: driver error: Commands out of sync; you can't
run this command now<BR>Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_query: error
while submitting query<BR>Jul 30 11:07:30 [4329] ERROR:pua:db_update: while
querying db table pua<BR>Jul 30 11:07:30 [4329]
ERROR:mysql:db_mysql_submit_query: driver error: Commands out of sync; you can't
run this command now<BR>Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_query: error
while submitting query<BR>Jul 30 11:07:30 [4329]
ERROR:xcap_client:query_xcap_update: in sql query<BR>Jul 30 11:07:30 [4329]
ERROR:mysql:db_mysql_submit_query: driver error: Commands out of sync; you can't
run this command now<BR>Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_delete:
error while submitting query<BR>Jul 30 11:07:30 [4329]
ERROR:presence:update_db_subs: deleting expired information from database<BR>Jul
30 11:07:30 [4329] ERROR:mysql:db_mysql_submit_query: driver error: Commands out
of sync; you can't run this command now<BR>Jul 30 11:07:30 [4329]
ERROR:mysql:db_mysql_query: error while submitting query<BR>Jul 30 11:07:30
[4329] ERROR:presence:msg_watchers_clean: querying database for expired
messages<BR>Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_submit_query: driver
error: Commands out of sync; you can't run this command now<BR>Jul 30 11:07:30
[4329] ERROR:mysql:db_mysql_query: error while submitting query<BR>Jul 30
11:07:30 [4329] ERROR:presence:msg_presentity_clean: querying database for
expired messages<BR>Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_submit_query:
driver error: Commands out of sync; you can't run this command now<BR>Jul 30
11:09:10 [4329] ERROR:mysql:db_mysql_query: error while submitting query<BR>Jul
30 11:09:10 [4329] ERROR:pua:db_update: while querying db table pua<BR>Jul 30
11:09:10 [4329] ERROR:mysql:db_mysql_submit_query: driver error: Commands out of
sync; you can't run this command now<BR>Jul 30 11:09:10 [4329]
ERROR:mysql:db_mysql_query: error while submitting query<BR>Jul 30 11:09:10
[4329] ERROR:xcap_client:query_xcap_update: in sql query<BR>Jul 30 11:09:10
[4329] ERROR:mysql:db_mysql_submit_query: driver error: Commands out of sync;
you can't run this command now<BR>Jul 30 11:09:10 [4329]
ERROR:mysql:db_mysql_delete: error while submitting query<BR>Jul 30 11:09:10
[4329] ERROR:presence:update_db_subs: deleting expired information from
database<BR>Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_submit_query: driver
error: Commands out of sync; you can't run this command now<BR>Jul 30 11:09:10
[4329] ERROR:mysql:db_mysql_query: error while submitting query<BR>Jul 30
11:09:10 [4329] ERROR:presence:msg_watchers_clean: querying database for expired
messages<BR>Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_submit_query: driver
error: Commands out of sync; you can't run this command now<BR>Jul 30 11:09:10
[4329] ERROR:mysql:db_mysql_query: error while submitting query<BR>Jul 30
11:09:10 [4329] ERROR:presence:msg_presentity_clean: querying database for
expired messages</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>203
if (uri==myself)
{<BR>204
if (method=="REGISTER")
{<BR>205
# Uncomment this if you want to use digest
authentication<BR>206
if (!www_authorize("<SPAN class=411524307-30072008>IP</SPAN>", "subscriber"))
{<BR>207
www_challenge("<SPAN class=411524307-30072008>IP</SPAN>",
"0");<BR>208
exit;<BR>209
};<BR>210
<BR>211
# query if dialog exists for registering
URI<BR>212
avp_delete("*");<BR>213
if (avp_db_query("SELECT
from_uri,<BR>214
to_uri<BR>215
FROM
dialog<BR>216
WHERE from_uri='$tu' or to_uri='$tu' or from_uri='$tu:5060' or
to_uri='$tu:5060'"))
{<BR>217
#xlog("L_INFO", ">>> Dialog active: caller=$avp(i:1)
callee=$avp(i:2)\n");<BR>218
} else
{<BR>219
#xlog("L_INFO", ">>> No Dialog active: avp_db_query() returned no
records\n");<BR>220
};<BR>221
xlog("L_INFO", ">>>>>>>>> REGISTER received
($tu)\n");<BR>222
if(!is_avp_set("$avp(i:1)")) { # no call active for registering to_uri
user<BR>223
xlog("L_INFO", ">>>>>>>>>
PUBLISHED\n");<BR>224
perl_exec("publish");<BR>225
} else
{<BR>226
xlog("L_INFO", ">>>>>>>>> NOT PUBLISHED, call
active\n");<BR>227
}<BR>228
save("location");<BR>229
exit;<BR>230
}<BR>231
<BR>232
if(is_method("SUBSCRIBE|PUBLISH"))
{<BR>233
if(is_method("PUBLISH"))
{<BR>234
if($si == "<SPAN class=411524307-30072008>IP</SPAN>")
{<BR>235
if (!t_newtran())
{<BR>236
sl_reply_error();<BR>237
exit;<BR>238
};<BR>239
handle_publish();<BR>240
t_release();<BR>241
} else
{<BR>242
sl_send_reply("488","Not Acceptable
Here");<BR>243
}<BR>244
} else if(is_method("SUBSCRIBE"))
{<BR>245
if (!proxy_authorize("", "subscriber"))
{<BR>246
proxy_challenge("",
"1");<BR>247
exit;<BR>248
};<BR>249
handle_subscribe();<BR>250
t_release();<BR>251
};<BR>252
exit;<BR>253
};</FONT></DIV>
<DIV><FONT face=Arial><FONT
size=2>252
exit;<BR>253
};<BR>254
<BR>255
lookup("aliases");<BR>256
<BR>257
# native SIP destinations are handled using our USRLOC
DB<BR>258
if (!lookup("location"))
{<BR>259
sl_send_reply("404", "Not
Found");<BR>260
exit;<BR>261
} else
{<BR>262
append_hf("P-hint: usrloc
applied\r\n");<BR>263
if(method=="INVITE")
{<BR>264
# Store Dialog in
db<BR>265
setflag(5);<BR>266
# Session
timer<BR>267
setflag(6);<BR>268
if (sstCheckMin("1"))
{<BR>269
xlog("L_ERR", "422 Session Timer Too Small reply
sent.\n");<BR>270
exit;<BR>271
}<BR>272
xlog("L_INFO", ">>>>>>>>> INVITE received ($fu
busy)\n");<BR>273
perl_exec("publish");<BR>274
}<BR>275
};<BR>276 }<SPAN
class=411524307-30072008>;</SPAN></FONT></FONT></DIV></BODY></HTML>