Hi all,
I see this discussion about mediaproxy and it's the same what happens to me
http://opensips.org/pipermail/users/2010-August/013997.html
Indeed in my kamailio.cfg, I call twice end_media_session on "bye" and
on "cancel"
route[CANCEL] {
if (is_method("CANCEL"))
{
end_media_session();
if (t_check_trans())
t_relay();
exit;
}
}
and
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")) {
end_media_session();
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
$avp(s:can_uri) = $ru;
}
if ( is_method("ACK") ) {
# ACK is forwarded statelessy
route(NATMANAGE);
}
route(RELAY);
} else {
...
I thought both are necessary, so can I make something like this at
route[WITHINDLG] ?
...
if (is_method("BYE|CANCEL")) {
end_media_session();
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
$avp(s:can_uri) = $ru;
}
...
and then remove end_media_session at route[CANCEL] ?
Regards.
Hi,
Not sure if this is a bug or config but getting this error message:
insert_subst_lump_after(): ERROR: insert_new_lump_after: out of memory
Any ideas?
Keith
Hello,
i'm encountering in some strange behaviours while working with S-CSCF
version: kamailio 4.1.0 (x86_64/linux) 350d2e
Making some tests, in particular with Ro interface for online
charging, the script execution doesn't follow normal flow (checking it
by adding some xlog call).
Looking at the following code script, i have made some modifications:
1) Modify the P-Asserted-Identity so as to add angle brackets to the value.
2) Add user=phone parameter to uri if it doesn't exists
3) Enabled RO interface for accounting
The amazing thing is that if kamailio is executed with this script the
whole flow terminates without any notice just after record_route()
call. Making some attempts, removing record_route() call flow
continues until Ro_CCR method, where same behaviour appears (call flow
is unpredictable terminated and no diameter CCR request is made)
Which kind of operations can lead to this strange behaviour
If is needed i can attach some logs in debug level mode
Thanks in advance
######################################################################
# Originating, Intial Requests
######################################################################
route[orig]
{
xlog("L_DBG","Enter orig route\n");
# modifica di P-Asserted-Identity
subst('/P\-Asserted\-Identity:[
]*([\+0-9a-z@\.\-\:]*)/P-Asserted-Identity: <\1>\r\n/ig');
if ($ru =~ ".*;user=phone.*" ){
xlog("L_DBG","Parameter user=phone already exists");
} else {
xlog("L_DBG","Adding parameter user=phone");
$ru = $ru + ";user=phone";
}
xlog("L_DBG","$rm $ru");
set_dlg_profile("orig");
# we MAYBE need something like this to check if a user is barred
# if (S_originating_barred()){
# sl_send_reply("403","Forbidden - Originating Public Identity barred");
# exit;
# }
xlog("L_DBG","Checking AVP mo custom\n");
if (is_method("INVITE|SUBSCRIBE")) {
xlog("L_DBG","Adding AVP mo custom parameter\n");
$avp(RR_CUSTOM_USER_AVP)="mo";
xlog("L_DBG","call record_route\n");
record_route();
}
#!ifdef WITH_RO
# before we allow call - lets check credit
xlog("L_DBG","Checking if RO must be called\n");
if (is_method("INVITE")) {
xlog("L_DBG","Sending initial CCR Request for call\n");
Ro_CCR("CHARGING_CCR_REPLY", "orig", "SCUR", "", "30");
}
#!else
xlog("L_DBG","calling route[finalize_orig]");
route(Finalize_Orig);
#!endif
}
--
Flavio Battimo
flavio.battimo(a)gmail.com
fbattimo(a)meetecho.com
skype: flaviobattimo
Hello,
Thanks in advanced for the help. I am almost new with kamailio and still
struggling through silly problems so please forgive me if the solution is so
obvious.
I have a network like
Xlitle -- Kamailio -- GW
The GW is more or less out of my reach for changing the behaivour.
As devices I have xlitle
Kamailio is on version 4.0.2
I've changed only few things from the default config file. Add mysql
support, auth, userlocdb, pstngw.
For this part, gw routing , I've defined gw ip and port inside the PSTN
definition like:
#!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"
pstn.gw_port = "" desc "PSTN GW Port"
iskratel.gw_ip = "10.XX.XX.XX"
iskratel.gw_port = "5060"
#!endif
I route the calls with:
route(ISKRATEL);
And defined a routing function
route[ISKRATEL] {
#!ifdef WITH_PSTN
# check if ISKRATEL GW IP is defined
if (strempty($sel(cfg_get.iskratel.gw_ip))) {
xlog("SCRIPT: PSTN rotuing enabled but iskratel.gw_ip not
defined\n");
return;
}
# only local users allowed to call
if(from_uri!=myself) {
sl_send_reply("403", "Not Allowed");
exit;
}
if (strempty($sel(cfg_get.iskratel.gw_port))) {
$ru = "sip:" + $rU + "@" + $sel(cfg_get.iskratel.gw_ip);
} else {
$ru = "sip:" + $rU + "@" + $sel(cfg_get.iskratel.gw_ip) +
":"
+ $sel(cfg_get.iskratel.gw_port);
}
# Add profix to ISKRATEL: A99901
subst_uri('/^sip:(.*)/sip:A99901\1/i'); # add A99901
route(RELAY);
exit;
#!endif
return;
}
I can see that the code goes all the way to the route(relay) but all I can
see is the 500 I'm terribly sorry, server error occurred (7/SL) and a second
response 500 I'm terribly sorry, server error occurred (7/TM)
I've tried defining the IP as the given pstn.gw_ip and route(pstn) without
changing anything on the pst default routing but the response of the server
is the same.
I cannot see any special error on the logs.
I have the exact same config for this part, in another test server and the
calls go to the gw without reporting any error.
I'll appreciate any help from you! Thanks in advanced for your time
Helena
Hello,
I'm trying to understand how the dispatcher module works and how the timers in the TM module influence the behavior.
My architecture looks like this:
UA1 ---- SBC1 ---- Kamailio ----- SBC2 ---- FreeSWITCH App Server(x2)
What I got so far:
1) UA1 sends an INVITE to SBC1, which bridges the call between the UA1 and Kamailio
2) INVITE is received by Kamailio.
3) Kamailio looks in its dispatcher table to dispatch the INVITE to its destination
4) Kamailio rewrites the $du value to that of the SBC2
5) Kamailio rewrites the request-uri and sends the INVITE to the destination in $du.
6) SBC2 is a FreeSWITCH instance which bridges the call (does not answer). It only responds back with a 100 TRYING
7) SBC2 tries to contact the endpoint (FS App Server 1) in the request-uri, but the destination does not respond because it is unavailable.
8) Kamailio keeps waiting for a final reply.
9) The fr_inv_timer is set to 5000 on startup
10) Once the timer hits, Kamailio executes the route set in t_failure_route
11) The failure route looks like this:
if(t_is_expired()) { ... }
if (t_is_canceled()) { ... }
if(t_check_status("500") || t_branch_timeout() || !t_branch_replied()) {
....
}
12) Kamailio enters the third if block in which the next domain is selected and the $du is rewritten again to that of SBC2
13) A new INVITE is generated and sent to its destination (FS App Server 2) through SBC2. Nothing is sent back to SBC1 yet, because Kamailio handles the failover here.
Is this correct?
Are there any other timers which are fired which I missed, or does the fr_inv_timer have nothing to do with this?
If Kamailio is supposed to load balance between FS App Server 1 and 2 using the Round-Robin algorithm, does it in case of an unreachable first destination take the next destination in the route set?
Regards,
Grant
Hi,
We run Kamailio 3.2.3 (FLAVOUR=ser) on an embedded ARM platform in near-
default configuration.
In a duration test, we observe that at a certain moment Kamailio seems to
start ignoring all (re-)register messages, and eventually expires the
existing registrations.
We have not been able to reproduce the issue using debug-level logging
(-dddd). Info-level logging (-ddd) does reproduce the error, but does not
produce any error messages.
Configuration: ser-basic.cfg, with the following changes:
port=5060
alias=testnet
Command line:
ser -m 4 -f /etc/ser/ser-basic.cfg -n3 -l udp:eth0
Load:
Bursts of 8 (Re-)REGISTER messages that are repeated every 85 seconds. The
specified expiration time is 120 seconds.
Bursts of 9 (Re-)INVITE messages that are repeated every 45 seconds.
Note:
With this load it takes roughly 1 hour for the error to occur. Using a more
standard 3600 second expiration time Kamailio still stalls, it just takes
longer.
Does anyone have any idea how to tackle this issue?
Kind regards,
Michiel Veldkamp
Hello Guys,
I am using Kamailio 4.1.0. I am trying to get Kamailio to rotate the cdr
log through command kamcmd flatstore.rotate but it keeps sending log to
the renamed files,
I use the following parameter (i tried to set flush to 1 and 0, same
result, i have also tried in debug and normal mode)
#!define WITH_ACCFILE
# ----- acc params -----
/* what special events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
/* 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;src_ip=$si;"
"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
/* enhanced DB accounting */
modparam("acc", "db_flag", FLT_ACC)
modparam("acc", "db_missed_flag", FLT_ACCMISSED)
#!ifdef WITH_ACCFILE
modparam("acc", "db_url", "flatstore:/var/log/kamailio")
modparam("db_flatstore", "flush", 1)
modparam("acc", "cdr_enable", 1)
#modparam("acc", "cdr_flag", 3)
modparam("acc", "db_extra","ds=$DLG_lifetime")
modparam("acc", "log_extra",
"src_user=$fU;src_domain=$fd;src_ip=$si;"
"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;"
"duration=$DLG_lifetime")
modparam("acc", "db_extra",
"src_user=$fU;src_domain=$fd;src_ip=$si;"
"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;"
"duration=$avp(i:256)")
#!endif
Setup:
jitsi --> kamailio <-----> pstn.gw
jitsi is registered using TCP
SIP Trunk between kamailio and pstn.gw is using TCP
Initial invite from jitsi to kamailio is sent using TCP but invite sent
from kamailio to pstn.gw is being sent with UDP.
How can I configure kamailio to send invite to pstn.gw with TCP?
Thank You