Hi list! :-)
I'm a total newbie in Kamailio. Trying to study)
Sorry for lots of text, I'm simply don't know how to explain my questions
shorter :-D
I want to configure Kamailio as dispatcher, registrar and NAT traversal in
front of FS farm.
I've managed to set up Kamailio and Fswitches.
Now I need to handle "special cases" with confs, REFER transfers etc
Giovanni Maruzzelli once presented solution for this, with following logic:
-------------------------------------------------------------------------------------------------------
1) Kamailio by default distribute calls to various FSs - dispatch or
load_balance
2) Each time Kamailio sends a call to a FS, it writes down which
destination "number" is going to which FS
server and from which UserID
3) if another call comes for the same (or related) destination, or is
originated from the same UserID
then Kamailio sends the call to that same FS server, bypassing default
distribution algorithm
-------------------------------------------------------------------------------------------------------
Sounds good and helpful, but I'm stuck :-(
*Can someone please share an example or point me how and in what form
should I write down call info,and how can I control it (delete on BYE or
CANCEL)?*
Actually there are 2 questions
It seems to me that recordings can be made using HTABLEs but here's a
problem:
=====================================================================================
=============================================================================================
1) PROBLEM WITH WRITING TO HTABLE ON ATT TRANSFER
After the dispatcher sets $du - I write an htable entry
$sht(fsdest=>$fU:$rU) = $du;
Existing entries are removed on catching 'BYE' for normal clearing, and
with failure_route for all failures.
BYE logic is:
IN WITHINNDLG route
if (has_totag()) {
if (loose_route()) {
if (is_method("BYE")) {
if (sht_match_name("fsdest", "eq", "$fU:$rU")) {
$sht(fsdest=>$fU:$rU) = $null; //BYE A->B
} else {
$sht(fsdest=>$rU:$fU) = $null; //BYE A<-B
}
}
handle_ruri_alias();
route(RELAY);
}
}
Another entry is setting up if blind transfer is made.
If INVITE is coming from one of FSs, and have 'Referred-By' field.
IN DIALOG route:
if (is_present_hf("Referred-By")) {
$sht(fsdest=>$fU:$rU) = $si;
}
For now it's working. Entries are written and deleted properly.
*Problem with Attended transfer.*
1) A --> B = htable entry A:B=xxxx
2) A --> C = htable entry A:C=xxxx(checked and set same FS addr because $fU
is present (If only it's worked as it should))
3) Att transfer (Refer $rU B, referred-by - A. Refer-To - C) B --> C = all
related entries deleted from table over BYE logic.
4) No entry B --> C (no INVITE was sent, bridged by REFER)
So, logic for check active calls in htable is broken now, because we don't
have entry B-->C
*How can I handle writing to htable in Attended transfer case?*
If another Invite will come FROM or TO B or C = there will be no htable
entry.
I'm not sure this is even a correct way. Surely missing something.
=============================================================================================
=============================================================================================
2) PROBLEM WITH IDENTIFYING TABLE ENTRIES
Anyway, the main problem is with identifying those htables to set proper
$du.
If INVITE is coming TO FSs I need to check if caller ID ($fU) or dest ($rU)
is present in htables.
Form I need to write to hash must be like $fU:$rU
Entry must be unique or it will be:
1) rewrited anytime a new invite is going to the same dest.
2) deleted anytime BYE or failure will come
eg:
If $sht(fsdest=>$rU) = $dd
1) 1000 --> 3200 = htable entry 3200 = xxxx
2) 1005 --> 3200 = htable entry rewriten to the same 3200 = xxxx
When 1000 or 1005 leaving conf, it sends BYE and removes entry.
So, next call to 3200 may be sent to the wrong FS.
Ok, we have a unique entry ($fU:$rU). Checking for active destination:
if (sht_match_name("fsdest", "re", ":$rU")) {}
If there's an htable with $rU in key - we got a match.
Now we need to assign a value from htable to $du.
But, I don't know how to get the name of this entry.
There's always different $fU: (or $rU if we check for the same caller ID
($fU)).
eg:
1000 --> 3200 = htbale 1000 --> 3200
New call 1005 --> 3200
Check sht_match name ":3200" - got match
We need to set: $du = $sht(fsdest=>$fU:$rU)
But it will be $sht(fsdest=>1005:3200) and we don't have this entry.
We need (fsdest=>1003:3200) But i don't see any way to get needed $fU.
*Is there any way to search or identify these tables?*
=============================================================================================
=============================================================================================
Can someone help me with this, please? :-)
Or maybe there is a better way to do this?
*My kamailio.cfg routing block in pastebin, if
neededhttps://pastebin.com/1PZ0QSDW <https://pastebin.com/1PZ0QSDW>*
Thank you!
Regards, Tim
Hello,
to sync better on time, Kamailio World 2021 online edition is starting
in about 2 hours from now (12:50 UTC Welcome and 13:00UTC the first
session) - the agenda is available at:
* https://kamailioworld.com/k09-online/
In short: participation is free, no registration is needed. The sessions
are live streamed to YouTube KamailioWorld channel:
* https://www.youtube.com/c/KamailioWorld/
YouTube chat next to the live stream can be used for addressing
questions to speakers -- we will monitor it and ask the speaker inside
the video conferencing room.
For community interaction via text chatting, you can join the Matrix
room #kamailio:matrix.kamailio.dev :
* https://riot.kamailio.dev/#/room/#kamailio:matrix.kamailio.dev
Questions for speakers can also be addressed in this chat room.
If anyone wants to participate in the live video conferencing room, the
URL is:
* https://meet.kamailioworld.com/live
Just note that we may have to limit the number of participants in the
live session in order to ensure proper streaming quality.
See you soon online!
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Hello,
We have the following setup on Kamailio 5.3.7 (x86_64/linux) and I am
trying to use topos module on Kamailio2 in order to hide our topology but,
mostly to reduce the invite size as most of the times we have fragmentation
on invites from Kamailio1 as Kamailio1 it adds 2 record-routes and two via
as it handles TLS from one side and UDP on the other side and we have found
no wat to avoid all this info even with topos enabled on Kamailio1 there is
no change on this.
UA (OverTLS) -> Kamailio1 (Over UDP)-> Kamailio2 (Over UDP)-> Provider
UA :50.50.50.50:5065 (TLS)
Kamailio1: 170.170.170.210:5061 (TLS),170.170.170.210:5060 (UDP)
Kamailio2: 170.170.170.170:5060 (UDP)
Provider: 200.200.200.193:5060 (UDP)
Kamailio1 does not run topos.
Kamailio2 does run topos and rr with bellow settings:
# ------ topos ------
modparam("topos", "db_url", DBURL)
modparam("topos", "mask_callid", 0)
modparam("topos", "sanity_checks", 0)
modparam("topos", "branch_expire", 130) # 3 Min
modparam("topos", "dialog_expire", 10800) # 3 Hours
modparam("topos", "clean_interval", 60)
modparam("topos", "event_mode", 3)
modparam("topos", "contact_host", " sbc181.myserver.com")
# ----- rr params -----
# set next param to 1 to add value to ;lr param (helps with some UAs)
modparam("rr", "enable_full_lr", 0)
modparam("rr", "ignore_sips", 1)
# 0 = do not append from tag to the RR, 0 = append from tag to the RR
modparam("rr", "append_fromtag", 0)
# dual RR 0 = No, 1 = Yes when needed 2 = Always
modparam("rr", "enable_double_rr", 0)
The problem is that on the invite from Kamailio2 to provider, topos adds
only VIA kai new contact. No record route at all. So the provider sends
multiple 200 ok SDPs to wrong IPs. If I disable topos module on kamailio2
everything works fine except that we have huge invite as another VIA and
another record route is added having now three of each and fragmentation is
present.
*Invite from Kamailio1 to Kamailio2*
-------------------------------------------------
2021/09/08 21:41:57.698823 170.170.170.210:5060 -> 170.170.170.181:5060
INVITE sip:1234567890@sip.myserver.com:5060 SIP/2.0
Record-Route:
<sip:170.170.170.210;r2=on;lr;ftag=1b973153-4034-4480-89d3-c47b411bd81e;vsf=AAAAAFpUAgEBBwEAAXABAG5BR0EAQUBCZXJ2b2ljZS5ldQ--;vst=AAAAAAoMDgsBBQcGAgIAdENbQG4AFxNUXAUaGQYXWAocY2UuZXU-;did=ff2.96a;nat=yes>
Record-Route: <sip:170.170.170.210:5061
;transport=tls;r2=on;lr;ftag=1b973153-4034-4480-89d3-c47b411bd81e;vsf=AAAAAFpUAgEBBwEAAXABAG5BR0EAQUBCZXJ2b2ljZS5ldQ--;vst=AAAAAAoMDgsBBQcGAgIAdENbQG4AFxNUXAUaGQYXWAocY2UuZXU-;did=ff2.96a;nat=yes>
Via: SIP/2.0/UDP
170.170.170.210;branch=z9hG4bKd703.e095cdba1da1a4b1599119c9135b7838.0;i=8eb41
Via: SIP/2.0/TLS 50.50.50.50:5065
;received=50.50.50.50;rport=31090;branch=z9hG4bKPj9196e5f9-977c-4a53-a4c0-c0ab82b095da;alias
From: 987654321 <sip: 987654321(a)sip.myserver.com
>;tag=1b973153-4034-4480-89d3-c47b411bd81e
To: <sip: 1234567890(a)sip.myserver.com>
Contact: <sip:customer1@50.50.50.50:5065
;transport=TLS;alias=50.50.50.50~31090~3>
Call-ID: cd64414e-77d5-45b4-a52d-74ec7fb5c7ef
CSeq: 15776 INVITE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 69
Content-Type: application/sdp
Content-Length: 231
P-Asserted-Identity: <sip: 987654321(a)sip.myserver.com>
v=0
o=- 391641952 391641952 IN IP4 170.170.170.216
s=Asterisk
c=IN IP4 170.170.170.216
t=0 0
m=audio 29478 RTP/AVP 8 0 18
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=sendrecv
a=rtcp:29479
a=ptime:20
*Invite from Kamailio2 to Provider*
-------------------------------------------------
2021/09/08 21:41:57.715881 170.170.170.181:5060 -> 200.200.200.193:5060
INVITE sip: 1234567890@sbc181.myserver.com:5060 SIP/2.0
Via: SIP/2.0/UDP
170.170.170.181;branch=z9hG4bKd703.d45db1fd910c43c5e7c4f8711a5fca92.0
From: 987654321 <sip: 987654321(a)sip.myserver.com
>;tag=1b973153-4034-4480-89d3-c47b411bd81e
To: <sip:1234567890@sip.myserver.com>
Call-ID: cd64414e-77d5-45b4-a52d-74ec7fb5c7ef
CSeq: 15776 INVITE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 68
Content-Type: application/sdp
Content-Length: 231
P-Asserted-Identity: <sip: 987654321(a)sip.myserver.com>
Contact: <sip:btpsh-c9-613903ef-21d75-1@sbc181.myserver.com>
v=0
o=- 391641952 391641952 IN IP4 170.170.170.184
s=Asterisk
c=IN IP4 170.170.170.184
t=0 0
m=audio 11450 RTP/AVP 8 0 18
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=sendrecv
a=rtcp:11451
a=ptime:20
*Bellow you can see the flow*
----------------------------------------
170.170.170.210:5060 170.170.170.170:5060
200.200.200.193:5060
qqqqqqqqqqwqqqqqqqqq qqqqqqqqqqwqqqqqqqqq
qqqqqqqqqqwqqqqqqqqq
21:41:57.698823 x INVITE (SDP) x
x
+0.003788 x qqqqqqqqqqqqqqqqqqqqqqqqqq> x
x
21:41:57.702611 x 100 trying -- your call is x
x
+0.013270 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x
x
21:41:57.715881 x x INVITE (SDP)
x
+0.018529 x x
qqqqqqqqqqqqqqqqqqqqqqqqqq> x
21:41:57.734410 x x 100 Trying
x
+0.804083 x x
<qqqqqqqqqqqqqqqqqqqqqqqqqq x
21:41:58.538493 x x 183 Session Progress
(SDP) x
+0.014557 x x
<qqqqqqqqqqqqqqqqqqqqqqqqqq x
21:41:58.553050 x 183 Session Progress (SDP) x
x
+0.483907 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x
x
21:41:59.036957 x x 183 Session Progress
(SDP) x
+0.012009 x x
<<<qqqqqqqqqqqqqqqqqqqqqqqq x
21:41:59.048966 x 183 Session Progress (SDP) x
x
+0.988036 x <<<qqqqqqqqqqqqqqqqqqqqqqqq x
x
21:42:00.037002 x x 183 Session Progress
(SDP) x
+0.010960 x x
<<<qqqqqqqqqqqqqqqqqqqqqqqq x
21:42:00.047962 x 183 Session Progress (SDP) x
x
+1.989085 x <<<qqqqqqqqqqqqqqqqqqqqqqqq x
x
21:42:02.037047 x x 183 Session Progress
(SDP) x
+0.010947 x x
<<<qqqqqqqqqqqqqqqqqqqqqqqq x
21:42:02.047994 x 183 Session Progress (SDP) x
x
+3.989064 x <<<qqqqqqqqqqqqqqqqqqqqqqqq x
x
21:42:06.037058 x x 183 Session Progress
(SDP) x
+0.008860 x x
<<<qqqqqqqqqqqqqqqqqqqqqqqq x
21:42:06.045918 x 183 Session Progress (SDP) x
x
+1.178240 x <<<qqqqqqqqqqqqqqqqqqqqqqqq x
x
21:42:07.224158 x CANCEL x
x
+0.002725 x qqqqqqqqqqqqqqqqqqqqqqqqqq> x
x
21:42:07.226883 x x CANCEL
x
+0.000372 x x
qqqqqqqqqqqqqqqqqqqqqqqqqq> x
21:42:07.227255 x 200 canceling x
x
+0.016902 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x
x
21:42:07.244157 x x 200 OK
x
+0.004590 x x
<qqqqqqqqqqqqqqqqqqqqqqqqqq x
21:42:07.248747 x x 487 Request
Terminated x
+0.003547 x x
<qqqqqqqqqqqqqqqqqqqqqqqqqq x
21:42:07.252294 x x ACK
x
+0.003737 x x
qqqqqqqqqqqqqqqqqqqqqqqqqq> x
21:42:07.256031 x 487 Request Terminated x
x
+0.001161 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x
x
21:42:07.257192 x ACK x
x
x qqqqqqqqqqqqqqqqqqqqqqqqqq> x
TCP is out of question from the provider.
Any help to use topos or any other module to reduce the size of our invites
to avoid fragmentation will be much appreciated!
Regards,
Angelo
Hello guys,
I'm trying to dynamically add a branch after doing lookup.
The user is found, but in some cases I need to add a branch and do parallel
forking.
So i'm basically doing:
route[LOCATION] {
if (!lookup("location")) {
....
}
if (something) {
route(BRANCH_TO_EXTRA);
}
route(RELAY);
}
route[BRANCH_TO_EXTRA] {
$fs = MY_SOCKET;
append_branch("sip:$tU@" + $sel(cfg_get.pstn.gw_ip) + ":" +
$sel(cfg_get.pstn.gw_port));
return;
}
For some reason only the branch appended is being used (I have
append_branches=1)
Ideas?
David Villasmil
email: david.villasmil.work(a)gmail.com
phone: +34669448337
during testing I need to remove a Via header
This is the code snippet
route[REPLACE_VIA] {
xlog ("L_INFO", "[REPLACE_VIA] Start of block\n");
xlog ("L_INFO", "[REPLACE_VIA] $hdrc(Via) Via headers\n");
if(remove_hf("Via")) {
xlog ("L_INFO", "[REPLACE_VIA] removed Via\n");
}
else {
xlog ("L_INFO", "[REPLACE_VIA] did not remove Via\n");
}
xlog ("L_INFO", "[REPLACE_VIA] $hdrc(Via) Via headers\n");
and this is the logs output
Sep 7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad:
[REPLACE_RURI] Start of block
Sep 7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad:
[REPLACE_VIA] Start of block
Sep 7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad:
[REPLACE_VIA] 1 Via headers
Sep 7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad:
[REPLACE_VIA] removed Via
Sep 7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad:
[REPLACE_VIA] 1 Via headers
From the logs it looks like the remove_hf returns true and we have the
header removed, but its still counting the Via header and the Via Header
is still present when the INVIE is releyed on
Regards,
Richard
Hello,
following situation.
I have a Kamailio (5.4) using rtpengine to loadbalance calls.
If a call from Alice comes in, Kamailio decides to send the call to Carrier
B from Bob.
Bobs Phone is ringing and the carrier B send a 183 Session Progress with
SDP and To-tag=abcd. The SDP has G722 as codec and port 1234.
A few moments later carrier B send a second 183 Session Progress with SDP
and TO-tag=fghi. The SDP has G711 as codec and port 5678. This is done, to
play some funky music as ringtone -.-
If Bob answers the call, carrier B sends a 200 OK WITHOUT SDP and
TO-tag=abcd. So this should instruct our Kamailio to switch to the first
G722 and port 1234.
But sadly, this is just not working as expected.
We tried to set the flags media-handover and port-latching for the
rtpengine options and additionally set a to-tag when using rtpenging_manage.
But this doesn't solve the codec change, so we have only audio when Bob
answers the call, but no ringtone-music. If we allow G711 only in the
outgoing INVITE to Bob, we have also tha ringtone-muisic, because there is
no codec-change.
Carrier B tells us, they are using a fork-mechanism.
Is there something we can do, to support the codec change in 183? Or
enforce carrier B to send SDP in 200 OK? Or anything else?
Carrier B can not change anything in the ringtone-music-backend. They are
stuck on G711.
Thanks!
Hi,
We’re still using kamailio 4.4 but we’ll be migrating to 5.0 soon.
Cool so it will be fixed when we migrate !
Thanks,
Andreas
From: sr-users [mailto:sr-users-bounces@lists.kamailio.org] On Behalf Of Federico Cabiddu
Sent: vendredi 12 mai 2017 11:56
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] t_drop_replies not working with t_suspend in failure route
Hi,
which version are you using?
A similar case had been reported some months ago and it should be fixed in 5.0.
Regards,
Federico
On Fri, May 12, 2017 at 11:44 AM, Huber Andreas <andreas.huber(a)nagra.com<mailto:andreas.huber@nagra.com>> wrote:
Hello,
We have a use case where we suspend a transaction in a failure_route to give UEs that might be woken by a push notification more time to REGISTER and join the INVITE.
We’d like to drop the previous branches in this case. I tried using t_drop_replies() but it has no effect.
The doc states that t_drop_replies() is only working if a new branch is added. And from my understanding t_suspend() adds a new branch.
But is it possible that t_drop_replies() cannot be used with t_suspend()? Or am I missing something?
Kind Regards,
Andreas
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users(a)lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi,
I have a problem with the following scenario:
I have web and mobile sip clients for the same username.
If both clients are idle, INVITE is forked and both clients ring.
If web client is busy and mobile client is online and registered, the
mobile client rings and the caller hears ringback tone.
If web client is busy and mobile client is offline, before the mobile
client receives push notification and registers, web client sends 486 busy
response and caller hears busy tone.
In this last scenario, I want to wait some time for the mobile client to
register and ring.
I tried to drop 486 response in onreply_route[x], but I found that final
responses cannot be dropped in this route.
I dropped 486 in reply_route, but I couldn't send an ACK for this
transaction.
Is there a way to implement this scenario?
I would appreciate if you have any suggestions.
Thanks,
Koray