Hi Gents,
Please consider applying this patch:
--- ./modules/sqlops/sql_api.c.orig 2015-03-18 16:33:56.994320505 +0100
+++ ./modules/sqlops/sql_api.c 2015-03-18 16:34:11.254419341 +0100
@@ -743,7 +743,7 @@
LM_ERR("row index out of bounds [%d/%d]\n", i, res->nrows);
goto error;
}
- if(i>=res->ncols)
+ if(j>=res->ncols)
{
LM_ERR("column index out of bounds [%d/%d]\n", j,
res->ncols);
goto error;
Regards,
Misi
Hi, all
I'm trying to set up 2 kamailio servers for active-active redundancy. The
two kamailio severs share the the same database with db_mode=3, and no
registration replication. Use pjsua2 as SIP client for testing. The test
setup is as follows:
kamailio server 1(k1): 10.0.1.30:5061
kamailio server 2(k2): 10.0.1.32:5061
sip client c1: sip:16317@10.0.1.30, client ip: 10.0.1.254
sip client c2: sip:72316@10.0.1.30, client ip: 10.0.1.254
c1 is registered with k1.
c2 is registered with k2.
When c1 calls c2, the call flow is as follows:
INVITE:
c1------>k1------>k2------>c2
200 OK:
c1<------k1<------k2<------c2
So far, the INVITE works. c1 and c2 can establish a call. However, when c2
hangs up and sends BYE, the BYE is forwarded all the way to k1, and then k1
gives a 500 server error.
The log on k1 seems to indicate k1 was attempting to create a TLS
connection to itself instead of using the existing TLS connection to c1 to
forward the BYE.
BYE:
c1 X k1<------k2<------c2
|
|------->Connection refused/500
Here is the kamailio log on k1:
Mar 16 10:34:21 kamailio.sip.com /usr/sbin/kamailio[13396]: ERROR: <core>
[tcp_main.c:2740]: tcpconn_1st_send(): connect 10.0.1.30:55999 failed (RST)
Connection refused
Mar 16 10:34:21 kamailio.sip.com /usr/sbin/kamailio[13396]: ERROR: <core>
[tcp_main.c:2750]: tcpconn_1st_send(): 10.0.1.30:55999: connect & send for
0x7fc96a68a1a0 failed: Connection refused (111)
This is the routing logic for BYE in kamailio.cfg:
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {
xlog("L_DBG", "=====BYE $ru from $fu
$si:$sp to $du=====\n");
dlg_manage();
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the
transaction fails
}
else if ( is_method("ACK") ) {
# ACK is forwarded statelessy
route(NATMANAGE);
}
else if ( is_method("NOTIFY") ) {
# Add Record-Route for in-dialog NOTIFY as
per RFC 6665.
record_route();
}
route(RELAY);
exit;
} else {......
If I add location based routing for BYE from peer kamailio, then the BYE
seems to be forwarded correctly:
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {
xlog("L_DBG", "=====BYE $ru from $fu
$si:$sp to $du=====\n");
dlg_manage();
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the
transaction fails
# If BYE coming from Kamailio peer, route
BYE by location
$var(peerlist)=$sel(cfg_get.trusted.peers);
$var(i) = 0;
while($var(i)<$(var(peerlist){param.count})) {
xlog("L_DBG",
"=====$(var(peerlist){param.count})=====$(var(peerlist){param.valueat,$var(i)})=====\n");
if(src_ip==$(var(peerlist){param.valueat,$var(i)})) {
lookup("location");
xlog("L_DBG", "=====BYE
from $fu $si:$sp to $du=====\n");
break;
}
$var(i) = $var(i) + 1;
}
}
else if ( is_method("ACK") ) {
# ACK is forwarded statelessy
route(NATMANAGE);
}
else if ( is_method("NOTIFY") ) {
# Add Record-Route for in-dialog NOTIFY as
per RFC 6665.
record_route();
}
route(RELAY);
exit;
} else {......
My first question is why k1 loose_route sends the BYE to itself instead of
the client. Is this a bug?
My next question is whether the above location routing for BYE from peer
kamailio a good/safe approach.
The SIP traces are enclosed.
Thanks
Hello,
a bit of time ago I played with Kamailio and BLF, therefore I published
kind of getting started configuration file for this feature. It is
available at:
- http://kb.asipto.com/kamailio:presence:k43-blf
The plan was to add more to the tutorial, some guidelines for
configuring the phones, but the time didn't allow it so far. Keep an eye
on it for some new content. Contributions are also welcome, send them to
me or take the content and publish it with new additions on another place.
Hopefully is going to be useful for some people out there.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
Hi
Hope this is right place to post my question.
I have installed siremis under FreeBSD 10
It went through well. DB created with /usr/local/sbin/kamdbctl create.
Problem happen when I trying to login as admin.
[{"target":"ERROR","content":"
\n[2015-03-11 17:31:37 (GMT)] An exception occurred while executing this script:
\nError message: #8192, Non-static method BizSystem::getConfiguration() should not be called statically, assuming $this from incompatible context<\/font>
\nScript name and line number of error:\/usr\/local\/www\/apache24\/data\/openbiz\/bin\/data\/BizDataObj_Abstract.php:268<\/font>
\n
function:<\/b> errorHandler ( 8192, \"Non-static method BizSystem::getConfiguration() should not be ca...\", \"\/usr\/local\/www\/apache24\/data\/openbiz\/bin\/data\/BizDataObj_Abstrac...\", 268, Array(0) ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/sysheader.inc 117\n
function:<\/b> userErrorHandler ( 8192, \"Non-static method BizSystem::getConfiguration() should not be ca...\", \"\/usr\/local\/www\/apache24\/data\/openbiz\/bin\/data\/BizDataObj_Abstrac...\", 268, Array(0) ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/data\/BizDataObj_Abstract.php 268\n
function:<\/b> setQuoteIdentifiers ( ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/data\/BizDataObj_Abstract.php 177\n
function:<\/b> __construct ( Array(1) ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/data\/BizDataObj.php 37\n
function:<\/b> __construct ( Array(1) ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/ObjectFactory.php 166\n
function:<\/b> constructObject ( \"system.do.UserDO\" ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/ObjectFactory.php 56\n
function:<\/b> getObject ( \"system.do.UserDO\", 0 ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/BizSystem.php 252\n
function:<\/b> getObject ( \"system.do.UserDO\" ) @ \/usr\/local\/www\/apache24\/data\/siremis\/modules\/service\/authService.php 92\n
function:<\/b> authDBUser ( \"admin\", \"admin\" ) @ \/usr\/local\/www\/apache24\/data\/siremis\/modules\/service\/authService.php 66\n
function:<\/b> authenticateUser ( \"admin\", \"admin\" ) @ \/usr\/local\/www\/apache24\/data\/siremis\/modules\/user\/form\/LoginForm.php 92\n
function:<\/b> Login ( ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/BizController.php 310\n
function:<\/b> invoke ( ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/BizController.php 110\n
function:<\/b> dispatchRequest ( ) @ \/usr\/local\/www\/apache24\/data\/openbiz\/bin\/BizController.php 32\n
function:<\/b> include_once ( \"\/usr\/local\/www\/apache24\/data\/openbiz\/bin\/BizController.php\" ) @ \/usr\/local\/www\/apache24\/data\/siremis\/bin\/controller.php 6<\/div>\n
_____
Please ask system administrator for help...<\/div>\n"}]
Anyone knows how to fix?
Boris
____________________________________________________________
This message and any attachments contain confidential information and
must not be disclosed to a third party without the prior written consent of
setcom. If you have received it erroneously, please discard it and contact
us by return.
____________________________________________________________
Hi list,
I'm new here, also to Kamailio. My goal is to achieve the "standard
solution": Kamailio for load balancing and high availability of several
Asterisk servers.
For starters, I've set it up with Kamailio+dispatcher+permissions acting
as a proxy and it was working fine, but I'd like to try to keep it much
more simple. For these reasons:
1) I'd like to maintain different peer settings in Asterisk (DTMF, codecs).
2) I don't want/need a database for Kamailio. I think it is mandatory
for permissions module + IP auth. So, let's do Asterisk the
authentication, it's already there.
3) Accounting. I'm using a software where it's really useful for
accounting purposes if every peer/user has its own entry in Asterisk's
sip.conf / in realtime table.
Long story short, my config now looks like this and it seems to be
working fine for me:
request_route {
route(DISPATCHER);
}
route[DISPATCHER] {
if ( method=="REGISTER") {
ds_select_domain("1","4");
sl_send_reply("300","Redirect");
exit;
}
if ( method=="INVITE" ) {
ds_select_domain("1","4");
sl_send_reply("300","Redirect");
exit;
}
if ( method=="SUBSCRIBE" ) {
ds_select_domain("1","4");
sl_send_reply("300","Redirect");
exit;
}
}
My questions:
1) There are other approaches to the DTMF+codecs issue. Like this thread
from 2013:
http://lists.kamailio.org/pipermail/sr-users/2013-January/076379.html -
but I have dozens of changing PSTN peers, so authentication/accounting
based on port would be cumbersome. Are there new/alternative ways?
2) I searched the archive and the Web but did not find many questions
about a "I-don't-want-Kamailio-to-show-as-the-only-peer-to-Asterisk"
solution. Therefore I'm wondering: Is everyone a) running such
homogeneous setups that they can survive with the same codec + DTMF
settings in Asterisk for all their peers + users? Or b) doing some
rewriting magic within Kamailio to deal with it? Or c) I'm overlooking a
simple solution. Which one is it? :)
3) And the biggest question: Everywhere I read basically "Redirect
server for LB + HA is not recommended, better use proxy". Is this still
true, and if so, what are the reasons? Because I should be worried that
not all clients/gateways out there respect a SIP 300 Redirect? Other
reasons?
Thanks so much! :)
Markus
Hello,
maybe this phrase in the msilo doc is misleading:
*Every time when a user registers with Kamailio, the module is looking in
database for offline messages intended for that user. All of them will be
sent to contact address provided in REGISTER request.*
http://kamailio.org/docs/modules/4.2.x/modules/msilo.html
The above seems to imply that msilo would send the call directly to the
contact address. But this doesn't seem to be the case based on what is
mentioned in several threads in the mailing list and in what I saw in the
msilo.c code.
If so, is there a reason to be a such? Would it be a problem to allow msilo
m_dump to get the values of contact, received and path and use them when
calling t_request?
Regards,
Takeshi.
Hello Daniel,
I want do clean up on routes from first SUBSCRIBE, that when traffic goes to public side of kamailio will be only public route and when traffic is internal the Record-Route will stay internal only. In SDP I see like this.
I tired double routes set 0 in rr, but didn't clean enough.
<--- Transmitting (NAT) to 10.18.130.46:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.18.130.46;branch=z9hG4bKf852.e0223f39c2bbad8366fdf1b7cb22b336.0;i=8;received=10.18.130.46;rport=5060
Via: SIP/2.0/TCP 192.168.88.252:5062;received=client_pub_ipbranch=z9hG4bK0bbe1f7d27257bba9;rport=5062
Record-Route: <sip:10.18.130.46;r2=on;lr=on;ftag=a185d974ec;nat=yes> On public side remote this Record-Route
Record-Route: <sip:kamailio_pub_ip:5084;transport=tcp;r2=on;lr=on;ftag=a185d974ec;nat=yes> On private side remote this Record-Route
From: "Slava Bendersky" <sips:10101@networklab.ca>;tag=a185d974ec
To: <sips:10101@networklab.ca>;tag=as00757d3e
Call-ID: b08adb1ad1804a83
CSeq: 236711034 SUBSCRIBE
Server: FPBX-2.11.0(11.15.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 3600
Contact: <sip:10101@10.18.130.50:5060>;expires=3600
Content-Length: 0
Slava.
From: "Daniel-Constantin Mierla" <miconda(a)gmail.com>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Monday, March 16, 2015 7:01:54 AM
Subject: Re: [SR-Users] remove_hf_value
Hello,
can you give an example of incoming header and how you want to be after modification?
It is not clear for me what end result you want/expect.
Cheers,
Daniel
On 14/03/15 06:41, Slava Bendersky wrote:
Hello Everyone,
Here updated version. Trying remove Record-Route after the coma.
My log shows
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: INFO: <script>: [SUBSCRIBE], Inbound connection from <Client Public IP>
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: ERROR: <script>: <null>
Mar 14 01:25:21 canlvprx01 /usr/sbin/kamailio[751]: INFO: <script>: [SUBSCRIBE], Route for removal: '<null>'
route snippet.
route[ROUTE_HDR_ORG] {
# Getting record routes
if(is_present_hf("Route")) {
xlog("L_INFO", "[$rm], Inbound connection from <$si>\n");
if(is_method("SUBSCRIBE")) {
if(is_ip_rfc1918($si)) {
xlog( "$sel((a)hf_value.Record_Route[-1])" );
xlog("L_INFO", "[$rm], Route for removal: '$sel((a)hf_value.Record_Route[-1])'\n");
remove_hf_value("Record-Route[-1]");
} else {
xlog( "$sel((a)hf_value.Record_Route[1])" );
xlog("L_INFO", "[$rm], Route for removal: '$sel((a)hf_value.Record_Route[1])'\n");
remove_hf_value("Record-Route[1]");
}
}
}
return;
}
Slava,
From: "Slava Bendersky" <volga629(a)networklab.ca>
To: "sr-users" <sr-users(a)lists.sip-router.org>
Sent: Friday, March 13, 2015 1:00:44 PM
Subject: [SR-Users] remove_hf_value
Hello Everyone,
I am trying adjust Record-Route, but can't match headers value
And I am call route(ROUTE_HDR_ORG); right after route(WITHINDLG);
route[ROUTE_HDR_ORG] {
# Getting record routes
if(is_present_hf("Record-Route")) {
if(is_method("SUBSCRIBE")) {
xlog( "$sel((a)hf_value.Record_Route[1])" );
xlog("L_INFO", "[$rm], Route for removal: '$sel((a)hf_value.Record_Route[1])'\n");
remove_hf_value("Record-Route[1]");
}
}
return;
}
Any help Thank you,
Slava.
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users(a)lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hi all,
Have found a few threads on this before which have clarified my understanding a little but not yet presented me with a solution.
I am using dialog_ng. dlg_manage() is deprecated and as per the documentation, I am simply setting a dialog flag early in the request_route.
Kamctl dialog show does indeed show the dialogs are tracked, but they are not destroyed on the receipt of the BYE. Dialog ref count remains at 2 and in state=4
Log shows the following
Mar 16 22:43:42 hh-rcs-sipproxy3 /usr/sbin/kamailio[15484]: DEBUG: tm [t_lookup.c:1373]: t_newtran(): DEBUG: t_newtran: msg id=16 , global msg id=15 , T on entrance=(nil)
Mar 16 22:43:42 hh-rcs-sipproxy3 /usr/sbin/kamailio[15484]: DEBUG: tm [t_lookup.c:527]: t_lookup_request(): t_lookup_request: start searching: hash=5943, isACK=0
Mar 16 22:43:42 hh-rcs-sipproxy3 /usr/sbin/kamailio[15484]: DEBUG: tm [t_lookup.c:485]: matching_3261(): DEBUG: RFC3261 transaction matching failed
Mar 16 22:43:42 hh-rcs-sipproxy3 /usr/sbin/kamailio[15484]: DEBUG: tm [t_lookup.c:709]: t_lookup_request(): DEBUG: t_lookup_request: no transaction found
Mar 16 22:43:42 hh-rcs-sipproxy3 /usr/sbin/kamailio[15484]: DEBUG: tm [t_hooks.c:380]: run_reqin_callbacks_internal(): DBG: trans=0x7fc8d79af798, callback type 1, id 0 entered
Mar 16 22:43:42 hh-rcs-sipproxy3 /usr/sbin/kamailio[15484]: DEBUG: dialog_ng [dlg_handlers.c:855]: dlg_new_dialog(): starting dlg_new_dialog and method is [BYE]
Looks to me as if fails to find a dialog match and actually creates a new dialog.....
Dialog_ng only has one matching mode - DID, others have been deprecated. I have captured the outgoing INVITE and there is no dialog_id parameter added to the record_route. Is that causing my matching problem?
Record-Route: <sip:64.208.160.211;transport=tcp;lr=on;ftag=5419eecb;nat=yes>
Record-Route: <sip:203.171.39.49:5061;transport=tls;lr=on>
Cheers
Shane
Shane Harrison
Senior Software Engineer
Imagination Technologies NZ Limited
Level 2
1 Market Grove
Lower Hutt, 5010
New Zealand
PO Box 30-449
Lower Hutt, 5040
New Zealand
Phone: +64 4 890-3681 ext 3361
Hi All,
I am using kamailio 3.1.5. I am trying to send the PRACK message but it
sends back 404 Not Here. I am new to using this. I am adding details in the
configuration file below: I guess route[WITHINDLG]
####### Defined Values #########
# *** Value defines - IDs used later in config
#!ifdef WITH_MYSQL
# - database URL - used to connect to database server by modules such
# as: auth_db, acc, usrloc, a.s.o.
#!define DBURL "mysql://openser:openserrw@localhost/openser"
#!endif
#!ifdef WITH_MULTIDOMAIN
# - the value for 'use_domain' parameters
#!define MULTIDOMAIN 1
#!else
#!define MULTIDOMAIN 0
#!endif
# - flags
# FLT_ - per transaction (message) flags
# FLB_ - per branch flags
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3
#!define FLT_NATS 5
#!define FLB_NATB 6
#!define FLB_NATSIPPING 7
####### Global Parameters #########
#!ifdef WITH_DEBUG
debug=4
log_stderror=yes
#!else
debug=2
log_stderror=no
#!endif
memdbg=5
memlog=5
log_facility=LOG_LOCAL0
fork=yes
children=4
/* uncomment the next line to disable TCP (default on) */
#disable_tcp=yes
/* uncomment the next line to disable the auto discovery of local aliases
based on reverse DNS on IPs (default on) */
#auto_aliases=no
/* add local domain aliases */
#alias="sip.mydomain.com"
/* uncomment and configure the following line if you want Kamailio to
bind on a specific interface/port/proto (default bind on all available)
*/
#listen=udp:10.0.0.10:5060
/* port to listen to
* - can be specified more than once if needed to listen on many ports */
port=5060
#!ifdef WITH_TLS
enable_tls=yes
#!endif
####### Custom Parameters #########
# These parameters can be modified runtime via RPC interface
# - see the documentation of 'cfg_rpc' module.
#
# Format: group.id = value 'desc' description
# Access: $sel(cfg_get.group.id) or @cfg_get.group.id
#
#!ifdef WITH_PSTN
# PSTN GW Routing
#
# - pstn.gw_ip: valid IP or hostname as string value, example:
# pstn.gw_ip = "10.0.0.101" desc "My PSTN GW Address"
#
# - by default is empty to avoid misrouting
pstn.gw_ip = "" desc "PSTN GW Address"
#!endif
####### Modules Section ########
# set paths to location of modules
#!ifdef LOCAL_TEST_RUN
mpath="modules_k:modules"
#!else
mpath="/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/"
#!endif
#!ifdef WITH_MYSQL
loadmodule "db_mysql.so"
#!endif
loadmodule "mi_fifo.so"
loadmodule "kex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "mi_rpc.so"
loadmodule "acc.so"
#!ifdef WITH_AUTH
loadmodule "auth.so"
loadmodule "auth_db.so"
#!ifdef WITH_IPAUTH
loadmodule "permissions.so"
#!endif
#!endif
#!ifdef WITH_ALIASDB
loadmodule "alias_db.so"
#!endif
#!ifdef WITH_MULTIDOMAIN
loadmodule "domain.so"
#!endif
#!ifdef WITH_PRESENCE
loadmodule "presence.so"
loadmodule "presence_xml.so"
#!endif
#!ifdef WITH_NAT
loadmodule "nathelper.so"
loadmodule "rtpproxy.so"
#!endif
#!ifdef WITH_TLS
loadmodule "tls.so"
#!endif
#!ifdef WITH_ANTIFLOOD
loadmodule "htable.so"
loadmodule "pike.so"
#!endif
#!ifdef WITH_XMLRPC
loadmodule "xmlrpc.so"
#!endif
# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 120000)
# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)
# ----- registrar params -----
modparam("registrar", "method_filtering", 1)
/* uncomment the next line to disable parallel forking via location */
# modparam("registrar", "append_branches", 0)
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam("registrar", "max_contacts", 10)
# ----- acc params -----
/* what special events should be accounted ? */
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
/* by default ww do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "log_flag", FLT_ACC)
modparam("acc", "log_missed_flag", FLT_ACCMISSED)
modparam("acc", "log_extra",
"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
/* enhanced DB accounting */
#!ifdef WITH_ACCDB
modparam("acc", "db_flag", FLT_ACC)
modparam("acc", "db_missed_flag", FLT_ACCMISSED)
modparam("acc", "db_url", DBURL)
modparam("acc", "db_extra",
"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
#!endif
# ----- usrloc params -----
/* enable DB persistency for location entries */
#!ifdef WITH_USRLOCDB
modparam("usrloc", "db_url", DBURL)
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", MULTIDOMAIN)
#!endif
# ----- auth_db params -----
#!ifdef WITH_AUTH
modparam("auth_db", "db_url", DBURL)
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "use_domain", MULTIDOMAIN)
# ----- permissions params -----
#!ifdef WITH_IPAUTH
modparam("permissions", "db_url", DBURL)
modparam("permissions", "db_mode", 1)
#!endif
#!endif
# ----- alias_db params -----
#!ifdef WITH_ALIASDB
modparam("alias_db", "db_url", DBURL)
modparam("alias_db", "use_domain", MULTIDOMAIN)
#!endif
# ----- domain params -----
#!ifdef WITH_MULTIDOMAIN
modparam("domain", "db_url", DBURL)
# use caching
modparam("domain", "db_mode", 1)
# register callback to match myself condition with domains list
modparam("domain", "register_myself", 1)
#!endif
#!ifdef WITH_PRESENCE
# ----- presence params -----
modparam("presence", "db_url", DBURL)
# ----- presence_xml params -----
modparam("presence_xml", "db_url", DBURL)
modparam("presence_xml", "force_active", 1)
#!endif
#!ifdef WITH_NAT
# ----- rtpproxy params -----
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
# ----- nathelper params -----
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
modparam("nathelper", "sipping_from", "sip:pinger@kamailio.org")
# params needed for NAT traversal in other modules
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
modparam("usrloc", "nat_bflag", FLB_NATB)
#!endif
#!ifdef WITH_TLS
# ----- tls params -----
modparam("tls", "config", "/etc/kamailio/tls.cfg")
#!endif
#!ifdef WITH_ANTIFLOOD
# ----- pike params -----
modparam("pike", "sampling_time_unit", 2)
modparam("pike", "reqs_density_per_unit", 16)
modparam("pike", "remove_latency", 4)
# ----- htable params -----
# ip ban htable with autoexpire after 5 minutes
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
#!endif
#!ifdef WITH_XMLRPC
# ----- xmlrpc params -----
modparam("xmlrpc", "route", "XMLRPC");
modparam("xmlrpc", "url_match", "^/RPC")
#!endif
####### Routing Logic ########
# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
route {
# per request initial checks
route(REQINIT);
# NAT detection
route(NAT);
# handle requests within SIP dialogs
route(WITHINDLG);
### only initial requests (no To tag)
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
# authentication
route(AUTH);
# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
remove_hf("Route");
if (is_method("INVITE|SUBSCRIBE"))
record_route();
# account only INVITEs
if (is_method("INVITE"))
{
setflag(FLT_ACC); # do accounting
}
# dispatch requests to foreign domains
route(SIPOUT);
### requests for my local domains
# handle presence related requests
route(PRESENCE);
# handle registrations
route(REGISTRAR);
if ($rU==$null)
{
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
# dispatch destinations to PSTN
route(PSTN);
# user location service
route(LOCATION);
route(RELAY);
}
route[RELAY] {
#!ifdef WITH_NAT
if (check_route_param("nat=yes")) {
setbflag(FLB_NATB);
}
if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) {
route(RTPPROXY);
}
#!endif
/* example how to enable some additional event routes */
if (is_method("INVITE")) {
#t_on_branch("BRANCH_ONE");
t_on_reply("REPLY_ONE");
t_on_failure("FAIL_ONE");
}
if (!t_relay()) {
sl_reply_error();
}
exit;
}
# Per SIP request initial checks
route[REQINIT] {
#!ifdef WITH_ANTIFLOOD
# flood dection from same IP and traffic ban for a while
# be sure you exclude checking trusted peers, such as pstn gateways
# - local host excluded (e.g., loop to self)
if(src_ip!=myself)
{
if($sht(ipban=>$si)!=$null)
{
# ip is already blocked
xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n");
exit;
}
if (!pike_check_req())
{
xlog("L_ALERT","ALERT: pike blocking $rm from $fu
(IP:$si:$sp)\n");
$sht(ipban=>$si) = 1;
exit;
}
}
#!endif
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(!sanity_check("1511", "7"))
{
xlog("Malformed SIP message from $si:$sp\n");
exit;
}
}
# Handle requests within SIP dialogs
route[WITHINDLG] {
if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
if (is_method("BYE")) {
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
}
route(RELAY);
} else {
if (is_method("SUBSCRIBE") && uri == myself) {
# in-dialog subscribe requests
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# no loose-route, but stateful ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream server
t_relay();
exit;
} else {
# ACK without matching transaction ... ignore and
discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
}
# Handle SIP registrations
route[REGISTRAR] {
if (is_method("REGISTER"))
{
if(isflagset(FLT_NATS))
{
setbflag(FLB_NATB);
# uncomment next line to do SIP NAT pinging
## setbflag(FLB_NATSIPPING);
}
if (!save("location"))
sl_reply_error();
exit;
}
}
# USER location service
route[LOCATION] {
#!ifdef WITH_ALIASDB
# search in DB-based aliases
alias_db_lookup("dbaliases");
#!endif
if (!lookup("location")) {
switch ($rc) {
case -1:
case -3:
t_newtran();
t_reply("404", "Not Found");
exit;
case -2:
sl_send_reply("405", "Method Not Allowed");
exit;
}
}
# when routing via usrloc, log the missed calls also
if (is_method("INVITE"))
{
setflag(FLT_ACCMISSED);
}
}
# Presence server route
route[PRESENCE] {
if(!is_method("PUBLISH|SUBSCRIBE"))
return;
#!ifdef WITH_PRESENCE
if (!t_newtran())
{
sl_reply_error();
exit;
};
if(is_method("PUBLISH"))
{
handle_publish();
t_release();
}
else
if( is_method("SUBSCRIBE"))
{
handle_subscribe();
t_release();
}
exit;
#!endif
# if presence enabled, this part will not be executed
if (is_method("PUBLISH") || $rU==$null)
{
sl_send_reply("404", "Not here");
exit;
}
return;
}
# Authentication route
route[AUTH] {
#!ifdef WITH_AUTH
if (is_method("REGISTER"))
{
# authenticate the REGISTER requests (uncomment to enable auth)
if (!www_authorize("$td", "subscriber"))
{
www_challenge("$td", "0");
exit;
}
if ($au!=$tU)
{
sl_send_reply("403","Forbidden auth ID");
exit;
}
} else {
#!ifdef WITH_IPAUTH
if(allow_source_address())
{
# source IP allowed
return;
}
#!endif
# authenticate if from local subscriber
if (from_uri==myself)
{
if (!proxy_authorize("$fd", "subscriber")) {
proxy_challenge("$fd", "0");
exit;
}
if (is_method("PUBLISH"))
{
if ($au!=$tU) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
} else {
if ($au!=$fU) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
}
consume_credentials();
# caller authenticated
} else {
# caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (!uri==myself)
{
sl_send_reply("403","Not relaying");
exit;
}
}
}
#!endif
return;
}
# Caller NAT detection route
route[NAT] {
#!ifdef WITH_NAT
force_rport();
if (nat_uac_test("19")) {
if (method=="REGISTER") {
fix_nated_register();
}
else {
fix_nated_contact();
}
setflag(FLT_NATS);
}
#!endif
return;
}
# RTPProxy control
route[RTPPROXY] {
#!ifdef WITH_NAT
if (is_method("BYE")) {
unforce_rtp_proxy();
} else if (is_method("INVITE")){
force_rtp_proxy();
}
if (!has_totag()) add_rr_param(";nat=yes");
#!endif
return;
}
# Routing to foreign domains
route[SIPOUT] {
if (!uri==myself)
{
append_hf("P-hint: outbound\r\n");
route(RELAY);
}
}
}
I installed 4.2 and I am using the same config file form my current version 1.5.2, but none of my custom logs (xlog) are being printed in the log file, even after rising the debug level, the only messages I see are DEBUG
these are my settings:
loadmodule "xlog.so"
# ----- xlog parms ------
modparam("xlog", "buf_size", 4096)
Sample uses:xlog("L_INFO","mylog: Main logic started.\n");
xlog("L_INFO","mylog: Switchover Activated!\n");
xlog("L_INFO","mylog: Redundancy test, last 11 digits [$var(number)].\n");
xlog("L_INFO","mylog: Too Many Hops.\n");
am I missing something ?