Am 05.11.2010 18:19, schrieb MÉSZÁROS Mihály:
2010-11-05 09:31 keltezéssel, Alex Balashov írta:
On 11/05/2010 04:10 AM, MÉSZÁROS Mihály wrote:
Hello all!
Is there any known problem to run multiple kamailio/sip-router instance in one host. I need this to handle multidomain situation.
The multidomain what is built in is not satisfactory, because the UA-s what are from varying vendors. And some has strange or a very limited SIP implementation. Some can only register ip address, some can use RFC3263, but some can use only DNS A record. :(
Any answer, suggestion appreciated very well!
I still don't see why handling multiple domains in a single instance would be a problem.
I will try to explain where i saw the problem. Of course it can be that i am wrong, so AFAIK ..
If there is domain atlanta.test with with such a DNS.
$TTL 60 $ORIGIN atlanta.test. @ IN SOA a1.atlanta.test. root.a1.atlanta.test. ( 2009071301 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS a1 @ IN NS a2 a1 IN A 192.168.0.1 a2 IN A 192.168.0.2 ;; order pref flags service regexp replacement @ IN NAPTR 10 10 "s" "SIPS+D2T" "" _sips._tcp @ IN NAPTR 20 10 "s" "SIP+D2T" "" _sip._tcp @ IN NAPTR 30 10 "s" "SIP+D2U" "" _sip._udp ;; Priority Weight Port Target _sips._tcp IN SRV 10 0 5061 a1 _sips._tcp IN SRV 20 0 5061 a2 _sip._tcp IN SRV 10 0 5060 a1 _sip._tcp IN SRV 20 0 5060 a2 _sip._udp IN SRV 10 0 5060 a1 _sip._udp IN SRV 20 0 5060 a2
* UA type1 It is implementing RFC3263 correctly. (Very rare such a good implementation.) so it will send a register REGISTER atlanta.test To:alice@atalnta.test o Correctly this client will use the proxy preference and in best case use tcp + tls.
Fine.
* UA2 It is implementing only dns A record support. so it will send a register REGISTER a1.atlanta.test To: alice@a1.atlanta.test
It depends. Most of the clients, regardless if they support SRV/NAPTR or not, allow you to configure an outboundproxy. This means you will tell the client that the domain is "atlanta.test" and configure as outboundproxy "a1.atlanta.test". So, all the SIP URIs still use "atlanta.test" in domain-part.
* UA3 It is a strange UA resolves everything to ip address. so it will send the register REGISTER 192.168.0.1 To: alice@192.168.0.1
Do such clients really exists? Send them back to the vendor.
* UA4 Maybe there are more case, and can be continued. But till now i faced only to the above three cases.
Where i saw the problem with kamailio multidomain setup (AFAIK): I want to use the three as one "sip routing domain" or i don't know how to name it correctly. When it saves the AoR <=> Contact bindings to location database (mysql), the registrar will create and save the contacts to three separated domain according to the above three UA behavior:
* atlanta.test * a1.atlanta.test * 192.168.0.1
So i must add three times the user in subscriber table for the three domain, to allow the user alice to authenticate from any UA. And i will have three domain in location database for only one "sip routing domain".
If you need to host only one "sip routing domain" which uses different hostparts, then it would simplest by just not enabling multidomain mode:
modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 0)
So if i want to have a second domain, called biloxi.test with similar setup, on the same host where atlanta.test is, then i get bigger mess. And i have six domain... I hope you see where i have a problem. And AFAIK i can't set to registrar function save() the domain, if i use database backend.
I guess it also depends on how the userpart is constructed and how strong the separation between the atlanta and biloxi has to be. E.g. if the userpart of atlanta and biloxy does not overlap, (e.g. random generated usernames or E164 phone numbers) then you still can leave multidomain support disabled.
If you need separation of atlanta and biloxy and you really need to support SIP clients which only use IP addresses then of course you are forced to use different sockets (different ports or IP addresses). Once you use different sockets you can also separate Kamailio instances, one for biloxy and one for atlanta. Those Kamailio instances will then be operated with use_domain=0 and thus the host-part will be ignored.
Highly appreciated if You can suggest a solution for this. It will be nice if you, or anyone can suggest some solution to this problem.
Get rid of stupid/broken clients - if possible.
PS: Above is mainly for Kamailio. Provisioning in Kamailio is SIP-URI centric - this means a user has one SIP URI (and thus is in one domain). ser/sip-router modules use a different provisioning model which is user-id centric. In this schema a user is mapped to an ID. This ID may be mapped to various SIP URIs which may reside in different domains. So the ser database model may help you with provisioning - anyway you would have to assign 3 SIP URIs to a user's account.
regards Klaus