Hello,
We're testing kamailio 4.3.4 with two kamailio's communicating with each other. One of them is a gateway with rtpengine at the carrier side, the other is a basic sip router.
When calling a destination and cancelling the INVITE a 487 is received from the carrier and directly ACK'd by the first kamailio and in turn is forwarded to the second.
But the 487 response received by the 2nd kamailio doesn't have a Via header which results in kamailio printing the error: receive_msg(): no via found in reply.
Any ideas why the forwarded 487 doesn't contain a Via header and how to fix this?
Note: IP's are changed.
Carrier: 10.0.0.1
Kamailio 1: 10.14.0.1
Kamailio 2: 10.14.0.2
U 10.0.0.1:5060 -> 10.14.0.1:5060
SIP/2.0 487 Request Cancelled.
Via: SIP/2.0/UDP 10.14.0.1;branch=z9hG4bK8e28.642c68037d059634308d4be8fe3f0cdc.0.
From: "+31612345678" <sip:+31612345678@10.14.0.3:5060>;tag=109ac722.
To: <sip:003112345678@10.14.0.3:5060>;tag=sbcsipuas_1_C22196_20160314080307791_b59sb10.
Call-ID: 78100MjY3OGExZmMyODU2MzAyMzM5ODA3MmNhMDdlMzg0MzU.
Contact: <sip:10.0.0.1:5060>.
CSeq: 2 INVITE.
Server: sbc_5.
Content-Length: 0.
.
#
U 10.14.0.1:5060 -> 10.0.0.1:5060
ACK sip:003112345678@10.0.0.1:5060 SIP/2.0.
Via: SIP/2.0/UDP 10.14.0.1;branch=z9hG4bK8e28.642c68037d059634308d4be8fe3f0cdc.0.
Max-Forwards: 67.
To: <sip:003112345678@10.14.0.3:5060>;tag=sbcsipuas_1_C22196_20160314080307791_b59sb10.
From: "+31612345678"<sip:+31612345678@10.14.0.3:5060>;tag=109ac722.
Call-ID: 78100MjY3OGExZmMyODU2MzAyMzM5ODA3MmNhMDdlMzg0MzU.
CSeq: 2 ACK.
Content-Length: 0.
.
#
U 10.14.0.1:5060 -> 10.14.0.2:5060
SIP/2.0 487 Request Cancelled.
From: "+31612345678" <sip:+31612345678@10.14.0.3:5060>;tag=109ac722.
To: <sip:003112345678@10.14.0.3:5060>;tag=sbcsipuas_1_C22196_20160314080307791_b59sb10.
Call-ID: 78100MjY3OGExZmMyODU2MzAyMzM5ODA3MmNhMDdlMzg0MzU.
Contact: <sip:10.0.0.1:5060>.
CSeq: 2 INVITE.
Server: sbc_5.
Content-Length: 0.
Hello,
I plan to add some rate limiting in the Kamailio. I'm already using Pike to rate limit based on the source IP.
But in this case, i want to do the rate limiting per customer(regardless of the source IP), I can identify the customer based on a custom
header in the INVITE, idea is to limit the customer to 'x' number of requests per second.
Nitesh
Hi,
I have two SIP servers, *A* and *B*, connected each other though a OPENVPN
tunnel. The server *B* needs to t_relay() every SIP message containing the
method MESSAGE to the server *A* but these messages never reach destination.
I have tested the tunnel connectivity and works fine. I wrote a Perl script
(located in *B*) that sends SIP MESSAGES to Kamailio (located in *A*) trying
to figure out what is happening but these messages are received by *A* and
processed correctly but when *B* does the same from Kamailio, it is never
received.
Here is the route part of kamailio.cfg in *B*:
Observation: ($rU == "1004") result is *true*
*
if(is_method("MESSAGE"))
{
if($rU == "1004")
{
xlog("L_INFO","En 1004");
rewritehost("10.8.0.1");
if (!t_relay())
xlog("L_INFO","MIO Error en t_relay");
t_reply("200", "Ok");
xlog("L_INFO","MIO despues rewrite");
exit;
}
.....*
The perl script that WORKS:
*$msg = 'MESSAGE sip:1004@192.168.1.2:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2
From: "2002" <sip:2002@192.168.1.2 <sip%3A2002(a)192.168.1.2>>;tag=1837944796
To: <sip:1004@192.168.1.2 <sip%3A1004(a)192.168.1.2>>
Call-ID: 19722852989(a)192.168.1.2
CSeq: 15773 MESSAGE
Contact: <sip:2002@**PublicIP-protected**:5060>
Max-Forwards: 29
User-Agent: DBL
Content-Type: text/plain
Content-Length: 34
+595981[protected]
hello from kamailio
';
use IO::Socket;
my $sock = IO::Socket::INET->new( Proto=>'udp',
PeerHost=>'192.168.2.102',
PeerPort=>'5060');
print "Sending msg $msg\n";
$sock->send($msg) or die "error sending $!\n";
*Please help!
Thanks in advance.
Carlos.
Hi
I am using the topos module when bridging 2 networks with Kamailio.
The INVITE/200OK part of the transaction is working fine (i.e. the Contact
on both sides matches correctly the corresponding network).
However when the ACK is sent into Kamailio, instead of realising the next
hop is myself and skipping it, Kamailio is sending the ACK directly to
itself as a packet, causing the call setup to break.
Does anyone have any advice for this situation?
Hi,
About 3 weeks ago i upgraded one of my production server with latest stable
kamailio version 4.2.1-fad00a. Now i am getting a lot of complaints about
missing CDR events in ACC table. I observe following problems,
1. There are only BYE records in acc table, no record for INVITE or ACK.
2. In kamailio logs when ACK is received against 200 OK response for
INVITE, i see following errors,
--
ERROR: <core> [parser/parse_from.c:113]: parse_from_uri(): failed to parse
>From uri
ERROR: pv [pv_core.c:434]: pv_get_xto_attr(): cannot parse From URI
NOTICE: <script>: [udp:<null>@1.0.0.127:5060]: Call from 'you(a)kamailio.org'
to 'you(a)kamailio.org' has been hanged up by '<null>' at '1419364717.255484'
--
Of course all these errors are bogus, I have checked all headers in ACK
(not just FROM header), they all seem perfectly fine and valid.
3. Then the dialog times out,
--
WARNING: dialog [dlg_handlers.c:1440]: dlg_ontimeout(): timeout for dlg
with CallID '6D8BD23CAC65AE3C1DE1D0B531F87B8CFEAA9CB9' and tags
'1D3ECD34F5731AB845BA3064AC95BB2D'
'7f55e81e0630-100007f-13c4-6009-2440a4-5fa31570-2440a4'
--
4. Any further sequential requests complain about "unable to find dialog",
e.g.
--
NOTICE: <script>: Sequencial 'BYE' request received from caller
ERROR: uac [replace.c:591]: restore_uri(): new URI [] shorter than old URI [
sip:00xxxxxxxxxx@sip.domain.com]
WARNING: dialog [dlg_handlers.c:1174]: dlg_onroute(): unable to find dialog
for BYE with route param '5ae1.d595' [7845:22877]
--
5. However the acc record for BYE is written to db and log file,
--
NOTICE: acc [acc.c:318]: acc_log_request(): ACC: transaction answered:
timestamp=1419364760;method=BYE;from_tag=7f55e81e0630-100007f-13c4-6009-2440a4-5fa31570-2440a4;to_tag=1D3ECD34F5731AB845BA3064AC95BB2D;call_id=6D8BD23CAC65AE3C1DE1D0B531F87B8CFEAA9CB9;code=200;reason=OK;src_user=00xxxxxxxxxx;src_domain=
sip.domain.com
;src_ip=xx.xx.xx.xx;dst_ouser=+1xxxxxxxxxx;dst_user=1xxxxxxxxxx;dst_domain=yy.yy.yy.yy
--
The same config was working fine with older version 4.2.0-97cab8. The
kamailio config i am using is pretty much standard,
--
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3
#!define FLT_DLG 4
...
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 1)
modparam("acc", "log_flag", FLT_ACC)
modparam("acc", "log_missed_flag", FLT_ACCMISSED)
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
# log to db
modparam("acc", "db_flag", FLT_ACC)
modparam("acc", "db_missed_flag", FLT_ACCMISSED)
modparam("acc", "db_url", "DBURL")
...
request_route {
# per request initial checks
route(REQINIT);
# NAT detection
route(NATDETECT);
# handle requests within SIP dialogs
route(WITHINDLG);
# CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans()) {
t_relay();
};
exit;
};
#### only initial requests (no To tag) ####
t_check_trans();
....
# account only INVITEs
if (is_method("INVITE")) {
setflag(FLT_DLG); # create dialog
setflag(FLT_ACC); # do accounting
setflag(FLT_ACCFAILED); # ... even if the transaction fails
$avp(dlg_timeout) = 60;
dlg_manage();
....
}
--
Any ideas why its happening? Since it is 3 weeks old so may be problem has
already been spotted and fixed by someone else. Otherwise let me know how
can i provide more info to help fix this issue.
Thank you.
Hi
I am novice to kamailio , I have installed kamailio-4.2.0 and SIREMIS. I
have add and registered two IP phones with kamailio these phone able to
call each other.
How can i make outbound call with that I am using a asterisk server as PSTN
Gateway. i am not famalier with kamailio script.
Regards
Sharad Tyagi
SparkTG info Pvt Ltd
Hi, Daniel.
Seems I found how to fix PRACK handling.
It works for me.
please lock at https://github.com/kamailio/kamailio/pull/1097
Thank you.
--
Best regards,
Sergey Basov e-mail: sergey.v.basov(a)gmail.com
2017-04-27 13:04 GMT+03:00 Sergey Basov <sergey.v.basov(a)gmail.com>:
> Yes, you are right.
>
> But now before 200 OK there empty field b_contact.
>
> May be you does not populate it from contact in 183 Progress?
>
> I see that this field is not empty only after 200 OK with a Contact field.
> --
> Best regards,
> Sergey Basov e-mail: sergey.v.basov(a)gmail.com
>
>
> 2017-04-27 12:37 GMT+03:00 Daniel-Constantin Mierla <miconda(a)gmail.com>:
>> Hello,
>>
>> thanks for troubleshooting further. I haven't got the time to look at
>> the source code, but I expect that the b-leg attributes (contact, record
>> routes) to be set on 200ok for dialog (topos_d). I think for PRACK, the
>> routing information should be stored and taken from transaction (topos_t).
>>
>> Cheers,
>> Daniel
>>
>> On 27.04.17 11:29, Sergey Basov wrote:
>>> Hi, Daniel.
>>>
>>> I just done one more test topos with re-invite which comes from caller
>>> to callee, same direction as PRACK.
>>>
>>> And I found that, in case of prack, b_contact field is empty...
>>>
>>> Please find attached debug=3 part of re-invite message.
>>>
>>> Hope it helps.
>>> --
>>> Best regards,
>>> Sergey Basov e-mail: sergey.v.basov(a)gmail.com
>>>
>>>
>>> 2017-04-27 10:30 GMT+03:00 Sergey Basov <sergey.v.basov(a)gmail.com>:
>>>> Hi, Daniel
>>>>
>>>> Please look at attached part of debug=3 while receiving and parsing PRACK.
>>>> At line 208 seems rr module does not find correct part of record_route
>>>> which in DB consists from 2 parts.
>>>>
>>>> So at line 219 and later uac module cannot restore uris.
>>>>
>>>> Thank you.
>>>> --
>>>> Best regards,
>>>> Sergey Basov e-mail: sergey.v.basov(a)gmail.com
>>>>
>>>>
>>>> 2017-04-26 17:08 GMT+03:00 Sergey Basov <sergey.v.basov(a)gmail.com>:
>>>>> Thanks for workaround.
>>>>>
>>>>> But I will wait for you solution )
>>>>>
>>>>> I ready for testing )
>>>>>
>>>>> Thank you Daniel for your work!
>>>>>
>>>>> --
>>>>> Best regards,
>>>>> Sergey Basov e-mail: sergey.v.basov(a)gmail.com
>>>>>
>>>>>
>>>>> 2017-04-26 16:57 GMT+03:00 Daniel-Constantin Mierla <miconda(a)gmail.com>:
>>>>>> Hello,
>>>>>>
>>>>>>
>>>>>> On 26.04.17 14:53, Sergey Basov wrote:
>>>>>>> Hi All.
>>>>>>>
>>>>>>> I have just try to test topos with GW which requires PRACK.
>>>>>>>
>>>>>>> As you can see UA at packet 21 send PRACK to topos contact, but after
>>>>>>> topos, on other kamailio side in PRACK request line present not
>>>>>>> kontact but record-route header.
>>>>>>>
>>>>>>> Can you fix it?
>>>>>>>
>>>>>>>
>>>>>> probably needs to look into the code. If you need a quick workaround,
>>>>>> try to remove Supported header from INVITE so the callee should no
>>>>>> longer Require 100rel.
>>>>>>
>>>>>> Cheers,
>>>>>> Daniel
>>>>>>
>>>>>> --
>>>>>> Daniel-Constantin Mierla
>>>>>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>>>>>> Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
>>>>>> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Kamailio (SER) - Users Mailing List
>>>>>> sr-users(a)lists.kamailio.org
>>>>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>> --
>> Daniel-Constantin Mierla
>> www.twitter.com/miconda -- www.linkedin.com/in/miconda
>> Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com
>> Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
>>
Hi guys,
I'm trying to access dialog vars in failure_route with no success. Dialog
exists but vars are null and I'can modify them either. Is there any
restriction?
if ($dlg_var(v1) == 0){
$dlg_var(v1) = "1";
if (is_known_dlg()){
xlog("L_NOTICE", "negative_reply $ci $T_rpl($si)
$dlg_var(v2)");
$dlg_var(v2) = $T_rpl($si);
}
}
Log
Apr 26 12:36:26 drwsip02 /usr/local/sbin/kamailio[27223]: NOTICE: <script>:
negative_reply 6daf5e8d-f47972c1(a)172.31.4.21 * <null>*
Hi list,
I compiled db_unixodbc and sqlops to connect with oracle db. I have a
function that has dml inside. Because of this I can't just execute 'select
pkg.function(a, b) from dual'.
I'm trying with BEGIN / END. The row is inserted but always are log errors:
Apr 29 02:41:57 dwsipm03 /usr/local/sbin/kamailio[7868]: ERROR: db_unixodbc
[res.c:60]: db_unixodbc_get_columns(): no columns returned from the query
Apr 29 02:41:57 dwsipm03 /usr/local/sbin/kamailio[7868]: ERROR: db_unixodbc
[res.c:261]: db_unixodbc_convert_result(): getting column names failed
Apr 29 02:41:57 dwsipm03 /usr/local/sbin/kamailio[7868]: ERROR: db_unixodbc
[dbase.c:211]: db_unixodbc_store_result(): failed to convert result
Apr 29 02:41:57 dwsipm03 /usr/local/sbin/kamailio[7868]: ERROR: <core>
[db_query.c:188]: db_do_raw_query(): error while storing result
Apr 29 02:41:57 dwsipm03 /usr/local/sbin/kamailio[7868]: ERROR: sqlops
[sql_api.c:265]: sql_do_query(): cannot do the query [DECLARE ret CURSOR]
My query:
sql_query("cb","DECLARE ret CURSOR; BEGIN ret :=
pkg_partitioning.insert(True,'1'); END;");
I tried with other functions and no matter what type returns the oracle
function; always logs errors. It's like unixodbc is waiting for a result
with rows.
Any hint?
Thanks in advance,
Diego
Hi list,
I use current git master.
When I reload a htable using "kamcmd htable.reload htable1", the "ctl handler" process leaks 384 bytes of pkg memory
If I use a direct mysql connection without db_cluster, the is no memory leak
modparam("db_cluster", "connection", "con1=>mysql://user:pass@ip.addr/database")
modparam("db_cluster", "connection", "con2=>mysql://user:pass@ip.addr2/database")
modparam("db_cluster", "cluster", "cls1=>con1=9s9s;con2=8s8s")
modparam("htable", "db_url", "cluster://cls1")
# modparam("htable", "db_url", "mysql://user:pass@ip.addr/database"
modparam("htable", "htable", "htable1=>size=8;autoexpire=0;dbtable=htable1;")
16(10429) ALERT: qm_status: 6513. N address=0x7f4e65e01720 frag=0x7f4e65e016e8 size=128 used=1
16(10429) ALERT: qm_status: alloc'd from db_cluster: dbcl_api.c: db_cluster_init(294)
16(10429) ALERT: qm_status: start check=f0f0f0f0, end check= c0c0c0c0, abcdefed
16(10429) ALERT: qm_status: 6514. N address=0x7f4e65e01808 frag=0x7f4e65e017d0 size=128 used=1
16(10429) ALERT: qm_status: alloc'd from core: db.c: db_do_init2(298)
16(10429) ALERT: qm_status: start check=f0f0f0f0, end check= c0c0c0c0, abcdefed
16(10429) ALERT: qm_status: 6515. N address=0x7f4e65e018f0 frag=0x7f4e65e018b8 size=128 used=1
16(10429) ALERT: qm_status: alloc'd from core: db.c: db_do_init2(298)
16(10429) ALERT: qm_status: start check=f0f0f0f0, end check= c0c0c0c0, abcdefed
Regards,
Kristian Høgh
Uni-tel A/S