<div dir="ltr"><div><div>Hello, i'm trying to set BLF on my snom 320 phone to get notification on function key for certain extension as well registered against kamailio.<br>Any other info i can provide except the following one and as well i want to exuse me, as i'm pretty noob to all this, and my question might be silly, but after hours in front of google i found no solution :)<br>
<br>I always get that:<br><br> after pua_set_publish() **<br> 3(7825) ERROR: *** cfgtrace: c=[/usr/local/etc/kamailio/kamailio.cfg] l=791 a=16 n=if<br> 3(7825) ERROR: *** cfgtrace: c=[/usr/local/etc/kamailio/kamailio.cfg] l=780 a=41 n=isflagset<br>
3(7825) ERROR: *** cfgtrace: c=[/usr/local/etc/kamailio/kamailio.cfg] l=799 a=16 n=if<br> 3(7825) ERROR: *** cfgtrace: c=[/usr/local/etc/kamailio/kamailio.cfg] l=791 a=25 n=save<br> 3(7825) ERROR: pua [send_publish.c:578]: New PUBLISH and no body found- invalid request<br>
3(7825) ERROR: pua_usrloc [ul_publish.c:326]: while sending publish<br> 3(7825) ERROR: pua_usrloc [ul_publish.c:327]: TEST: type & UL_CONTACT_UPDATE is 2, and error is -1 <br> (^^^ This line was added by me into module as i saw related thread and the patch solution, though it never meets condition and fails to insert from there as well.)<br>
3(7825) ERROR: *** cfgtrace: c=[/usr/local/etc/kamailio/kamailio.cfg] l=799 a=2 n=exit<br><br><br><br></div><div>my configs are :<br></div>in BLF i set <br><br><sip:666@SERV_IP;user=phone><br><br></div>in cfg i have<br>
<br><br><div><div><br>alias="SERV_IP"<br>listen=udp:SERV_IP<br>port=5060<br><br>loadmodule "db_mysql.so"<br><br>loadmodule "mi_fifo.so"<br>loadmodule "kex.so"<br>loadmodule "tm.so"<br>
loadmodule "tmx.so"<br>loadmodule "sl.so"<br>loadmodule "rr.so"<br>loadmodule "pv.so"<br>loadmodule "maxfwd.so"<br>loadmodule "usrloc.so"<br>loadmodule "registrar.so"<br>
loadmodule "textops.so"<br>loadmodule "siputils.so"<br>loadmodule "xlog.so"<br>loadmodule "sanity.so"<br>loadmodule "ctl.so"<br>loadmodule "cfg_rpc.so"<br>loadmodule "mi_rpc.so"<br>
loadmodule "acc.so"<br>loadmodule "auth.so"<br>loadmodule "auth_db.so"<br>loadmodule "alias_db.so"<br>loadmodule "speeddial.so"<br><br>...<br><br>modparam("usrloc", "db_url", DBURL)<br>
modparam("usrloc", "db_mode", 3)<br>modparam("usrloc", "use_domain", MULTIDOMAIN)<br>...<br><br>modparam("presence", "db_url", DBURL)<br>modparam("presence", "subs_db_mode" , 3 )<br>
#modparam("presence", "publ_cache", 0)<br>modparam("presence", "expires_offset", 300)<br>modparam("presence", "max_expires", 3600)<br>#modparam("presence", "force_active", 1)<br>
modparam("presence", "db_update_period", 10)<br>modparam("presence", "server_address", "sip:SERV_IP:5060")<br><br><br>modparam("presence_xml", "db_url", DBURL)<br>
modparam("presence_xml", "force_active", 1)<br>#modparam("presence_dialoginfo", "force_single_dialog", 1)<br><br>modparam("pua", "db_url" ,DBURL )<br>modparam("pua", "db_mode", 2)<br>
modparam("pua", "db_table", "pua")<br>#modparam("pua", "outbound_proxy", "sip:SERV_IP")<br>modparam("pua", "min_expires", 10)<br>modparam("pua", "default_expires", 3600)<br>
modparam("pua", "update_period", 60)<br>modparam("pua_usrloc", "default_domain", "SERV_IP")<br><br>request_route {<br><br><br><br><br>if(method=="NOTIFY")<br> {<br>
xlog(" pua_update_contact $rm from $fu (IP:$si:$sp) \n");<br> <br> if(!pua_update_contact())<br> xlog("pua update failed \n");<br><br><br> <br> }<br>
<br><br><br> # per request initial checks<br> route(REQINIT);<br><br> # NAT detection<br> route(NATDETECT);<br><br> # CANCEL processing<br> if (is_method("CANCEL"))<br> {<br> if (t_check_trans())<br>
t_relay();<br> exit;<br> }<br><br> # handle requests within SIP dialogs<br> route(WITHINDLG);<br><br> ### only initial requests (no To tag)<br><br> t_check_trans();<br><br> # authentication<br>
route(AUTH);<br><br> <br><br><br><br> route(SPEEDDIAL);<br><br> <br><br> # record routing for dialog forming requests (in case they are routed)<br> # - remove preloaded route headers<br> remove_hf("Route");<br>
if (is_method("INVITE|SUBSCRIBE"))<br> record_route();<br><br> # account only INVITEs<br> if (is_method("INVITE"))<br> {<br> setflag(FLT_ACC); # do accounting<br> }<br><br>
# dispatch requests to foreign domains<br> route(SIPOUT);<br><br> ### requests for my local domains<br><br> # handle presence related requests<br> route(PRESENCE);<br><br> # handle registrations<br> route(REGISTRAR);<br>
<br> if ($rU==$null)<br> {<br> <br> # request with no Username in RURI<br> sl_send_reply("484","Address Incomplete");<br> exit;<br> }<br><br> # dispatch destinations to PSTN<br>
route(PSTN);<br><br><br><br><br>route(DISPATCH);<br><br><br><br> # user location service<br> route(LOCATION);<br><br> route(RELAY);<br>}<br><br><br>route[RELAY] {<br><br> # enable additional event routes for forwarded requests<br>
# - serial forking, RTP relaying handling, a.s.o.<br> if (is_method("INVITE|SUBSCRIBE")) {<br> t_on_branch("MANAGE_BRANCH");<br> t_on_reply("MANAGE_REPLY");<br> }<br> if (is_method("INVITE")) {<br>
t_on_failure("MANAGE_FAILURE");<br> }<br><br> if (!t_relay()) {<br> sl_reply_error();<br> }<br> exit;<br>}<br><br># Per SIP request initial checks<br>route[REQINIT] {<br>#!ifdef WITH_ANTIFLOOD<br>
# flood dection from same IP and traffic ban for a while<br> # be sure you exclude checking trusted peers, such as pstn gateways<br> # - local host excluded (e.g., loop to self)<br> if(src_ip!=myself)<br> {<br>
if($sht(ipban=>$si)!=$null)<br> {<br> # ip is already blocked<br> xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n");<br> exit;<br> }<br> if (!pike_check_req())<br>
{<br> xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");<br> $sht(ipban=>$si) = 1;<br> exit;<br> }<br> }<br>#!endif<br><br> if (!mf_process_maxfwd_header("10")) {<br>
sl_send_reply("483","Too Many Hops");<br> exit;<br> }<br><br> if(!sanity_check("1511", "7"))<br> {<br> xlog("Malformed SIP message from $si:$sp\n");<br>
exit;<br> }<br>}<br><br># Handle requests within SIP dialogs<br>route[WITHINDLG] {<br> if (has_totag()) {<br> # sequential request withing a dialog should<br> # take the path determined by record-routing<br>
if (loose_route()) {<br> route(DLGURI);<br> if (is_method("BYE")) {<br> setflag(FLT_ACC); # do accounting ...<br> setflag(FLT_ACCFAILED); # ... even if the transaction fails<br>
}<br> else if ( is_method("ACK") ) {<br> # ACK is forwarded statelessy<br> route(NATMANAGE);<br> }<br> else if ( is_method("NOTIFY") ) {<br>
# Add Record-Route for in-dialog NOTIFY as per RFC 6665.<br> record_route();<br> <br> }<br> route(RELAY);<br> } else {<br> if (is_method("SUBSCRIBE") && uri == myself) {<br>
# in-dialog subscribe requests<br> route(PRESENCE);<br> exit;<br> }<br> if ( is_method("ACK") ) {<br> if ( t_check_trans() ) {<br>
# no loose-route, but stateful ACK;<br> # must be an ACK after a 487<br> # or e.g. 404 from upstream server<br> t_relay();<br> exit;<br>
} else {<br> # ACK without matching transaction ... ignore and discard<br> exit;<br> }<br> }<br> sl_send_reply("404","Not here");<br>
}<br> exit;<br> }<br>}<br><br># Handle SIP registrations<br>route[REGISTRAR] {<br><br> if (is_method("REGISTER"))<br> {<br> xlog("pua_set_publish()\n");<br> <br> if(!pua_set_publish())<br>
xlog("set publish failed \n");<br><br> <br> xlog(" after pua_set_publish()\n");<br> if(isflagset(FLT_NATS))<br> {<br> setbflag(FLB_NATB);<br> # uncomment next line to do SIP NAT pinging <br>
## setbflag(FLB_NATSIPPING);<br> }<br><br> <br><br> <br> #pua_set_publish();<br> if (!save("location"))<br> {<br> sl_reply_error();<br> xlog("save location failed \n");<br>
<br> }<br> <br><br> exit;<br> <br>}<br>}<br><br># USER location service<br>route[LOCATION] {<br><br>#!ifdef WITH_SPEEDIAL<br><br><br><br>if(uri=~"sip:[0-9]{2}@.*")<br> <br><br><br>
xlog("speeddials\n");<br><br> # search for short dialing - 2-digit extension<br> if($rU=~"^[0-9][0-9]$")<br> if(sd_lookup("speed_dial"))<br> route(SIPOUT);<br>#!endif<br>
<br>#!ifdef WITH_ALIASDB<br> # search in DB-based aliases<br> if(alias_db_lookup("dbaliases"))<br> route(SIPOUT);<br>#!endif<br><br> $avp(oexten) = $rU;<br> if (!lookup("location")) {<br>
$var(rc) = $rc;<br> route(TOVOICEMAIL);<br> t_newtran();<br> switch ($var(rc)) {<br> case -1:<br> case -3:<br> send_reply("404", "Not Found");<br>
exit;<br> case -2:<br> send_reply("405", "Method Not Allowed");<br> exit;<br> }<br> }<br><br> # when routing via usrloc, log the missed calls also<br>
if (is_method("INVITE"))<br> {<br> setflag(FLT_ACCMISSED);<br> }<br>}<br><br># Presence server route<br>route[PRESENCE] {<br> if(!is_method("PUBLISH|SUBSCRIBE"))<br> return;<br>
<br><br> # search for short dialing - 2-digit extension<br> if($rU=~"^[0-9][0-9]$")<br> sd_lookup("speed_dial");<br><br> route(SPEEDDIAL);<br><br><br><br>xlog("PUBLISH|SUBSCRIBE");<br>
<br><br> sl_send_reply("100","trying");<br> if (!t_newtran())<br> {<br> sl_reply_error();<br> exit;<br> };<br> append_to_reply("Contact: <sip:<a href="http://82.80.18.100:5060">82.80.18.100:5060</a>>\r\n");<br>
if(is_method("PUBLISH"))<br> {<br> xlog("handle publish here\n");<br><br> handle_publish();<br> t_release();<br> }<br> else<br> if( is_method("SUBSCRIBE"))<br>
{<br> handle subscribe here \n");<br><br> handle_subscribe();<br> t_release();<br> }<br> exit;<br>}<br><br># Authentication route<br>route[AUTH] {<br>#!ifdef WITH_AUTH<br><br>#!ifdef WITH_IPAUTH<br>
if((!is_method("REGISTER")) && allow_source_address())<br> {<br> # source IP allowed<br> return;<br> }<br>#!endif<br><br> if (is_method("REGISTER") || from_uri==myself)<br>
{<br> # authenticate requests<br> if (!auth_check("$fd", "subscriber", "1")) {<br> auth_challenge("$fd", "0");<br> exit;<br> }<br>
# user authenticated - remove auth header<br> if(!is_method("REGISTER|PUBLISH"))<br> consume_credentials();<br> }<br> # if caller is not local subscriber, then check if it calls<br>
# a local destination, otherwise deny, not an open relay here<br> if (from_uri!=myself && uri!=myself)<br> {<br> sl_send_reply("403","Not relaying");<br> exit;<br> }<br>
<br>#!endif<br> return;<br>}<br><br># Caller NAT detection route<br>route[NATDETECT] {<br>#!ifdef WITH_NAT<br> force_rport();<br> if (nat_uac_test("19")) {<br> if (is_method("REGISTER")) {<br>
fix_nated_register();<br> } else {<br> add_contact_alias();<br> }<br> setflag(FLT_NATS);<br> }<br>#!endif<br> return;<br>}<br><br># RTPProxy control<br>route[NATMANAGE] {<br>
#!ifdef WITH_NAT<br> if (is_request()) {<br> if(has_totag()) {<br> if(check_route_param("nat=yes")) {<br> setbflag(FLB_NATB);<br> }<br> }<br> }<br> if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))<br>
return;<br><br> rtpproxy_manage();<br><br> if (is_request()) {<br> if (!has_totag()) {<br> add_rr_param(";nat=yes");<br> }<br> }<br> if (is_reply()) {<br> if(isbflagset(FLB_NATB)) {<br>
add_contact_alias();<br> }<br> }<br>#!endif<br> return;<br>}<br><br># URI update for dialog requests<br>route[DLGURI] {<br>#!ifdef WITH_NAT<br> if(!isdsturiset()) {<br> handle_ruri_alias();<br>
}<br>#!endif<br> return;<br>}<br><br># Routing to foreign domains<br>route[SIPOUT] {<br> if (!uri==myself)<br> {<br> append_hf("P-hint: outbound\r\n");<br> route(RELAY);<br> }<br>}<br>
<br># PSTN GW routing<br>route[PSTN] {<br> .......<br><br> return;<br>}<br><br># XMLRPC routing<br><br>route[XMLRPC] {<br> ....<br>}<br>#!endif<br><br># route to voicemail server<br>route[TOVOICEMAIL] {<br>......<br>
return;<br>}<br><br># manage outgoing branches<br>branch_route[MANAGE_BRANCH] {<br> xdbg("new branch [$T_branch_idx] to $ru\n");<br> route(NATMANAGE);<br>}<br><br># manage incoming replies<br>onreply_route[MANAGE_REPLY] {<br>
xdbg("incoming reply\n");<br> if(status=~"[12][0-9][0-9]")<br> route(NATMANAGE);<br>}<br><br># manage failure routing cases<br>failure_route[MANAGE_FAILURE] {<br> route(NATMANAGE);<br>
<br> if (t_is_canceled()) {<br> exit;<br> }<br><br>#!ifdef WITH_BLOCK3XX<br> # block call redirect based on 3xx replies.<br> if (t_check_status("3[0-9][0-9]")) {<br> t_reply("404","Not found");<br>
exit;<br> }<br>#!endif<br><br>}<br><br><br><br><br><br><br><br>route[SPEEDDIAL] {<br>.....<br> return;<br> }<br><br><br>....<br><br><br><br><br><br><br></div><div><br><br><br><br><br><br><br><br></div></div>
</div>