Hi all,
I have a scenario where it's not clear to me what the best approach should be (Kamailio 3.2.0 on Squeeze, although I think it's a matter of routing logic only).
I have a client behind NAT that sends an initial REGISTER request with a Contact containing private ip:port (e.g.
Contact: "GV" <sip:12345@192.168.1.2:54321;transport=tcp>
)
However, after it's challenged for authentication with a 401, it sends the following REGISTER request with Authorization header and with a Contact containing ip:port equal to the 'received' SIP URI (with a combination of 'rport' and 'received' parameters (e.g.
Contact: "GV" <sip:12345@[receivedIP]:[rport];transport=tcp>
)
In this case kamailio's routing logic is not marking the REGISTER as natted (no Received field in location and no NAT flags set).
You can imagine I have a fairly standard NAT handling:
route[NATDETECT] {
force_rport();
if (nat_uac_test("19")) {
if (is_method("REGISTER")) {
fix_nated_register();
} else {
fix_nated_contact();
}
setflag(FLT_NATS);
}
return;
}
FLT_NATS won't be set, and so it won't FLB_NATB in the following processing.
This client receives a call: Kamailio relays the INVITE to it using the stored Contact. The INVITE is correctly received by the client, because the stored Contact refers to the connected socket ([received]:rport).
The trouble starts when then the client replies with a 200 OK containing the private ip:port in the Contact header field (again 192.168.1.2:54321).
The ACK will then have that private ip:port in the R-URI, and its relaying will fail.
One of the solutions I've found is using always add_contact_alias() in onreply_route when handling the 200 OK, and then use handle_ruri_alias() when defining the destination for the ACK.
I know that without traces and the full .cfg this is quite a broad question, but I wonder if you have already had to deal with this kind of client behaviour and can provide advice on the best practices.
This is in particular useful for the re-use of TCP-based connections.
Thanks in advance,
Giacomo
Truphone Limited is a limited liability company registered in England & Wales, registered office: 4 Royal Mint Court, London, EC3N 4HJ. Registered No. 04187081. VAT No. GB 851 5278 19.
Tru is a brand name of Truphone and is a Truphone Communications Service. Truphone is a trading name for a number of distinct legal entities that operate in combination. www.truphone.com<http://www.truphone.com>.
This e-mail, and any attachment(s), may contain information which is confidential and/or privileged, and is intended for the addressee only. If you are not the intended recipient, you may not use, disclose, copy or distribute this information in any manner whatsoever. If you have received this e-mail in error, please contact the sender immediately and delete it.
Hello ,
I hope someone encountered this problem on UBUNTU , when connecting to
the database i get this error in my log file :var/log/sys
Mar 19 14:09:46 rayan-desktop /usr/sbin/ser[21807]:
register_udomain(): Invalid table version (use ser_mysql.sh reinstall)
Mar 19 14:09:46 rayan-desktop /usr/sbin/ser[21807]: domain_fixup():
Error while registering domain
Any help is appreciated .
Thank you .
Hi
I have been using fix_nated_register/fix_nated_contact for NAT traversal
and all worked fine. I've come across add_contact_alias and
handle_ruri_alias:
http://sip-router.org/wiki/tutorials/alias-example
where it says:
"The benefits of using add_contact_alias() and handle_ruri_alias()
functions instead of conventional NAT traversal solutions are:
*
Request-URI in requests to UAs behind NATs is always what UAs expect
*
Re-use of tcp/tls sessions between proxy and UAs
"
I assumed the 'conventional NAT traversal solution' here means
fix_nated_contact?
I understand the first point, in that the R-URI always contains what the
client puts in the contact hf.
But for the second point, about tcp/tls reuse, does fix_nated_contact do
the same trick, or does add_contact_alias and handle_ruri_alias give you
more benefit over fix_nated_contact? So far I feel they achieve the same
thing but would like this confirmed/corrected.
Thank you very much!
Yufei
Hi!
Started kamailio with "-m 100 -M 30". Thus I would suspect that every
process needs 30MB, and one of the processes needs 30+100Mb as it
allocates the shared memory. The further would conclude that the memory
will be allocated only once during startup.
Can this be somehow verified? Normal "ps" output shows that every
process needs ~130MB virtual memory, but this is probably not what I am
looking for.
Thanks
Klaus
# ps aux
PID %CPU %MEM VSZ RSS TTY STAT COMMAND
846 0.2 0.8 139732 4112 ? S kamailio -m 100 -M 30
847 0.0 0.2 139732 1188 ? S kamailio -m 100 -M 30
848 0.0 0.2 139732 1184 ? S kamailio -m 100 -M 30
849 0.0 0.2 139732 1184 ? S kamailio -m 100 -M 30
850 0.0 0.2 139732 1184 ? S kamailio -m 100 -M 30
851 0.0 0.2 139732 1220 ? S kamailio -m 100 -M 30
852 0.0 0.2 139732 1208 ? S kamailio -m 100 -M 30
853 0.0 0.2 139736 1032 ? S kamailio -m 100 -M 30
854 0.0 0.2 139732 1176 ? S kamailio -m 100 -M 30
855 0.0 0.2 139732 1392 ? S kamailio -m 100 -M 30
856 0.0 0.2 139732 1392 ? S kamailio -m 100 -M 30
857 0.0 0.2 139732 1392 ? S kamailio -m 100 -M 30
858 0.0 0.2 139732 1392 ? S kamailio -m 100 -M 30
859 0.0 0.2 139732 1396 ? S kamailio -m 100 -M 30
Hello,
on the iptel.org website I created an account. Also my own domain is
registered and all works fine.
I prefer numbers in the SIP-ID. With my own domain, I thought, I can use
every number. But that is not true. Every number must start with the
digit 8, for example 8555(a)mydomain.de.
What is the reason for that?
Have I the possibility to change that setting?
I can also create aliases, for example 4123(a)mydomain.de and that works
fine. But the telephonee sees still the number 8555 from the account name.
Any ideas?
Best regards,
Robert
thanks for all the support for all this years.
Can you please help me to know if there is any way to route sip calls
based on transport protocol, for example a call incoming on tcp i
will assign a route and if a call comes in udp i will assign a different
route.
my scenario is calls coming from different devices registering to kamailio
and then kamailio send those calls to asterisk.
unfortunately i have to create a different peer set for each device. for
this scenario i have two types of UAs and they need completely different
configuration on the asterisk switch.
i am planing on segregate the traffic and build a media server for each
type of device means 2 asterisk, teh only way that i can identify those
incoming registrations is by the use of the port one client connects trough
udp the other trough tcp.
I appreciated any input in this matter.
and again thank a lot to all for the great support.
Andres Collazos.
Hi,
I am building Kamailio as a Stand-alone XMPP server so that XMPP clients can IM each other; but I also want the below functionality:
The XMPP clients should all be able to see each others presence
So do I need to look out the Kamailio presence module and will it fulfill my above requirement.
Regards,
Faisal Rehman
In wireshark, there are 2 fields - Source and Destination. I am curious if
there are variables in Kamailio which can show me those values.
System:
MYIP - IP of kamailio
sip.mydomain.com - address of kamailio
User (Imsdroid for Android) ->Kamailio->Asterisk->Kamailio (same) ->Other
user.
Problem - register, voice, video, and ring are OK, but ACK and BYE are
going in dead loop - and this happens may be around in 50% of cases - not
in all cases.
If I am using other client (like hardware SIP phones), then I have no
problems, but it is really hard to find some client for Android which
supports video with Kamailio.
To solve problem, I made one function in Kamailio.cfg - ACKBYE, which is
called only within dialog. And within dialog is called in main route.
route[ACKBYE] {
#!ifdef WITH_MYFORWARD
xlog("SCRIPT: AckBye $td;$si;$du;$dd\n");
if((($td=="sip.mydomain.com")||($td=="MYIP"))&&($si=="MYIP")){
$du=$sht(forw=>$ft);
xlog("SCRIPT: AckBye2 $td;$si;$du\n");
return;
}
#!endif
return;
}
Of cource I have
if(is_method("INVITE")){
ds_select_dst("1","4");
$sht(forw=>$ft)=$du;
}
This worked for long time. But then we updated client (libraries etc), and
problem appeared again - from time to time. Calls between 2 same clients
can pass 2 or 5 times, and then problem appear.
Before - $td and $si showed destination and source but now there is
difference:
ERROR: <script>: SCRIPT: AckBye 192.168.2.251;MYIP;<null>;<null>
$td in this case show destination, which is correct, but in wireshark,
destination and source = MYIP.
ACK sip:MYIP;lr=on;nat=yes SIP/2.0
Via: SIP/2.0/UDP MYIP;branch=z9hG4bKcydzigwkX
Via: SIP/2.0/UDP MYIP;rport=5060;branch=z9hG4bKcydzigwkX
............................................
Via: SIP/2.0/UDP MYIP;rport=5060;branch=z9hG4bKcydzigwkX
Via: SIP/2.0/UDP 192.168.2.105:44794;branch=z9hG4bK338581244;rport=44794
From: <sip:11171@sip.MYDOMAIN.com>;tag=1687441663
To: <sip:11175@192.168.2.251>;tag=as13c57096
Contact: <sip:11171@MYIP
:5060;transport=udp>;+g.oma.sip-im;language="en,fr";+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
Call-ID: 4026cd88-aab9-19db-dfbe-1510baafdbb3
CSeq: 473985105 ACK
Content-Length: 0
Max-Forwards: 0
Proxy-Authorization: Digest username="11171",realm="sip.stribogkonsult.com
",nonce="T2NZUU9jWCWxMUHSQweHXVQppHS8iFhd",uri="sip:11175@MYIP
:5060",response="c5a95942af1502c208fa05d34c405907",algorithm=MD5
Accept-Contact:
*;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE,
REFER
Privacy: none
P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000
User-Agent: IM-client/OMA1.0 android-ngn-stack/v2.0.453 (doubango r653)