Hi All,
I'm using kamailio 4.2.5 (compiled from source and aligned up to commit
[00a36ae07c587992d6486277ce2e9ae6c009685f]).
In order to enrich users data collected during registering phase, I
would like to store them in USRLOC Additional Attributes
through the use of 'xavp_contact' structure, but I'm having problems
storing them.
Below relevant chunks of config:
...
# ----- usrloc params -----
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", 0)
modparam("usrloc", "xavp_contact", "ulvals")
...
route[REGISTRAR] {
...
# Just an example
$xavp(ulvals=>A) = "A";
$xavp(ulvals[0]=>B) = "B";
$xavp(ulvals[0]=>C) = "C";
$xavp(ulvals[0]=>D) = "D";
...
if (!save("location"))
sl_reply_error();
exit;
}
route[LOCATION] {
...
if(!lookup("location") {
# Handle Failure
...
}
# Print USRLOC Additional Attributes
# Just an Example
$var(i) = 0;
$var(N) = $branch(count);
while($var(i)<=$var(N)) {
xlog("LOC - [$var(i)] - A [$xavp(ulvals[$var(i)]=>A)]\n");
xlog("LOC - [$var(i)] - B [$xavp(ulvals[$var(i)]=>B)]\n");
xlog("LOC - [$var(i)] - C [$xavp(ulvals[$var(i)]=>C)]\n");
xlog("LOC - [$var(i)] - D [$xavp(ulvals[$var(i)]=>D)]\n");
$var(i) = $var(i) + 1;
}
...
}
And this is the relevant chunk of syslog when a local subscriber is
found in 'location' table:
...
LOC - [0] - A [A]
LOC - [0] - B [<null>]
LOC - [0] - C [<null>]
LOC - [0] - D [D]
...
Summing up, it seems that when xavp structure is stored in memory, just
first and last elementsare inserted.
In real config I'm using more than 4 attributes and behaviour is the
same: just first and last are stored.
I've tried also with modparam("usrloc", "db_mode", 0) but the problem
remains.
Where I'm wrong in using this structure? Or it could be a bug?
Thank You in advance for your help
Luca Mularoni
Hello everybody,
My SIP vendor request me to replace FROM before sending the traffic. In
order to achieve this I use uac_replace_from.
UAC module is setup in restore_mode = auto.
In my insfrastructure I have an Asterisk and then a Kamailio that connects
to vendor via internet.
Softphone -> Asterisk -> Kamailio -> Internet -> SIP vendor
If caller ID is setup in Asterisk using CALLERID(num)=34888888888 and then
INVITE is forwarded to Kamailio, the call is established and finished
correctly but the URI in TO field in BYE request from Kamailio to Asterisk
contains garbage. In the scenario the callee hangs up the call.
Example of TO Field with garbage: 34888888888 <sip:50026896@no{soy,ns^^>
What I do see is that the number "50026896" that is part of the URI is the
same I use in:
uac_replace_from("50026896", "sip:50026896@sip.vendor.es");
Something else that I have found is that vsf field is the same in the
INVITE and in the BYE.
----------------------------------------------------------------------------------------------------------------
2015/06/23 17:48:38.552442 192.168.0.2:5060 -> 192.168.0.1:5060
BYE sip:34888888888@192.168.0.1:5060 SIP/2.0
Via: SIP/2.0/UDP
192.168.0.2;branch=z9hG4bKfb49.73c6517609cdb6f7ec00b1f40a05dbe9.0
Via: SIP/2.0/UDP
8.8.8.8.8;rport=5060;branch=z9hG4bKfcdf.3767c59c2d0e3d8ab695669845ce4cea.0
branch=z9hG4bK04boo6104o5hcso0c2a1sd0000g00.1
Call-ID: 4bf8effb45b0ae8e049366297924cbba@192.168.0.1:5060
From: <sip:28999999999@192.168.0.2;tag=k0eci3x3-CC-30
To: 34888888888 <sip:50026896@no{soy,ns^^>;tag=as041b7d84
CSeq: 1 BYE
Reason: Q.850;cause=16;text="normal call clearing"
Max-Forwards: 67
Content-Length: 0
------------------------------------------------------------------------------------------------------------------
DEBUG: uac [replace.c:525]: restore_uri(): getting 'vsf' Route param
DEBUG: uac [replace.c:533]: restore_uri(): route param is
'AAAAAAEECQkCAgsNAXBeL0NGQUsfVl02Ni44Mw--' (len=40)
DEBUG: uac [replace.c:607]: restore_uri(): decoded uris are:
new=[sip:50026896@no{soy,ns#005#007] old=[sip:34888888888@8.8.8.8]
DEBUG: uac [replace.c:525]: restore_uri(): getting 'vst' Route param
DEBUG: uac [replace.c:533]: restore_uri(): route param is
'AAAAAAQPAw8MDgsAAHZBKRVdAhoVHQ4XH1BdYWJhbnRlLmVz' (len=48)
DEBUG: uac [replace.c:607]: restore_uri(): decoded uris are: new=[
sip:28999999999@192.168.0.1] old=[sip:999999999@sip.vendor.es]
-----------------------------------------------------------------------------------------------------------------------------------
At my confiig I have route like this
onreply_route[REPLY_FROM_WS] {
if(status=~"[12][0-9][0-9]") {
xlog("L_INFO", "Manage_Reply from webrtc client {$si:$sp} for method {$rm}:
$rs");
rtpengine_manage("force trust-address replace-origin
replace-session-connection DTLS=passive ICE=remove RTP/AVP");
route(NATMANAGE);
}
}
This route successfully handling replies 180 183 and 200 and then (after
natmanage route) resend to mediaserver.
When callee client reject call it send 480 ot 486 message that not
resended by kamailio nowhere.
First of all I thought that 480 and 486 replies are failure replies but at
log I see its at onreply route.
So Ok . I added this to onreply_route
if (status=~"48[06]"){
xlog("L_INFO", "Manage_Reply from webrtc client {$si:$sp} for method {$rm}:
$rs");
rtpengine_manage("force trust-address replace-origin
replace-session-connection DTLS=passive ICE=remove RTP/AVP");
route(NATMANAGE);
}
But message just going through natmanage route and goes nowhere
My NATMANAGE route is
xlog("L_INFO","NATMANAGE reply {$rm}");
if (is_reply()) {
if(isbflagset(FLB_NATB)) {
add_contact_alias();
}
xlog("L_INFO","reply {$rm}");
}
I see at my log only first NATMANAGE xlog... no more...
thnks for answer
Hi,
Lasting night i was doing some tests and identified a strange behavior from
dialog module. I am using Kamailio v4.3.0 rev. c6aa95.
I basically wanted to identify if an incoming sequential ACK (from caller
for an answered call) or a BYE (from callee who wants to hangup the call)
belong to an existing dialog.
First I tried to use dialog profiles as they were already enabled in my
kamailio.cfg for every call. Calling the function "is_in_profile" after
loose_route in WITHINDLG route, does not works for ACK, but works for BYE.
Then I added dialog flags to initial INVITE (using function "dlg_setflag")
and check them for ACK and BYE after loose_route (using "dlg_isflagset"
method), i have the same behavior. They worked/matched only for BYE, not
for ACK.
Lastly I set dialog variables (e.g. dlg_var(my_call) = "1") in initial
INVITE and checked for them for ACK and BYE requests after loose_route.
Only they worked perfectly, i.e. i can match them for both incoming ACK and
BYE requests.
Is this correct and expected behavior? Why dialog profile and flags do not
match for a dialog in unconfirmed state (i.e. ACK from caller after
successful call answer)? They only work for confirmed dialogs (e.g. BYE
from callee).On the other hand, dialog variables seems to work everywhere
(i.e. all sequential requests).
Thank you.
Hi All
I am having a sip client, I am using GNU tls for transport layer security.
I am using Kamailio (TLS enabled) to test all the functionalities.
I did registration over TLS. It was fine.
I tried to make call.
I was able to send INVITE.
Kamaiio trying to connect to called party (which is again my sip endpoint).
That time certificate verification failed.
*Error log*
* 8(14180) ERROR: tls [tls_server.c:1193]: tls_read_f(): TLS
write:error:14090086:SSL routines:ssl3_get_server_certificate:certificate
verify failed 8(14180) ERROR: <core> [tcp_read.c:1326]: tcp_read_req():
ERROR: tcp_read_req: error reading 8(14180) DEBUG: <core>
[tcp_read.c:1481]: release_tcpconn(): releasing con 0x7f962f6b6db8, state
-2, fd=5, id=3*
How do I debug and fix this issue.
Can somebody help me out.
Thanks
Austin
Hello,
Is there an API that can notify Kamailio of media inactivity in the RTPProxy?
The documentation has something called "timeout_socket" . I don't understand how to use it though. Any help will be greatly appreciated.
Thanks
Sharath
Hello.
When I installed kamailio I add users then I can make a call.But When I install asterisk I found the asterisk take over the kamailio and I can register users.But When I make a call.It shows me can not establish the call.How can find the problem?Any logs?Or tools?
Thanks,
zhangkai
As I read at README to Nathelper it may not work with usrloc table, Is it
write?
now I use NAT traversal module and Websocket module to keepalive
mechanisms, that uses UDP or WS.
with UDP it is wery simple method - OPTIONS replies.
With WebSocket module keepalive mechanism uses thomething else. Not a SIP
methods, I see at TCPDUMP packets that marks with modparam("websocket",
"ping_application_data", "WebSockets rock")
I need to handle replies of keepaliwe mechanism. How I may handle replies
form this mechanism?
2015-06-30 18:37 GMT+03:00 Yuriy Gorlichenko <ovoshlook(a)gmail.com>:
> thnks for response. I thing - nathelper is what I need. If I resolve issue
> above (why it not work with setbflag(7) ) I thing this questions will be
> closed.
>
> P.S may be it help - my kamailio version is
>
> version: kamailio 4.4.0-dev1 (x86_64/linux) 1dbd53
> 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: 1dbd53
> compiled on 06:24:22 Jun 23 2015 with gcc 4.8.4
>
> 2015-06-30 18:18 GMT+03:00 Camille Oudot <camille.oudot(a)orange.com>:
>
>> Le Tue, 30 Jun 2015 15:49:26 +0300,
>> Yuriy Gorlichenko <ovoshlook(a)gmail.com> a écrit :
>>
>> > 4) I tried to do it with tcpops
>> >
>> > Only for ws and tcp (WS is use TCP as i know)
>> > tcp_keepalive_enable("15", "5", "15");
>> >
>> > same result...
>>
>> Hi Yuriy,
>>
>> the tcp_keepalive_enable() function will send keepalive packets at TCP
>> level, not at application level (SIP OPTIONS). It can be used to check
>> if the remote peer connection is still valid, and close the TCP
>> connection on the server side if it is no more valid. If you enable the
>> TCP keepalives, you should see these packets using tcpdump or wireshark.
>>
>> Along with "handle_lost_tcp" option on usrloc, this can be used to
>> maintain the usrloc table as consistent as possible.
>>
>> --
>> Camille
>>
>
>
Hi,
I am using Kamailio(4.2.5) as my SIP proxy also enabled authentication.
Added two users xyz_0 and xyz_1 to the kamailio database.
While Registration I am getting 401 Unauthorized as shown below
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 192.168.1.107:48601;branch=z9hG4bK858339335
From: <sip:xyz_0@192.168.1.107>;tag=251958751
To: <sip:xyz_0@192.168.1.107 <sip%3Axyz(a)192.168.1.107>
>;tag=ca5a1db24813f1937965921e320b98e4.6232
Call-ID: 1808202998(a)192.168.1.107
CSeq: 2 REGISTER
WWW-Authenticate: Digest realm="192.168.1.107",
nonce="VZJ3hlWSdlr0HS/jGQljEKmY20ZrO0Qz"
Server: kamailio (4.2.5 (x86_64/linux))
Content-Length: 0
The WWW-Authenticate header is not complete here, May I know the reason for
this ?
I am expecting algorithm, domain and other stuff in the WWW-Authenticate
header.
I am not able to proceed further , Please do needful.
Thanks
hello,
is there REST API for kamailio for basic functions like subscribers,
dispatcher, blacklist/whitelist, ACL, dial plan table, ... ?
thank you
--
---------------------------------------
Marek Cervenka
=======================================