Hi,
I am using Kamailio as my ACC, Dispatcher, far end nat and presence
server in front of a farm of asterisk boxes.
Most calls are being properly added into my acc table and using a join
between the INVITEs, CANCELs, and BYEs I am able to get what seems like
accurate call detail records.
The trouble is that every so often a BYE does not make it back to my
server. In my simulation this morning, I simply unplugged ( electric )
the two phones that were having a pleasant conversation. Now I have
asterisk that thinks the call is still running and I have Kamailio which
has no ending 'BYE' message. For the most part this is not a big deal,
but when I can a cellular phone in European countries, my provider
thinks I am still talking. At 30 cents a minute, that's a lot.
Here are some snippets from my code :
loadmodule("dialog.so")
loadmodule("acc.so")
loadmodule("sst.so")
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
# There is also a parameter for the DB, but I can't give you my password
modparam("acc", "db_url", "some://valid:url@to/db")
# Note $avp(i:10) always ends up being 14400 ( less than the value on
the help page )
modparam("dialog", "timeout_avp", "$avp(i:10)")
modparam("sst", "timeout_avp", "$avp(i:10)")
modparam("sst", "sst_flag", 5)
Relevant snippets from my routing :
if ( has_totag()) {
if ( loose_route() ) {
if ( is_method("CANCEL|BYE") {
setflag(1);
setflag(3);
}
}
# Routing of INVITEs
setflag(2)
if ( !is_method("ACK"))
{
setflag(1);
}
setflag(4);
setflag(5);
For invites, I have a onreply_route and failure_route which I use only
for RTP Stuff.
On reply route checks if rtpproxy is needed, if it is it is activated.
failure_route checks if rtpproxy was activated and if it was deactives
it. The only other code in the failure route is this :
if ( t_was_cancelled() ){
exit ;
}
So, the problem is, when phones do not send BYE, what do I do? I need
resources freed up from Asterisk, RTP Proxy, and Kamailio Dialog, and I
need the call to be canceled with my provider and I need for my ACC to
recieve some indication as to when the call ended. Obviously it won't be
exact to the second, but I kind of thought that the SIP Session Timers
would notice the phone was gone and would generate a BYE or something?
What do I do?
Thanks,
David
Im trying to implement Keep alive to maintain communication with nated
clients. Enabling it in the terminals
We eliminate OPTIONS natpings setbflag(7);
We want to eliminate setbflag(6); because when this is setted openser send 4
bytes packages to maintain the communication with nated clients. But if we
do that we have problems using mediaproxy.
Can you help me with this issue?
I hope to have explained correctly.
Ariadne L. Ramos Solís
Depto. Ingeniería
Aprovisionamiento y Señalización VoIP
Galaxy Communications Corp.
Tel. 2000117
e-mail <mailto:aramos@clarocom.com> aramos(a)clarocom.com
P BE CARBON CONSCIOUS. PLEASE CONSIDER OUR ENVIRONMENT BEFORE PRINTING THIS
E-MAIL
Hi
I need help on NAT with Kamailio...
My Network Details are as follows...
SIP Phone
Registration ADSL
Router
Kamailio Asterisk
172.18.100.73/255.255.0.0
192.168.1.1/255.255.255.0
192.168.1.68/255.255.255.0
192.168.1.70/255.255.255.0
172.18.100.72/255.255.0.0
GW: 172.18.100.72 (Virtual IP
172.18.100.68) (Virtual IP 172.18.100.70)
Router Type: AirLink 101 802.11 Token Ring
Where Virtual IP 172.18.100.68 and 172.18.100.70 set virtually on ADSL
Router.. and set routing on it..
So when I ping 172.18.100.70 it will go through 192.168.1.1
I am able to call, receive means able to receive OK, INVITE and REGISTER
method of kamailio ... but When i try to Hangup call, it can't hangup at
both side..
I have to manually cut phone at the other end..
I have not set any rule on Router.
*Scenario...*
1] I have two user. 1212(a)domain.com [172.18.100.73] and
2121(a)domain.com[172.18.100.72] and register successfully
2] Call from 1212(a)domain.com [172.18.100.73] to 2121(a)domain.com[172.18.100.72]..
3] Call is connected successfully
4] While hangup from 1212(a)domain.com [172.18.100.73] it will take time and
at the other end, I have to manually hangup call..
Please help me out..
--
Regards,
Chandrakant Solanki
Hi all,
we're using kamailio 1.5.1 with modules htable and perl to generate
CDRs. Using htable we save some variables which are dumped to file using
the perl module at the end of the call.
We did a small stress test with 5 calls in parallel (each call about 20
seconds) and we got after about 6 hours the following error:
ERROR:core:pv_sprintf: pv_sprintf: Memory exhausted!
No CDRs were written anymore, the perl method was not called. Everything
else seems to run fine.
After stopping the stress test doing one simple call with a softphone
worked and a CDR had been written (without restarting kamailio!).
Perhaps the perl script is buggy?
Any ideas how to fix this are greatly appreciated. We don't think
extending the PKG_MEM_POOL_SIZE will solve the problem. This is
currently 4MB and should be enough for 5 concurrent calls!?!
Thanks,
Christian Koch
The perl script:
use OpenSER;
use OpenSER::Constants;
use IO::Socket;
sub write_cdr {
my $m = shift;
#my $v = $m->getVersion();
#my $t = $m->getType();
my $index = $m->pseudoVar("\$ci");
my $endTimeStamp = $m->pseudoVar("\$Ts");
my $startTimeStamp = $endTimeStamp -
$m->pseudoVar("\$DLG_lifetime");
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($startTimeStamp);
my $startTime = sprintf("%02d.%02d.%4d;%02d:%02d:%02d", $mday,
$mon+1, $year+1900, $hour, $min, $sec);
my $fileDate = sprintf("%02d%02d%02d", $mday, $mon+1, $year%100);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($endTimeStamp);
my $endTime = sprintf("%02d.%02d.%4d;%02d:%02d:%02d", $mday,
$mon+1, $year+1900, $hour, $min, $sec);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime($m->pseudoVar("\$sht(a=>".$index."::invtrytime)"));
my $InvTryingTime = sprintf("%02d.%02d.%4d;%02d:%02d:%02d",
$mday, $mon+1, $year+1900, $hour, $min, $sec);
$ReplyReason=$m->pseudoVar("\$rr");
$ReplyReason=~ s/;/_/g;
$FromDisplayName =
$m->pseudoVar("\$sht(a=>".$index."::fromdplname)");
$FromDisplayName=~ s/;/_/g;
$ToUri = $m->pseudoVar("\$sht(a=>".$index."::touri)");
$ToUri=~s/;/_/g;
$FromUri = $m->pseudoVar("\$sht(a=>".$index."::fromuri)");
$FromUri=~s/;/_/g;
$UserAgent = $m->pseudoVar("\$sht(a=>".$index."::useragent)");
$UserAgent=~s/;/_/g;
my $CDR = $startTime.";"; # 1 + 2
$CDR .= $endTime.";"; # 3 + 4
$CDR .= $m->pseudoVar("\$DLG_lifetime").";"; # 5
$CDR .= $index.";"; #6 CallID
$CDR .= $m->pseudoVar("\$sht(a=>".$index."::srcip)").";"; #
source-IP of INVITE
$CDR .= $m->pseudoVar("\$si").";"; # source-IP of BYE/CANCEL
$CDR .= $FromDisplayName.";"; # from display-name INVITE
$CDR .= $InvTryingTime.";"; # Alerting time
$CDR .= ($startTimeStamp -
$m->pseudoVar("\$sht(a=>".$index."::invtrytime)")).";"; #Alerting period
$CDR .= $m->pseudoVar("\$DLG_count").";"; # current amount of calls
$CDR .= $ToUri.";"; # ToUri from Invite
$CDR .= $FromUri.";"; # FromUri from Invite
$CDR .= $UserAgent.";"; # UserAgent from Invite
$CDR .= $m->pseudoVar("\$rm").";"; # Method (INVITE,BYE,CANCEL)
$CDR .= $m->pseudoVar("\$rs").";"; # SIP reply status
$CDR .= $ReplyReason.";"; #SIP Reply reason
open(MYOUTFILE,
">>/home/sys/log/kamailio".$fileDate.".cdr.".$m->pseudoVar("\$pp"));
print MYOUTFILE $CDR."\n";
close(MYOUTFILE);
#delete(%sourceIp->{$index});
#delete(%fromDisplayName->{$index});
#delete(%InviteTryingTimestamp->{$index});
#delete(%ToUri->{$index});
#delete(%FromUri->{$index});
#delete(%UserAgent->{$index});
return 1;
}
1;
Hi gentlemen,
Is there any upgrade guide to go from 1.4.3-notls to 1.5.1-notls?
If not, is there something I need to keep in mind? some major change on the
cfg or DB schema?
Thanks in advance!
Uriel
Hi
I'm using Kamailio v1.5.1 and, I do not know why, the avp value is disappearing. Let me show you what is happening:
#IT DOESN'T WORK
avp_db_query("select count(1) as c from group_endpoint where num_ip='$si'","$avp(i:105)");
log(1,"Before AVP_PRINT\n");
avp_print();
log(1,"After AVP_PRINT\n");
if( avp_check("$avp(i:105)","eq/i:0") )
#Debug
Jun 10 09:57:48 [4326] DBG:avpops:ops_dbquery_avps: query [select count(1) as c from group_endpoint where num_ip='192.168.0.194']
Jun 10 09:57:48 [4326] DBG:core:db_new_result: allocate 28 bytes for result set at 0x8180ea8
Jun 10 09:57:48 [4326] DBG:db_mysql:db_mysql_get_columns: 1 columns returned from the query
Jun 10 09:57:48 [4326] DBG:core:db_allocate_columns: allocate 4 bytes for result names at 0x8180ed0
Jun 10 09:57:48 [4326] DBG:core:db_allocate_columns: allocate 4 bytes for result types at 0x8180ee0
Jun 10 09:57:48 [4326] DBG:db_mysql:db_mysql_get_columns: allocate 8 bytes for RES_NAMES[0] at 0x8180ef0
Jun 10 09:57:48 [4326] DBG:db_mysql:db_mysql_get_columns: RES_NAMES(0x8180ef0)[0]=[c]
Jun 10 09:57:48 [4326] DBG:db_mysql:db_mysql_get_columns: use DB_BIGINT result type
Jun 10 09:57:48 [4326] DBG:core:db_allocate_rows: allocate 8 bytes for rows at 0x8180f00
Jun 10 09:57:48 [4326] DBG:core:db_allocate_row: allocate 20 bytes for row values at 0x8180f10
Jun 10 09:57:48 [4326] DBG:core:db_str2val: converting BIGINT [0]
Jun 10 09:57:48 [4326] DBG:avpops:db_query_avp: rows [1]
Jun 10 09:57:48 [4326] DBG:avpops:db_query_avp: row [0]
Jun 10 09:57:48 [4326] DBG:avpops:db_close_query: close avp query
Jun 10 09:57:48 [4326] DBG:core:db_free_columns: freeing 1 columns
Jun 10 09:57:48 [4326] DBG:core:db_free_columns: freeing RES_NAMES[0] at 0x8180ef0
Jun 10 09:57:48 [4326] DBG:core:db_free_columns: freeing result names at 0x8180ed0
Jun 10 09:57:48 [4326] DBG:core:db_free_columns: freeing result types at 0x8180ee0
Jun 10 09:57:48 [4326] DBG:core:db_free_rows: freeing 1 rows
Jun 10 09:57:48 [4326] DBG:core:db_free_row: freeing row values at 0x8180f10
Jun 10 09:57:48 [4326] DBG:core:db_free_rows: freeing rows at 0x8180f00
Jun 10 09:57:48 [4326] DBG:core:db_free_result: freeing result set at 0x8180ea8
Before AVP_PRINT
After AVP_PRINT
Jun 10 09:57:48 [4326] DBG:avpops:ops_check_avp: no src avp found
No src avp found! There isn't any avp. The avp value returned by mysql server is quickly dropped. So, to avoid this, I changed the query's result into a string. I'm using the mysql concat function.
#IT WORKS!
avp_db_query("select concat('',count(1)) from group_endpoint where num_ip='$si'","$avp(s:105)");
log(1,"Before AVP_PRINT\n");
avp_print();
log(1,"After AVP_PRINT\n");
if( avp_check("$avp(s:105)","eq/s:0/g") )
#Debug
Jun 10 10:01:37 [4378] DBG:avpops:ops_dbquery_avps: query [select concat('',count(1)) from group_endpoint where num_ip='192.168.0.194']
Jun 10 10:01:37 [4378] DBG:core:db_new_result: allocate 28 bytes for result set at 0x8180ea8
Jun 10 10:01:37 [4378] DBG:db_mysql:db_mysql_get_columns: 1 columns returned from the query
Jun 10 10:01:37 [4378] DBG:core:db_allocate_columns: allocate 4 bytes for result names at 0x8180ed0
Jun 10 10:01:37 [4378] DBG:core:db_allocate_columns: allocate 4 bytes for result types at 0x8180ee0
Jun 10 10:01:37 [4378] DBG:db_mysql:db_mysql_get_columns: allocate 8 bytes for RES_NAMES[0] at 0x8180ef0
Jun 10 10:01:37 [4378] DBG:db_mysql:db_mysql_get_columns: RES_NAMES(0x8180ef0)[0]=[concat('',count(1))]
Jun 10 10:01:37 [4378] DBG:db_mysql:db_mysql_get_columns: use DB_STRING result type
Jun 10 10:01:37 [4378] DBG:core:db_allocate_rows: allocate 8 bytes for rows at 0x8180f00
Jun 10 10:01:37 [4378] DBG:core:db_allocate_row: allocate 20 bytes for row values at 0x8180f10
Jun 10 10:01:37 [4378] DBG:core:db_str2val: converting STRING [0]
Jun 10 10:01:37 [4378] DBG:avpops:db_query_avp: rows [1]
Jun 10 10:01:37 [4378] DBG:avpops:db_query_avp: row [0]
Jun 10 10:01:37 [4378] DBG:avpops:db_close_query: close avp query
Jun 10 10:01:37 [4378] DBG:core:db_free_columns: freeing 1 columns
Jun 10 10:01:37 [4378] DBG:core:db_free_columns: freeing RES_NAMES[0] at 0x8180ef0
Jun 10 10:01:37 [4378] DBG:core:db_free_columns: freeing result names at 0x8180ed0
Jun 10 10:01:37 [4378] DBG:core:db_free_columns: freeing result types at 0x8180ee0
Jun 10 10:01:37 [4378] DBG:core:db_free_rows: freeing 1 rows
Jun 10 10:01:37 [4378] DBG:core:db_free_row: freeing row values at 0x8180f10
Jun 10 10:01:37 [4378] DBG:core:db_free_rows: freeing rows at 0x8180f00
Jun 10 10:01:37 [4378] DBG:core:db_free_result: freeing result set at 0x8180ea8
Before AVP_PRINT
Jun 10 10:01:37 [4378] INFO:avpops:ops_print_avp: p=0xb5d3ef08, flags=0x0003
Jun 10 10:01:37 [4378] INFO:avpops:ops_print_avp: name=<105>
Jun 10 10:01:37 [4378] INFO:avpops:ops_print_avp: val_str=<0 / 1>
After AVP_PRINT
Jun 10 10:01:37 [4378] DBG:avpops:ops_check_avp: check <0> against <0> as str /16777217
The avp value is there now! Why is it happening? Am I doing something wrong? I think the answer is a perfect 'yes'. Thanks for any advice.
Bruno
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
>* How are made updates ?
*
Can you add a bit more details? Updates from one kamailio version to
another are done just like in any other project. Check the release notes
and the upgrade informations and then act appropriately. :-)
Hi, Henning.
My query is how one module is updated. The maintener for very modules
are same in both projects (Kamailio and Opensips).
But, don't have information if he work for one or two.
If have bugs or new implementations/features in one module, this is
updated in both plataforms ?
In example of LCR module, maintener is same in both, but in Kamailio
is more active than the Opensips. And status is "stable" in developer
version of two plataforms.
thanks
Hi,
I would like to understand the maintenance of modules of Opensips and
Kamailio.
The developer is same for two plataforms ?
How are made updates ?
The modules are compatible between plataforms ? If I get one default module
(eg. lcr/carrierroute) of kamailio and put in opensips, this work ?
Have one list of developer/mainteiner of each modules ?
Thanks
Hello
I'm getting these errors using Kamailio 1.5.1:
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]:
ERROR:db_mysql:db_mysql_submit_query: driver error on query: Commands out of
sync; you can't run this command now
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]: ERROR:core:db_do_update:
error while submitting query
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]:
ERROR:presence:update_db_subs: updating in database
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]:
ERROR:db_mysql:db_mysql_submit_query: driver error on query: Commands out of
sync; you can't run this command now
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]: ERROR:core:db_do_query:
error while submitting query
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]:
ERROR:presence:msg_watchers_clean: querying database for expired messages
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]:
ERROR:db_mysql:db_mysql_submit_query: driver error on query: Commands out of
sync; you can't run this command now
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]: ERROR:core:db_do_query:
error while submitting query
Jun 4 12:25:10 sandbox /usr/sbin/kamailio[5060]:
ERROR:presence:msg_presentity_clean: querying database for expired messages
I haven't seen anything similar in the issue tracker ? Is it a new bug ? How
can I track it down ?
Regards,
Pascal