Hi,
Transformation {param.value, param_name} returns incomplete or empty values
when parameter value contains comma (,).
See next example:
*$avp*(my_var)="a=val_a1,val_a2,val_a3;b=val_b";
in next transformations:
$(*avp*(my_var){param.value, a}) returns 'val_a1'
$(*avp*(my_var){param.value, b}) returns empty string
Seams that comma in parameter value conflicts with semi column separator.
Is this bug or wrong documented?
Related link:
http://www.kamailio.org/wiki/cookbooks/4.0.x/transformations#paramvalue_name
--
Seudin Kasumovic
Tuzla, Bosnia
Hi all, before hand thanks for all the support received on this channel.
I have an issue with an installed server on a aws instance which is giving
me routing loops, my setup is simple, i have alias set for both ips
internal and external and the loop still present when t_relay don't find
any routes to relay it just sent it to itself with the public ip then the
loop starts.
can any one please advise how can i prevent that or just tell t_relay that
if there is no more routes just respond with a cancel or stop searching.
same thing happens when a gw code is not found on the dispatcher list file.
as i had read by just specifying the alias=domain it should take care of it
but it is not happening perhaps because it is a AWS instance, or most
likely i am missing something after the T_relay to stop the call from
looping.
I do have several headers fix because i have an asterisk sending calls with
lots of signalling calls added to the call that i need to remove before the
call is passed out to a carrier or another UA, Kamailio is just proxing the
calls between asterisk and the outside world no Media handling, No
registrations.
Again thanks for any tips to find my answer or if anyone had a similar
issue thanks again.
thanks for any help .
Julian.
on this setup i have
public ip as 2.2.2.2
private IP as 1.1.1.1
#!KAMAILIO
####### Global Parameters #########
#!ifdef WITH_DEBUG
debug=4
log_stderror=yes
#!else
#debug=2
#log_stderror=yes
#!endif
memdbg=5
memlog=5
log_facility=LOG_LOCAL7
fork=yes
children=6
auto_aliases=no
listen=udp:1.1.1.1:5060 advertise 2.2.2.2:5060
alias=1.1.1.1:5060
alias=1.1.1.1
alias=2.2.2.2:5060
alias=2.2.2.2
port=5060
enable_tls=no
#tcp_connection_lifetime=3605
#!ifdef WITH_SRCPATH
mpath="modules_k:modules"
#!else
mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/"
#!endif
loadmodule "db_mysql.so"
##loadmodule "mi_fifo.so"
loadmodule "tm.so"
loadmodule "sl.so"
loadmodule "acc.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "uac.so"
loadmodule "textops.so"
loadmodule "pv.so"
loadmodule "dispatcher.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "siputils.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "mi_rpc.so"
loadmodule "avpops.so"
#!ifdef WITH_NAT
loadmodule "nathelper.so"
loadmodule "rtpproxy.so"
#!endif
loadmodule "xlog.so"
##mysqlcdr
modparam("acc", "db_flag", 2)
modparam("acc", "db_missed_flag", 3)
modparam("acc", "report_cancels", 1)
modparam("acc", "db_url", "mysql://openser:password@1.1.1.2/openser")
modparam("acc", "db_extra", "from_uri=$fu; to_uri=$tu; intid=$fU;
type_call=$si; dst_ip=$ru; carriercode=$tu;callmode=$var(out)" )
#loadmodule "carrierroute"
modparam("tm", "cancel_b_method", 1)
modparam("tm", "failure_reply_mode", 3)
modparam("tm", "fr_timer", 30000)
modparam("tm", "fr_inv_timer", 120000)
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.lst")
modparam("rr", "enable_full_lr", 1)
#!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")
# ----- mi_fifo params -----
##modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
# params needed for NAT traversal in other modules
modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
modparam("usrloc", "nat_bflag", FLB_NATB)
#!endif
modparam("xlog", "buf_size", 8192)
modparam("xlog", "force_color", 1)
#carrierroute
#modparam("carrierroute", "config_file", "/etc/kamailio/carrierroute.conf")
#end carrierroute
modparam("pv", "shvset", "ruta=s:$ru")
modparam("pv", "varset","in=s:IN")
modparam("pv", "varset","out=s:OUT")
#################BEGINING MAINROUTE##################
request_route {
if (!mf_process_maxfwd_header("4")) {
sl_send_reply("483","Too Many Hops");
drop;
exit;
}
##
# initial sanity checks -- too long messages
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
xlog("out header CHECK 513 baderror from_uri=$fu;($ct++)<$tU---=$var(n)>
to_uri=$tu; intid=$fU; type_call=$si; dst_ip=$ru;
carriercode=$var(z);callmode=$var(out)");
drop;
exit;
};
#
if(is_method("OPTIONS")) {
# send reply for each options request
sl_send_reply("200", "ok");
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
$var(n)=$(tU{s.substr,3,0});
$var(i)=$(ct{re.subst,/^.*11811(.*)/"\1/});
$var(t)=$(fn{re.subst,/^.*11811(.*)/"\1/});
$var(r)=$rd; ##to domain
$fU=$(fU{s.substr,14,0});
$fn=$var(t);
$tU=$var(n);
$td=$var(r);
subst('/^Contact:.*11811(.*)$/Contact: <sip:\1\2/ig');
# Remove prefixes numbers from Contact\
t_relay();
exit;
} else {
# ACK without matching transaction ... ignore and discard
$var(n)=$(tU{s.substr,3,0});
$var(i)=$(ct{re.subst,/^.*11811(.*)/"\1/});
$var(t)=$(fn{re.subst,/^.*11811(.*)/"\1/});
$var(r)=$rd; ##to domain
$fU=$(fU{s.substr,14,0});
$fn=$var(t);
$tU=$var(n);
$td=$var(r);
subst('/^Contact:.*11811(.*)$/Contact: <sip:\1\2/ig');
t_relay();
exit;
}
}
##responding to bye requests and modifying headers to match invite
if(method=="BYE") {
#Account BYE transactions
#$var(d) = $tu;
#$var(e)=$(var(d){s.substr,4,3});
setflag(2);
setflag(10);
$var(n)=$(tU{s.substr,3,0});
$var(i)=$(ct{re.subst,/^.*11811(.*)/"\1/});
$var(t)=$(fn{re.subst,/^.*11811(.*)/"\1/});
$var(r)=$rd; ##to domain
$fU=$(fU{s.substr,14,0});
$fn=$var(t);
$tU=$var(n);
$td=$var(r);
subst('/^Contact:.*11811(.*)$/Contact: <sip:\1\2/ig');
t_relay();
exit;
};
#CANCEL processing
if (method=="CANCEL") {
setflag(2);
setflag(3);
$var(n)=$(tU{s.substr,3,0});
$var(i)=$(ct{re.subst,/^.*11811(.*)/"\1/});
$var(t)=$(fn{re.subst,/^.*11811(.*)/"\1/});
$var(r)=$rd; ##to domain
$fU=$(fU{s.substr,14,0});
$fn=$var(t);
$tU=$var(n);
$td=$var(r);
subst('/^Contact:.*11811(.*)$/Contact: <sip:\1\2/ig');
t_relay();
exit;
##if (t_check_trans()) t_relay();
exit;
};
#
#
if (loose_route()) {
##
if(is_method("OPTIONS")) {
# send reply for each options request
sl_send_reply("200", "ok");
exit();
}
##
if(method=="BYE") {
#Account BYE transactions
setflag(2);
};
##CANCEL processing
if (method=="CANCEL") {
setflag(3);
$var(n)=$(tU{s.substr,3,0});
$var(i)=$(ct{re.subst,/^.*11811(.*)/"\1/});
$var(t)=$(fn{re.subst,/^.*11811(.*)/"\1/});
$var(r)=$rd; ##to domain
$fU=$(fU{s.substr,14,0});
$fn=$var(t);
$tU=$var(n);
$td=$var(r);
subst('/^Contact:.*11811(.*)$/Contact: <sip:\1\2/ig');
if (t_check_trans()) t_relay();
exit;
};
if (!t_relay()) {
sl_reply_error();
}
exit;
}
if (is_method("INVITE")) { #Procesing invites
record_route();
}
##LOGGING CALL BEFORE IS PROCESSED
xlog("before strip,< time [$Tf] > Aip= $src_ip, r-uri($ru\n");
xlog("before from_uri=$fu; to_uri=$tu; pai=<<$ct>>;intid=$fU;
type_call=$si; dst_ip=$ru; carriercode=$tu;callmode=$var(out) --$$--$ou");
#creando rutas
setflag(2);
# Account Missed calls
setflag(3);
###VARIABLES FOR MODIFICATIONS
$var(x) = $(ru);
$var(y)=$(var(x){s.substr,4,3});
$var(z)=$(var(y){s.int});
$var(t)=$(var(x){s.substr,7,0});
$var(h)=$(var(x){s.substr,0,7});
$var(o)=$(fU{s.substr,14,0});
if($(var(x){s.len}) < 3)
{
$var(z)='0'+ $var(z);
}
xlog("dsroute $var(z)fullruri($ru)\n");
strip(3);
xlog("after strip time [$Tf] method ($rm) via el code
($var(z)--varhex($var(h))-- ($var(y))\n");
xlog("after from_uri=$fu; to_uri=$tu; intid=$fU; type_call=$si; dst_ip=$ru;
carriercode=$var(z);callmode=$var(out)");
ds_select_domain ("$var(z)", "4");#carrer dynamic
###########KILLING BUGGIES#######when t_realy fails to find a route a loop
is generate then strip takes off a digit until 0(a)2.2.2.2 is left for to:
user this kills that call.#####
if ($(tU{s.len}) < 4) {
xlog("CHECK TU 1bad kILLING BUGGIES>>> $tu--$td-$tU-$tt--$dd-$dd-$du-
-<<$rd>$ru --- $oU> pai+++ <<$ct>>++ from_uri=$fu;<$tU---=$var(n)>
to_uri=$tu; }pai<$ai> id=$fU; type_call=$si; dst_ip=$ru;
carriercode=$var(z);callmode=$var(out)");
##sl_reply_error();
##sl_send_reply("513", "Message too big");
##sl_send_reply("488","Not Acceptable Here");
sl_send_reply("488","Not Acceptable Here");
#t_reset_retr();
#t_release();
##if(!t_relay()){ sl_reply_error(); drop; exit;}
#if (!t_relay()) { sl_reply_error(); break; };
# t_relay();
#setflag(2);
drop;
exit;
}; ## Endif less than 4
##############END KILLING###########
################ROUTE SELECTION###############
if($(fn{s.len}) > 10) { # IF WE CHECK FOR FROM: ROUTEID MUST BE LONGER THAN
10 DIGITS TO BE A VALID ROUTE
xlog("out header CHECK more than 10 digits BEFORE
from_uri=$fu;($ct++)<$tU---=$var(n)> to_uri=$tu; intid=$fU; type_call=$si;
dst_ip=$ru; carriercode=$var(z);callmode=$var(out)");
$var(n)=$(tU{s.substr,3,0});
$var(i)=$(ct{re.subst,/^.*00700(.*)/"\1/});
$var(t)=$(fn{re.subst,/^.*00700(.*)/"\1/});
$var(r)=$rd; ##to domain
$fU=$(fU{s.substr,14,0});
$fn=$var(t);
$tU=$var(n);
$td=$var(r);
subst('/^Contact:.*11811(.*)$/Contact: <sip:\1\2/ig'); # Remove number from
Contact
##if(!t_relay()){ sl_reply_error(); drop; exit;}
if (!t_relay()) { sl_reply_error(); break; };
# t_relay();
drop;
exit;
};
################ENDrouteselect##############################
###############AFTER LAST IF##############reply 488 ANY CALL THAT DID NOT
FOUND A ROUTE.
sl_send_reply("488","Not Acceptable Here");
drop;
exit;
}
###################END MAINROUTE#################
On My dispatcher.lst i have
1 sip:1.1.1.1:5060
2 sip:2.2.2.2:5060
3 sip:3.3.3.3:5060
3 sip:3.3.3.5:5060
...
i have tried various textops functions to replace sdp c lines with
c=IN IP4 0.0.0.0
but so far all have appended the above line to the end of sdp rather
than replaced existing c lines.
any hints on a solution?
-- juha
Hi Sir/Madam,
I want to make a call across firewall device.
I am using nf_conntrack_sip and nf_nat_sip(2.6.32) kernel modules as sip
proxy.
Connection got established from private network to public network but *no
voice exchange is happening*.
We can see RTP ports related UDP entry in conntrack -L.
How can I fix this problem?
Test Scenario:
---------------
Device LAN IP -- 10.0.0.1
Device WAN IP -- 192.168.1.1
LAN side of device
------------------
Analog phone with ATA(10.0.0.3)
Trixbox(Asterisk) - 10.0.0.2
WAN side of device
------------------
PC with SJphone - 192.168.1.2
I am trying to establish the connection from Analog phone to SJphone.
In the device iptable rule added in FORWARD chain to allow SIP packet(5060
port).
In NAT table under POSTROUTING chain MASQUERADE rule to allow packets to
traverse from LAN side to WAN side.
Thanks in advance.
Regards,
Vinay Krishna K
Hello,
We're running a Kamailio 3.3.4 system, and Kamailio is slowly using more
and more memory. Over a couple of weeks it will run out of system memory.
We tried to enable memory debugging doing the following, but it resulted in
Kamailio not responding to any SIP packets. Would anyone have advice please
on how to debug the situation?
1. In Makefile.defs set MEMDBG to 1 and recompile Kamailio.
2. In kamailio.cfg add the line:
#!define DEBUG_MEMORY 1
While this was running and Kamailio didn't respond to packets, it logged
lots of lines like this:
Jul 22 21:32:22 hostname kamailio: : <core> [mem/q_malloc.c:369]:
qm_malloc(0x4000e008, 128) called from <core>: cfg.lex: addstr(1438)
Jul 22 21:32:22 hostname kamailio: : <core> [mem/q_malloc.c:413]:
qm_malloc(0x4000e008, 128) returns address 0x40048918 frag. 0x40048900
(size=128) on 1 -th hit
Jul 22 21:32:22 hostname kamailio: : <core> [mem/q_malloc.c:369]:
qm_malloc(0x4000e008, 128) called from <core>: cfg.lex: addstr(1438)
Jul 22 21:32:22 hostname kamailio: : <core> [mem/q_malloc.c:413]:
qm_malloc(0x4000e008, 128) returns address 0x400489c8 frag. 0x400489b0
(size=128) on 1 -th hit
Thanks in advance,
--
David Cunningham, Voisonics
http://voisonics.com/
USA: +1 213 221 1092
UK: +44 (0) 20 3298 1642
Australia: +61 (0) 2 8063 9019
Hi All. Fist time poster here, long time geek.
I am trying to get Kamilio to work in the following configuration and after
days of googling and configuration attempts, I have come here for help.
Two servers, both sharing the same database. Server1, Server2. Both servers
are behind a NAT (AWS).
If I set the DNS to return both IP addresses for the domain on the A
record, everything works, all is well.
If I set the DNS to return values based on latency and the Calling Client
gets Server1's IP Address but the Receiving Client is registered to
Server2, the call fails from a timeout. I can see the attempt to go through
at the packet level and a 'non-local' socket message as well.
If the DNS returns Server2's IP Address and the Receiving Client is
registered to Server2, the call completes.
I have tried numerous variations of the various 'path' and 'registrar'
options with any joy. I tried making one of the servers the central
registrar as well. I am not entirely sure I ever set everything correctly,
but I have tried numerous combinations.
Any thoughts would be appreciated, I only ask this as I think I have
exhausted my own list of things to try.
Thanks.
- Coy Cardwell
Hi,
I need a little help with best practice scenario.
I am using freeswitch for pickups, ivrs and etc. What is best pratice,
if I would like to use freeswitch for pbx functionality and I am not
using media proxy, than I would need relay every call throught freeswitch.
Problem in this case is accouting as freeswitch change callid for
everycall and I can not do proper accouting.
thank you for help!
miha
The one that you provided as an argument to -s.
Premchandiran <premchandiran.marimuthu(a)plintron.com> wrote:
>Hi All,
>
>In modparam("rtpproxy", "rtpproxy_sock", "udp:ip:port") which ip I have
>to
>give if I use this command to run "rtpproxy -F -l ip1 -s udp:ip:port
>-d
>DBUG"
>
>
>
>Regards,
>
>
>
>Prem Chandiran M
>
>
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>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
--
Sent from my mobile, and thus lacking in the refinement one might expect from a fully fledged keyboard.
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0671
Web: http://www.evaristesys.com/, http://www.alexbalashov.com
Hi All,
In modparam("rtpproxy", "rtpproxy_sock", "udp:ip:port") which ip I have to
give if I use this command to run "rtpproxy -F -l ip1 -s udp:ip:port -d
DBUG"
Regards,
Prem Chandiran M
Hi All,
I am getting " incorrect port 0 in reply from rtp proxy" when I run kamailio
with rtp proxy. May I know how to overcome this issue.
Thanks,
Prem Chandiran M