Hello,
We plan to use Kamailio as redirect server. Corresponding contact list is to
be fetched by a Lua script from DB.
The problem is about calling the required 'rewriteuri' function:
1. From lua script. both 'sr.rewriteuri()' and 'sr.modf("rewriteuri",
...)" fails to write the 'contact' field.
2. I tried an alternative way; pushing the value from lua (e.g.
sr.pv.sets("contact", "sip:...")) and got the value in the Kamailio.cfg
($var(contact)). But can't call the rewriteuri function with this variable's
value as argument. This seems to be a general problem of calling a function
from .cfg with a variable's value as parameter.
Any help much appreciated.
--
Sharif
I have been trying to accomplish a couple tasks with Kamailio over the past
month with no luck. What I need is a bit of one-on-one training with
someone who knows the lay of the land. If you do this kind of consulting
and can use Skype with possibly a shared-screen terminal, please drop me an
email with your rate.
Hi,
I am using kamailio (only one) as routing engine. I have 2 gateways. Both of
them sending calls to kamailio.
When i use the carrierroute module i need to change (and succeed) the user
($rU). But, i need to send the call (the invite) back to the gateway that
sent me the call from the beginning (it can be either one of those 2). So,
my problem is that i don’t want to rewrite the host in carrierroute, just
the user. If i leave the rewrite_host field empty, it is considered to be
"black list" and drops the call. If i rewrite the host, i can send the call
to the second gateway that was not the one that sent the call, and the call
drops as well.
any ideas how to use carrierroute for changing user only and send the invite
back to the gateway that originally sent the call?
Thanks,
Uri
Hello,
Kamailio version: 3.1.5
I have been trying to use presence for Event:Dialog. I have used PUA_Dialoginfo module to accomplish this task.
The PUA_dialoginfo module states that if "override_lifetime" is not used, the value of the expires is taken from dialog module.
I have tried the module without the "override_lifetime" which did not create the dialog in the presentity.
When used debug, I did see the xml being generated but finds the dialog "expires=0" and deletes the xml(please find the log below).
But when "override_lifetime" is set, the dialog in the presentity table is set until. But this has a problem,
modparam("pua_dialoginfo", "override_lifetime", 300)
1. if a call is still going on more than the override_lifetime the presentity is deleted.
2. the presentity information is available until the "override_lifetime" even after the call is hung-up.
How do I get this module working without the "override_lifetime" being used.
The Log:
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua_dialoginfo [dialog_publish.c:242]: new_body:#012<?xml version="1.0"?>#012<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="0" state="full" entity="sip:user@mydemo.com">#012 <dialog id="112014dff048e71e" call-id="112014dff048e71e" direction="initiator">#012 <state>Trying</state>#012 <remote>#012 <identity>sip:user01@mydemo.com</identity>#012 <target uri="sip:user01@mydemo.com"/>#012 </remote>#012 <local>#012 <identity>sip:user@mydemo.com</identity>#012 <target uri="sip:user@mydemo.com"/>#012 </local>#012 </dialog>#012</dialog-info>#012
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: DEBUG: <core> [db_res.c:81]: freeing 1 columns
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua_dialoginfo [dialog_publish.c:290]: publish uri= sip:user@mydemo.com
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: DEBUG: <core> [db_res.c:85]: freeing RES_NAMES[0] at 0x8314aa4
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: <core> [mem/q_malloc.c:366]: qm_malloc(0x829bee0, 756) called from pua_dialoginfo: dialog_publish.c: dialog_publish(302)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:428]: qm_free(0x829bee0, 0x8314aa4), called from <core>: db_res.c: db_free_columns(86)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: <core> [mem/q_malloc.c:406]: qm_malloc(0x829bee0, 756) returns address 0x82e84bc frag. 0x82e84a4 (size=900) on 1 -th hit
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:450]: qm_free: freeing frag. 0x8314a8c alloc'ed from db_mysql: km_res.c: db_mysql_get_columns(78)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua_dialoginfo [dialog_publish.c:51]: publ:
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: DEBUG: <core> [db_res.c:94]: freeing result names at 0x8318650
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua_dialoginfo [dialog_publish.c:52]: uri= sip:user@mydemo.com
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:428]: qm_free(0x829bee0, 0x8318650), called from <core>: db_res.c: db_free_columns(95)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua_dialoginfo [dialog_publish.c:53]: id= DIALOG_PUBLISH.112014dff048e71e
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:450]: qm_free: freeing frag. 0x8318638 alloc'ed from <core>: db_res.c: db_allocate_columns(148)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua_dialoginfo [dialog_publish.c:54]: expires= 0
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: DEBUG: <core> [db_res.c:99]: freeing result types at 0x8318684
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua [send_publish.c:403]: pres_uri=sip:user@mydemo.com
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:428]: qm_free(0x829bee0, 0x8318684), called from <core>: db_res.c: db_free_columns(100)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua [hash.c:121]: core_hash= 504
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:450]: qm_free: freeing frag. 0x831866c alloc'ed from <core>: db_res.c: db_allocate_columns(157)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua [hash.c:171]: record not found
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: DEBUG: <core> [db_res.c:54]: freeing 1 rows
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua [send_publish.c:444]: insert type
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: DEBUG: <core> [db_row.c:97]: freeing row values at 0x8314b14
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua [send_publish.c:448]: UPDATE_TYPE and no record found
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:428]: qm_free(0x829bee0, 0x8314b14), called from <core>: db_row.c: db_free_row(98)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: DEBUG: pua [send_publish.c:454]: request for a publish with expires 0 and no record found
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: <core> [mem/q_malloc.c:450]: qm_free: freeing frag. 0x8314afc alloc'ed from <core>: db_row.c: db_allocate_row(114)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3289]: <core> [mem/q_malloc.c:428]: qm_free(0x829bee0, 0x82e84bc), called from pua_dialoginfo: dialog_publish.c: dialog_publish(357)
Oct 21 12:12:46 SIPTest /usr/local/sbin/kamailio[3288]: DEBUG: <core> [db_res.c:62]: freeing rows at 0x8314adc
Regards
Gnaneshwar
Hi all,
when there many records in DB tables like location(usrloc use write
back mode), pua etc, kamailio fail to start by complaining "no pkg
memory left" when try to load (restore) all records from DB to
hashtable of location/pua. The share momory are allocated enough for
the hashtable, but the default compilation of the PKG_MEMORY_SIZE is
4MB, which allow only restore several thousands records. I know I can
increase the PKG_MEMORY_SIZE, but anyway there is a limitation which
may fail to restore all records from DB during the startup of kamailio
if it reach the limit of the number of records in DB.
Is there anyway to reload the hashtable from table by doing query n
rows a time and loop until non more result from DB? this will avoid
the kamailio startup problem when there are many records in hashtable
which are save also in DB.
Thank you very much in advanced!
Laura
Hi
I am using dialog module in Kamailio 3.1.5, and find that the dialog
table entry does not get deleted after call if in-dialog requests (e.g.
session timer refresh re-INVITEs in my case) are challenged. The entry
will stay there and get deleted after a long time (some time out? I
didn't set any dialog timeouts myself). If I remove the challenge for
in-dialog requests, then the dialog entry is deleted right after the call.
I use the example config script with a bit of modification for my
in-dialog route:
route[WITHINDLG] {
xlog("L_DBG","WITHINDLG: method=$rm, callid=$ci, cseq=$cs\n");
if (has_totag() ) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
# Filter out bad/faked up in-dialog requests.
if ( !is_known_dlg() )
{
xlog("L_WARN","WITHINDLG: NOT known dlg!! method=$rm,
callid=$ci, cseq=$cs, $fu->$tu\n");
exit;
}
if (is_method("BYE")) {
xlog("L_DBG","WITHINDLG: BYE found within Dialog \n");
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
}
##########################################################
# challenge: if not CANCEL/ACK
else if ( !is_method("CANCEL") && !is_method("ACK") )
{
route(AUTH);
}
##########################################################
xlog("L_DBG","WITHINDLG: Entering RELAY route from WITHINDLG
route. \n");
route(RELAY);
} else {
if (is_method("SUBSCRIBE") && uri == myself) {
# in-dialog subscribe requests
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
xlog("L_DBG","WITHINDLG: ACK callid=$ci, cseq=$cs\n");
if ( t_check_trans() ) {
# no loose-route, but stateful ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream server
xlog("L_DBG","ACK being relayed\n");
t_relay();
exit;
} else {
# ACK without matching transaction ... ignore and discard
xlog("L_DBG","ACK without matching transaction-ignore and
discard\n");
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
}
The part that calls route(AUTH) that I added was the cause for the
dialog entry not being deleted after call.
Here are my dialog related settings:
modparam("dialog", "enable_stats", 1)
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "db_url", DBURL)
modparam("dialog", "db_update_period", 20) # use short one to catch
short dlgs (default:60)
modparam("dialog", "db_mode", 1)
# don't use did, so to cope with clients that don't preserve parameters
# and mode 1 (fallback to 3261 matching) didn't work??
modparam("dialog", "dlg_match_mode", 2)
modparam("dialog", "profiles_no_value", "inbound ; outbound")
modparam("dialog", "dlg_extra_hdrs", "Hint: dialog expired\r\n")
# default timeout set to max int 0x07FFFF FFFF
modparam("dialog", "default_timeout", 2147483647)
And I set the dialog flag (4) when receiving the initial INVITE.
Any idea why? Am I using the dialog module correctly?
Thanks very much!
Yufei
--
Yufei Tao
Red Embedded
This E-mail and any attachments hereto are strictly confidential and intended solely for the addressee. If you are not the intended addressee please notify the sender by return and delete the message.
You must not disclose, forward or copy this E-mail or attachments to any third party without the prior consent of the sender.
Red Embedded Design, Company Number 06688253 Registered in England: The Waterfront, Salts Mill Rd, Saltaire, BD17 7EZ
Hi everybody
I cross compiled kamailio for ARM. However, when I try to start kamailio on the ARM machine, it tells me that there are a lot of undefined symbols. E.g. libkcore.so does not find the symbol dprint_crit. Having a look at libkcore.so:
$ nm -C -D lib/kcore/libkcore.so|grep dprint
U dprint_crit
All deployed .so files do not contain dprint_crit. However I found dprint_crit in an object file, that was used for compilation. Namely in dprint.o:
$ nm -C dprint.o |grep print
00000000 B dprint_crit
I used following commands to cross compile kamailio:
export GCC_ARM_HOME=/opt/arm-2009q1/arm-none-linux-gnueabi/
export TOOL_PREFIX=/opt/arm-2009q1/bin/arm-none-linux-gnueabi
export CXX=$TOOL_PREFIX-g++
export AR=$TOOL_PREFIX-ar
export RANLIB=$TOOL_PREFIX-ranlib
export CC=$TOOL_PREFIX-gcc
export LD=$TOOL_PREFIX-ld
export ARM_TARGET_LIB=/opt/arm-2009q1/arm-none-linux-gnueabi/libc
make proper
make cfg FLAVOUR=kamailio PREFIX=/root/kamailio/local include_modules="auth auth_db db_text registrar" ARCH=arm TARGET=arm-none-linux-gnueabi
make all && make install
Thanks
Amin
Hello list,
I'm using Kamailio 3.1.5 in front of asterisk servers. Kamailio handles all
the SIP registrations. Calls from SIP phones are forwarded to asterisks and
then dialled out to Kamailio.
root@SBCserver:~# kamailio -V
version: kamailio 3.1.5 (x86_64/linux) 76fff5
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 76fff5
compiled on 08:21:33 Oct 27 2011 with gcc 4.6.1
root@SBCserver:~#
Problem:
When call is initiated from a softphone and is in ringing phase, CANCEL
just don't work. I've done some initial debugging and the following piece
of code in main route is failing.
# CANCEL processing
if (is_method("CANCEL"))
{
xlog("L_NOTICE","$rm from $fu (IP:$si:$sp) ---CAPTURED IN MAIN---\n");
if (t_check_trans()){
t_relay();
xlog("L_NOTICE","$rm from $fu (IP:$si:$sp) ---CHECK TRANS
TRUE---\n");
}
xlog("L_NOTICE","$rm from $fu (IP:$si:$sp) ---CHECK TRANS FALSE---\n");
exit;
}
Also the CANCEL fails the has_totag() condition !
The same Call CANCEL scenario works fine for any client on Public IP !
Hope to get some pointers for the solution.
Regards,
Sammy.
Hi All,
kamailio 3.1.2 recognize value "transport=TLS" on contact header or only
"transport=tls"?
kamailio forwards (t_relay function) the message with UDP protocol when
value "transport=TLS" is on contact header.
Cheers