Hi *
not sure if someone has encountered this before but I have noticed a problem
with Snom phones registering with Kamailio.
It seems that the Snom phones register with a contact port of 2049.
However, when Kamailio does the usrloc lookup and the corresponding t_relay,
a packet dump shows me that Kamailio is trying to send the invite to port
5060.
Can anyone shed some light?
Kind regards
Jason
Dear all
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.
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...
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.
Thanks for your help!
Sebastian
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
Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:07:30 [4329] ERROR:pua:db_update: while querying db table pua
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
Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:07:30 [4329] ERROR:xcap_client:query_xcap_update: in sql query
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
Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_delete: error while
submitting query
Jul 30 11:07:30 [4329] ERROR:presence:update_db_subs: deleting expired
information from database
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
Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:07:30 [4329] ERROR:presence:msg_watchers_clean: querying
database for expired messages
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
Jul 30 11:07:30 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:07:30 [4329] ERROR:presence:msg_presentity_clean: querying
database for expired messages
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
Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:09:10 [4329] ERROR:pua:db_update: while querying db table pua
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
Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:09:10 [4329] ERROR:xcap_client:query_xcap_update: in sql query
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
Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_delete: error while
submitting query
Jul 30 11:09:10 [4329] ERROR:presence:update_db_subs: deleting expired
information from database
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
Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:09:10 [4329] ERROR:presence:msg_watchers_clean: querying
database for expired messages
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
Jul 30 11:09:10 [4329] ERROR:mysql:db_mysql_query: error while
submitting query
Jul 30 11:09:10 [4329] ERROR:presence:msg_presentity_clean: querying
database for expired messages
203 if (uri==myself) {
204 if (method=="REGISTER") {
205 # Uncomment this if you want to use digest
authentication
206 if (!www_authorize("IP", "subscriber")) {
207 www_challenge("IP", "0");
208 exit;
209 };
210
211 # query if dialog exists for registering URI
212 avp_delete("*");
213 if (avp_db_query("SELECT from_uri,
214 to_uri
215 FROM dialog
216 WHERE from_uri='$tu' or
to_uri='$tu' or from_uri='$tu:5060' or to_uri='$tu:5060'")) {
217 #xlog("L_INFO", ">>> Dialog active:
caller=$avp(i:1) callee=$avp(i:2)\n");
218 } else {
219 #xlog("L_INFO", ">>> No Dialog
active: avp_db_query() returned no records\n");
220 };
221 xlog("L_INFO", ">>>>>>>>> REGISTER received
($tu)\n");
222 if(!is_avp_set("$avp(i:1)")) { # no call
active for registering to_uri user
223 xlog("L_INFO", ">>>>>>>>>
PUBLISHED\n");
224 perl_exec("publish");
225 } else {
226 xlog("L_INFO", ">>>>>>>>> NOT
PUBLISHED, call active\n");
227 }
228 save("location");
229 exit;
230 }
231
232 if(is_method("SUBSCRIBE|PUBLISH")) {
233 if(is_method("PUBLISH")) {
234 if($si == "IP") {
235 if (!t_newtran()) {
236 sl_reply_error();
237 exit;
238 };
239 handle_publish();
240 t_release();
241 } else {
242 sl_send_reply("488","Not
Acceptable Here");
243 }
244 } else if(is_method("SUBSCRIBE")) {
245 if (!proxy_authorize("",
"subscriber")) {
246 proxy_challenge("", "1");
247 exit;
248 };
249 handle_subscribe();
250 t_release();
251 };
252 exit;
253 };
252 exit;
253 };
254
255 lookup("aliases");
256
257 # native SIP destinations are handled using our
USRLOC DB
258 if (!lookup("location")) {
259 sl_send_reply("404", "Not Found");
260 exit;
261 } else {
262 append_hf("P-hint: usrloc applied\r\n");
263 if(method=="INVITE") {
264 # Store Dialog in db
265 setflag(5);
266 # Session timer
267 setflag(6);
268 if (sstCheckMin("1")) {
269 xlog("L_ERR", "422 Session
Timer Too Small reply sent.\n");
270 exit;
271 }
272 xlog("L_INFO", ">>>>>>>>> INVITE
received ($fu busy)\n");
273 perl_exec("publish");
274 }
275 };
276 };
Maybe some developer has a brilliant idea involving openser and looks
for some support. Also, maybe you will find there ideas that will help
you in the future, so you can comment and vote for it.
Cheers,
Daniel
:: Final Call for the International Developer Challenge A1 InnovationDays ::
Since almost 4 weeks, the international developer challenge A1
InnovationDays attracted more than 30 ideas from creative minds. The
challenge is open to anyone who addresses the grand theme "Open
Communication by Open Standards" and can come up with ideas for cool
services built on IP-based communication (SIP & IMS).
Ideas can be posted on the platform
www.a1innovations.at/en/static/a1innovationdays until August 15, 2008.
All entries are open for voting and discussing by all users. On August
15, the 10 highest ranked ideas will be short-listed and judged by a
panel of recognized experts as well as representatives from the
sponsors. End of August, the best teams behind the ideas will be invited
to a prototyping event near Vienna in order to realize their ideas and
demonstrate their potential. The winning team can choose among several
awards, such as a week of powder snow skiing in Austria. After that, the
sponsor (mobikom Austria) is keen to bring your idea to the market.
All submissions must be based on Open Source Software.
: More Information :
For all details about this challenge, go to the FAQs:
http://www.a1innovations.at/en/static/faq
For registration, go directly to: http://www.a1innovations.at/registrierung
: Important dates ahead :
August 1, 2008: Two prizes for the best interim ideas will be awarded
August 15, 2008: End of idea entries (CET 24:00)
August 18, 2008: Announcement of the five selected teams for the
prototyping event
August 29 - September 1, 2008: Prototyping event at the monastery Und
(near Vienna: http://www.und.at/)
Other notes about the event:
http://blog.tmcnet.com/blog/tom-keating/voip/a1-innovationdays-contest-look…
--
Daniel-Constantin Mierla
http://www.asipto.com
Hi,
Is there a way to detect two phones behind the same NAT device?
Thanks in advance,
Ross
_________________________________________________________________
The John Lewis Clearance - save up to 50% with FREE delivery
http://clk.atdmt.com/UKM/go/101719806/direct/01/
Hi,
For loading all AVPs from "normal" avp tables, I can use something like
this:
avp_db_load("$fu/domain", "*/domain_preferences");
But when I want to use a db schema to load AVPs belonging for example to
a call_id for some sort of dialog tracking, it fails to start with the
following error message:
"ERROR:avpops:parse_avp_db: inconsistent usage of DB scheme without
complet specification of AVP name"
My config looks like that:
modparam("avpops","db_scheme",
"my_schema:table=some_table;uuid_col=call_id;value_col=value")
...
avp_db_load("$ci", "*/$my_schema");
If I put something like "$avp(i:10)" instead of the "*", it works, but
then I just get this specific AVP instead of all of them.
Any idea if this is supposed to work, and if so, how?
Thanks,
Andreas
Hello,
sorry if this is a stupid question,
but in the openser.cfg that comes with the source, I see the following:
if (!lookup("location")) {
switch ($retcode) {
case -1:
case -3:
t_newtran();
t_reply("404", "Not Found");
exit;
case -2:
sl_send_reply("405", "Method Not Allowed");
exit;
}
}
Could you tell me why we use t_newtran/t_reply for cases -1,-3 and
sl_send_reply for case -2.
I read docs for modules sl and tm but I still don't get it why we shoud
created a transaction in one situation and not in the other.
Regards,
takeshi
I'm attempting to understand how call rating works within CDRTool. I am
able to link destinations to the calls, but unable to generate prices. I'm
using CDRTool 6.4.1 with FreeRadius/MySQL and a Cisco gateway. What I'm
trying to setup seems simple: I have one set rate of $.08/min for any call
beginning with a 1 (I'll exclude 800 numbers later). This rate should be
applied globally with no differentiation between caller party or
destination...
Any help is greatly appreciated...
Hey,
I have the same problem , using the same openser configuration file, only
adding pua_bla "server_address" parameter on 1.3.2 bla stop working.
I installed 2 openser once with 1.3.0 and the other with openser 1.3.2, then
start openser using full debug log level to see what happens with each one.
I'm using Polycom 650 hardphones
Basic console error log
-------------------------------------
ERROR:pua_bla:bla_handle_notify: content length= 0
WARNING:tm:t_unref: script writer didn't release transaction
http://pastebin.com/m4a1b7969 (OpenSER 1.3.2 debug logs)
Full debug log
-----------------------
http://pastebin.com/m177c219a (OpenSER 1.3.0 full log)
http://pastebin.com/m36f3ffca (OpenSER 1.3.2 full log)
The main difference that I saw comparing both logs are remarked in pastbin,
and refer to: "DBG:pua:print_subs: pres_uri"
Please see below both configuration parameters
Openser Parameters
----------------------------------
# Presence server module - common API
loadmodule "presence.so"
modparam("presence", "server_address", "sip:192.168.4.10")
modparam("presence", "max_expires", 3600)
# Presence server module - presence & watcher info and XCAP
loadmodule "presence_xml.so"
modparam("presence_xml", "force_active", 1)
# Common API for presence user agent client
loadmodule "pua.so"
# BLA extension for PUA
loadmodule "pua_bla.so"
modparam("pua_bla", "default_domain", "192.168.4.10")
modparam("pua_bla", "header_name", "Sender")
modparam("pua_bla", "server_address", "sip:192.168.4.10") (Only for OpenSER
1.3.2
I'm sending configuration of affected routes (Main, Register, Presence) so
you can see if there is an error.
route {
# Sanity Check Section
#.....
# Loose Route Section
if (loose_route()) {
xlog("L_INFO", "$mi Loose Routing");
if(!has_totag()) {
xlog("L_INFO", "OPENSER_NAME: $mi Initial loose-routing rejected - \
M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
sl_send_reply("403", "Initial Loose-Routing Rejected");
route(ACC_FORBIDDEN_ROUTE);
return;
}
if (is_method("CANCEL") || is_method("ACK")) {
xlog("L_INFO", "$mi CANCEL/ACK");
route(BASE_LOCAL_ROUTE);
return;
}
if (is_method("SUBSCRIBE") && $rd == "OPENSER_IP") {
# in-dialog subscribe requests
route(PRESENCE_ROUTE);
return;
}
if(is_method("BYE")) {
route(ACC_BYE_ROUTE);
xlog("L_INFO", "(ACC) $mi Setting account_flag");
setflag(ACC_FLAG);
route(BASE_LOCAL_ROUTE);
return;
}
};
# Call Type Processing Section
if (method=="INVITE") {
route(INVITE_ROUTE);
return;
};
if (method=="REGISTER") {
route(REGISTER_ROUTE);
return;
}
if(is_method("PUBLISH|SUBSCRIBE")) {
route(PRESENCE_ROUTE);
return;
}
if(is_method("NOTIFY")) {
if($hdr(event)=="dialog;sla") {
route(PRESENCE_ROUTE);
return;
}
}
}
route[REGISTER_ROUTE] {
# -----------------------------------------------------------------
# REGISTER Message Handler
# -----------------------------------------------------------------
# This cool register script came from
http://openser.org/docs/scripting.html
xlog("L_NOTICE", "OPENSER_NAME: $mi Register Route - \
M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
if ((!www_authorize("OPENSER_DOMAIN", "device")))) {
xlog("L_INFO", "OPENSER_NAME: $mi Register Authentication Failed - \
M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
www_challenge("OPENSER_DOMAIN", "0");
sl_send_reply("401", "Unauthorized");
exit;
}
else
xlog("L_INFO", "OPENSER_NAME: $mi Register Authentication OK -\
M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
if ( !(src_ip=="LOCAL_PAIR_IP" && src_port==LOCAL_PAIR_PORT) ) {
if($hdr(User-Agent) =~ "PolycomSoundPointIP-SPIP_650-UA") {
xlog("L_NOTICE", "$mi Polycom BLA set FLAG \
M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
bla_set_flag();
}
if (!save("location")) {
xlog("L_NOTICE", "$mi $fu save(location) Failed\n");
sl_reply_error();
return(0);
};
}
consume_credentials();
return;
}
route[PRESENCE_ROUTE] {
# -------------------------------------------------------------------
# Presence Route
# -------------------------------------------------------------------
xlog("L_INFO","$mi: Presence Route");
if (!t_newtran()){
sl_reply_error();
exit;
};
if(is_method("PUBLISH")){
if($hdr(Sender)!= NULL) {
handle_publish("$hdr(Sender)");
}
else {
handle_publish("");
}
t_release();
}
else
if( is_method("SUBSCRIBE")) {
handle_subscribe();
t_release();
} else
if(is_method("NOTIFY")) {
if(bla_handle_notify()) {
t_reply("200", "OK");
t_release();
}
exit;
}
Ok, I hope that provided information help to see if there is a problem on my
configuration or a is a bug on OpenSER 1.3.2
Thanks in advance,
Cheers,
Gustavo Mistrinelli
Dear,
I'm really trying to use OpenSER as a NAT traversal SIP proxy, since my
home phone keeps breaking voice channels (the box was not intended
behind NAT and I'm, of course, using a configuration that no so well
supported).
What is the idea:
SIP transactions should travel this way:
ZyXEL UA <-> SIP Proxy <-> NAT Firewall (iptables) <-> {Internet}
RTP should travel this way:
ZyXEL UA <-> NAT Firewall & RTPProxy <-> {Internet}
My current test is using X-Lite with voipbuster, but that doesn't really
work. It seems that registers are functioning, at least X-Lite reports
itself being registered.
Voice calls always end up in timeouts, so something is really going
wrong here, it might be authentication problems?
An added problem is that I have just sufficient knowledge of SIP to see
what it is doing, without really knowing what to expect exactly.
Furthermore I have virtually no knowledge of OpenSER. I've quite a hard
time even grasping the configuration I typed in. This is not really helpful
What I do know:
* SIP Proxy traffic is flowing.
* SIP INVITES don't work at all.
* SIP to RTP is communication, but I don't know if RTP is actually flowing.
I stole most of the configuration from the "04 NAT Traversal" slides of
the "Italy 2007 Admin course", to which there is link on the
documentation site. I adapted it to make it work with the debian
supplied OpenSER 1.1.
How do I get this all working?
What am I getting wrong?
I really really appeciate any help I can get to get it working!
- Joris
Config is this:
# ----------- global configuration parameters ------------------------
debug=4 # debug level (cmd line: -dddddddddd)
fork=yes # Set to no to enter debugging mode
log_stderror=no # (cmd line: -E) Set to yes to enter debugging mode
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
advertised_address="82.168.191.xx"
advertised_port=5060
port=5060
children=4
fifo="/tmp/openser_fifo"
#
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
mpath="/usr/lib/openser/modules/"
loadmodule "mysql.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "nathelper.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "auth.so"
loadmodule "auth_db.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
modparam("usrloc", "db_mode", 0)
# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
#modparam("usrloc", "db_mode", 2)
# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
modparam("auth_db", "password_column", "password")
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# -- nathelper params ---
modparam("nathelper", "rtpproxy_sock", "udp:192.168.10.6:22222")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
#modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "sipping_from", "sip:pinger@82.168.191.xx")
# ------------------------- request routing logic -------------------
# main routing logic
route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
# NAT detection
route(2);
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
if (!method=="REGISTER")
record_route();
# subsequent messages withing a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
route(1);
};
if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
# if you have some interdomain connections via TLS
#if(uri=~"@tls_domain1.net") {
# t_relay("tls:domain1.net");
# exit;
#} else if(uri=~"@tls_domain2.net") {
# t_relay("tls:domain2.net");
# exit;
#}
route(1);
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
# Uncomment this if you want to use digest
authentication
if (!www_authorize("sip.familiedobbelsteen.nl",
"subscriber")) {
www_challenge("sip.familiedobbelsteen.nl", "0");
exit;
};
if (isflagset(5)) {
# set branch flag -- when someone will
call this user
# INVITE will have branch flag 6 set
after loopup("location")
setflag(6);
# if you want OPTIONS natpings
uncomment next
# setflag(7);
};
save("location");
exit;
};
lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
};
route(1);
}
route[1] {
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (subst_uri('/(sip:.*);nat=yes/\1/i')) {
setflag(6);
};
if (isflagset(5) || isflagset(6)) {
route(3);
};
if (!t_relay()) {
sl_reply_error();
};
exit;
}
route[2] {
force_rport();
if(nat_uac_test("19")) {
if (method=="REGISTER") {
fix_nated_register();
} else {
fix_nated_contact();
};
setflag(5);
};
}
route[3] {
if (is_method("BYE")) {
unforce_rtp_proxy();
} else if (is_method("INVITE")) {
force_rtp_proxy("", "82.168.191.xx");
t_on_failure("2");
};
if (isflagset(5))
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
t_on_reply("1");
}
failure_route[2] {
if (isflagset(6)||isflagset(5)) {
unforce_rtp_proxy();
};
}
onreply_route[1] {
if ((isflagset(5) || isflagset(6)) && status =~
"(183)|(2[0-9][0-9])") {
force_rtp_proxy();
};
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
if (isflagset(6)) {
fix_nated_contact();
};
exit;
}