Hi,
Is there a way to set a dialog variable when a BYE is received so that it
can be written in a CDR?
I tried as follows but it didn't work:
if (loose_route()) {
..
if(is_method("BYE")) {
if(is_direction("downstream")) {
#Call disconnected by caller
$dlg_var(dr) = 700;
} else {
#Call disconnected by callee
$dlg_var(dr) = 701;
}
xlog("Setting disconnect reason to $dlg_var(dr)\n");
}
..
exit;
}
The xlog statement prints:
ERROR: <script>: Setting disconnect reason to <null>
The doc states:
This pseudo-variable will be available only for subsequential requests after
doing loose_route().
Thanks,
Mickael
Hello,
I'm very disappointed because of the following behaviour:
if ($tu=~"^sip:0[1-9]{9}") {
[.]
In that case, Kamailio returns TRUE because the instructions in
the block are executed.
}
if ($rU=~"^33" || $rU=~"^0033" || $rU=~"^0[1-9]{9}" || $rU=~"^\+33" ||
$tu=~"^sip:33" || $tu=~"^sip:0033" || $tu=~"^sip:0[1-9]{9}" ||
$tu=~"^sip:\+33" ) {
[.]
In that case, Kamailio should return FALSE because the instructions in the
block are not executed.
}
Am I missed something regarding 'OR' ?
Regards,
Igor.
Hello. We use 2 kamailio server 4.3 master brancher for load balansing
cluster. We have some problems with this deplooiment
fist of all we have REgstering issue: Witth one server all works fine (we
have some endpoints with same creditians) all endpoints reinging well. But
at 2 servers we hawe problem with this- call ringing only at one endpoint.
We use Database for USRLOC module
modparam("usrloc", "db_url", DBURL)
modparam("usrloc", "db_mode", 3)
modparam("usrloc", "use_domain", MULTIDOMAIN)
As i think it mean al connections to servers ives at database. We have one
database for 2 servers and this is means it only one table LOCATION for its.
The second problen id that when loadbalanser sends bye to kamailio from the
outside- bye is not recieves to endpoint. It say that no transaction with
this CallID. I think it is because transaction goues through another
kamailio and kamiaio that recieves BYE does not know about it transaction.
So my first qestion- Does anybody have some information about loafd
balansiong between kamailios?
And second question - how to resolve issue with LOCATION table?
Thanks
I'm currently using Kamailio built from master@e59db79 and have been following
the recent threads about the dialog module as I'm moving toward adding dialog
support for presence and CDRs in my setup.
However, I seem to have come across an issue where dlg_setflag() does nothing,
while setflag() works properly with the following (trimmed) script. So for
now, I issue setflag(FLT_DIALOG) for INVITE rather than
dlg_setflag(FLT_DIALOG).
Is there something I'm missing about dlg_setflag()?
#!define FLT_DIALOG 4
request_route {
route(REQINIT);
route(NATDETECT);
if(is_method("CANCEL")) {
if(t_check_trans()) {
route(RELAY);
}
exit;
}
route(WITHINDLG);
if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();
route(AUTH);
remove_hf("Route");
if(is_method("INVITE|SUBSCRIBE"))
record_route();
if(is_method("INVITE")) {
setflag(FLT_ACC);
# Enable dialog support (dlg_setflag not working)
#dlg_setflag(FLT_DIALOG);
setflag(FLT_DIALOG);
}
route(SIPOUT);
route(PRESENCE);
route(REGISTRAR);
if($rU==$null) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
route(PSTN);
route(LOCATION);
route(RELAY);
}
route[WITHINDLG] {
if(!has_totag()) return;
if(loose_route()) {
route(DLGURI);
if(is_method("BYE")) {
setflag(FLT_ACC);
setflag(FLT_ACCFAILED);
# Testing dialog flag
xlog("L_INFO", "Completed $dlg(from_uri) to
$dlg(to_uri) - $DLG_lifetime duration\n");
} else if(is_method("ACK")) {
route(NATMANAGE);
} else if(is_method("NOTIFY")) {
record_route();
}
route(RELAY);
exit;
}
if(is_method("SUBSCRIBE") && uri==myself) {
route(PRESENCE);
exit;
}
if(is_method("ACK")) {
if(t_check_trans()) {
route(RELAY);
exit;
} else {
exit;
}
}
sl_send_reply("404","Not Found");
exit;
}
--
Anthony - https://messinet.com/ - https://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
I user rtimer module :
loadmodule "rtimer.so"
modparam("rtimer", "timer", "name=p_route;interval=1;mode=1;")
modparam("rtimer", "exec", "timer=p_route;route=P_ROUTE")
application will coredump in sometimes, and core file in below, what's the
reason?
Program terminated with signal 11, Segmentation fault.
#0 0x00000000005fda98 in timer_list_expire (t=1043586690,
h=0x7f9ed45ac9b0, slow_l=0x7f9ed45adc80, slow_mark=2316) at timer.c:877
877 timer.c: No such file or directory.
in timer.c
(gdb) bt full
#0 0x00000000005fda98 in timer_list_expire (t=1043586690,
h=0x7f9ed45ac9b0, slow_l=0x7f9ed45adc80, slow_mark=2316) at timer.c:877
tl = 0x7f9ed47f7e98
ret = 0
#1 0x00000000005fc686 in timer_handler () at timer.c:953
saved_ticks = 1043586690
run_slow_timer = 0
i = 268
__FUNCTION__ = "timer_handler"
#2 0x00000000005fdd4d in timer_main () at timer.c:992
No locals.
#3 0x00000000004aa571 in main_loop () at main.c:1700
i = 12
pid = 0
si = 0x0
si_desc = "udp receiver child=11
sock=10.1.*.*:5160\000\000\b\000\000\000\000\000\000\000\000\060S\324\236\177\000\000\060=#z\001\000\000\000(\205V\324\236\177\000\000\060=#z\377\177\000\000\214\216N\000\000\000\000\000\037t\372D\000\000\000\000(\205V\324\236\177\000\000\220@
#z\377\177\000\000\000\000\000\000\001\000\000"
nrprocs = 12
__FUNCTION__ = "main_loop"
#4 0x00000000004af166 in main (argc=11, argv=0x7fff7a234098) at main.c:2561
cfg_stream = 0x1da75e0
c = -1
r = 0
tmp = 0x7fff7a234681 ""
tmp_len = 32767
port = 2049130512
proto = 32673
options = 0x706ec0
":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
ret = -1
seed = 220012340
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0xb
p = 0x0
__FUNCTION__ = "main"
Hi,
This may be a bit out of focus topic for this forum but i am posting it
here anyway with hope that some guru would shed some light on it and point
me to right direction.
The problem is that i want to establish video call between a webrtc and a
sip client using kamailio (for signalling) and RTPEngine (for media relay).
Both signalling and the audio stream seems to work perfectly fine The
remote video on webrtc client side (i.e. video stream from sip client)
takes about 20-30 seconds to establish but once it starts it works fine.
However, the remote video on sip client side (i.e. video stream from webrtc
client) starts almost immediately (within 3-5 seconds) but it gets stuck
after 1 or 2 seconds, then it goes blank after about 30 seconds.
After a long discussion with sip client developer, we now understand the
fact that sip client sends a request for so called key-frame, which is
ignored by webrtc client. This request is sent through both RTCP stream and
SIP INFO message.
The SIP INFO message seems to be pointless as media is internally managed
by chrome/firefox and these browsers don't give us such sophisticated
access and control over media streams. Please let me know if this
assumption is wrong.
For the RTCP stream based request (RTCP-FIR), i only see "Invalid RTCP
packet type" error message in RTPEngine logs (not sure if it drops this
packet or relay it anyway).
Does anyone has any idea on how can we either,
1. Force WebRTC client (running on Chrome / Firefox) to honor SIP INFO
message and issue a key-frame in RTP video stream in response to this SIP
request?
OR
2. Force RTPEngine to accept RTCP-FIR and issue key-frame in RTP video
stream on webrtc client's behalf?
If there is any other solution to this, please feel free to share.
Thank you.
Hi All
I seem to be experiencing an intermittent fault with the utils http_query() method. We are implementing a routing and white list component that is accessed via a REST api, however i have observed several occasions where this is logged:
Jan 30 16:04:17 vs-kam-prod02 /usr/local/sbin/kamailio[13184]: ERROR: utils [functions.c:149]: http_query(): failed to perform curl (28)
The indicated error number (28) seems to suggest a timeout is occurring with curl, however examining a capture of network traffic when this happens shows that a http request is not sent from the server to the destination at all, usually attempting a second call results in everything working correctly.
As stated its intermittent in its nature and so I cannot reliably trigger this issue, other than through sheer repetition, so any ideas as to what could be causing this issue would be gratefully received,
Hi All
We are trying to use the async module to to delay sending a bye on from one
end of the call to the other.
We are using async_route(routename, seconds) to delay the WITHINDLG route.
The idea is that in the future we want to be able to have our billing min
duration enforced (though currently we are having issues with the dialog
module that we are discussing in another thread).
After running this on our deploy servers, the delays before sending on the
byes get longer and longer, and then kamailio goes down. Then the receive
udp buffer fills up.
We tried it with both 4 and 400 async workers, and it made no difference.
I am including a screen capture of the servers stats when this happens
taken from voip monitor.
Here are the relevant parts of the config:
...
loadmodule "async.so"
...
modparam("async", "workers", ASYNC_THREADS)
...
request_route {
...
route(DELAYED_BYE_STATIC);
...
route[DELAYED_BYE_STATIC] {
xlog("L_DEBUG","route DELAYED_BYE_STATIC");
#!ifdef WITH_DELAYED_BYE_STATIC
if (is_method("BYE")) {
xlog("L_DEBUG","route DELAYED_BYE_STATIC, from self \n");
#if (from_uri == myself) {
if ((allow_trusted() || allow_source_address()) && from_uri == myself) {
xlog("L_DEBUG","route DELAYED_BYE_STATIC, Bye detected, from self \n");
send_reply("200", "OK");
xlog("L_DEBUG","route DELAYED_BYE_STATIC, sent 200 about to sleep \n");
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
if (has_totag()) {
xlog("L_DEBUG","route DELAYED_BYE_STATIC, sleeping to WITHINDLG_DELAYED
\n");
async_route("WITHINDLG_DELAYED", MIN_DURATION);
} else {
xlog("L_DEBUG","route DELAYED_BYE_STATIC, sleeping to WITHINDLG \n");
async_route("WITHINDLG", MIN_DURATION);
}
xlog("L_DEBUG","route DELAYED_BYE_STATIC, slept\n");
exit;
}
}
#!endif
return;
}
...
route[WITHINDLG_DELAYED] {
xlog("L_DEBUG", "route WITHINDLG_DELAYED: triggered \n");
$avp(was_delayed) = 1;
route(WITHINDLG);
}
...
route[WITHINDLG] {
xlog("L_DEBUG", "route WITHINDLG: will -- DLG triggered, request method:
$rm \n");
#!ifdef WITH_DISPATCHER
if(is_method("BYE|CANCEL")) {
xlog("L_DEBUG","route WITHINDLG: cancel or bye detected, request method:
$rm \n");
#!ifdef WITH_DISPATCHER_LOAD_AWARE
xlog("L_DEBUG","route WITHINDLG: running ds_load_update, request method:
$rm \n");
ds_load_update();
#dlg_get ("$ci","$ft","$tt");
#dlg_bye ("all");
#!endif
}
#!endif
if (has_totag() || $avp(was_delayed) == 1) {
xlog("L_DEBUG", "route WITHINDLG: will -- DLG has totag or was_delayed:
$avp(was_delayed) \n");
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
xlog("L_DEBUG", "route WITHINDLG: will -- DLG has loose route \n");
route(DLGURI);
if (is_method("BYE")) {
xlog("L_DEBUG","route WITHINDLG: BYE detected");
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
xlog("L_DEBUG","route WITHINDLG: ACC flag set");
}
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();
}
xlog("L_DEBUG", "route WITHINDLG: will -- DLG RELAY 1\n");
route(RELAY);
} else {
xlog("L_DEBUG", "route WITHINDLG: will -- DLG else \n");
if (is_method("SUBSCRIBE") && uri == myself) {
# in-dialog subscribe requests
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
xlog("L_DEBUG", "route WITHINDLG: will -- DLG is ack \n");
if ( t_check_trans() ) {
xlog("L_DEBUG", "route WITHINDLG: will -- DLG t_check_trans \n");
# no loose-route, but stateful ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream server
xlog("L_DEBUG", "route WITHINDLG: will -- DLG RELAY 2\n");
route(RELAY);
exit;
} else {
# ACK without matching transaction ... ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
}
...
Does any one know if this is a bug or a leak with in the async module, or
perhaps something I am doing in my config?
Thanks in advance for an assistance you can offer me.
All the best.
Will Ferrer
Switchsoft
Hello I use dipatcher algorithm 8 that works with weight. I added 2
Asterisks and try to call its with my kam.We use 4.3 version.
Tthis config select needed dst from database with my scenario.
if(!ds_select_dst("$var(setid)", "8"))
$var(setid)- is variable for setting setid that i get from database with my
own scenario. IT does not matter.
When running asterisk with weight 90 - all calls goes through it. When I
starting asterisk with weight 10 -calls going through asterisk 90. When I
shut down asterisk with weight 90 -calls goes through asterisk 10? but when
i start asterisk weight 90 all calls goes through sterisk 10 until I shut
down it.
root@Kamailio:~# kamailio -v
version: kamailio 4.3.0-dev3 (x86_64/linux) 8cdbe7
flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
F_MALLOC, DBG_F_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, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 8cdbe7
compiled on 01:17:56 Jan 21 2015 with gcc 4.8.2
id setid destination flags priority attrs
1 2 sip:34.25.123.45:506000 0 weight=10
2 2 sip:10.0.1.6:506000 0weight=90
modparam("dispatcher", "db_url",DBURL)
modparam("dispatcher", "table_name", "dispatcher")
modparam("dispatcher", "setid_col", "setid")
modparam("dispatcher", "destination_col", "destination")
modparam("dispatcher", "force_dst", 1)
modparam("dispatcher", "flags", 3)
modparam("dispatcher", "dst_avp", "$avp(i:271)")
modparam("dispatcher", "grp_avp", "$avp(i:272)")
modparam("dispatcher", "cnt_avp", "$avp(i:273)")
modparam("dispatcher", "ds_ping_from", "sip:proxy@10.0.1.1")
modparam("dispatcher", "ds_ping_interval",15)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_reply_codes",
"class=2;code=403;code=404;code=484;class=3")
modparam("tm", "reparse_on_dns_failover", 0)
Thanks
Hello. I try to use NDB_REDIS with remote REDIS DB and can not to connect
because remote DB use password, but Kamailio module have no any variable or
attr of modparam that implenets password for DB.
How I can connect to my REDIS?