<p style="margin:0;padding:0;" align="left"><br /></p> Hello all,<br /><br />Thanks Klaus for your answer, it helps me a lot !!<br />For my configuration, do I need to install a database ?<br />After doing some research, I think for routing purposes a database is not needed...<br /><br />Thanks you very much for your input,<br />Regards<br /> <br /> <br /><br /><blockquote style="padding-left: 5px; margin-left: 5px; border-left: 2px solid #ff0000">&gt; Message du 13/08/11 08:38<br />&gt; De : &quot;Klaus Darilion&quot; <br />&gt; A : sr-users@lists.sip-router.org<br />&gt; Copie &agrave; : <br />&gt; Objet : Re: [SR-Users] Question about encryption with Kamailio<br />&gt;<br />&gt; <br />&gt; <br />&gt; On 12.08.2011 14:56, margot.basa wrote:<br />&gt; &gt; Hello all,<br />&gt; &gt;<br />&gt; &gt; I would like to use Kamailio to encrypt contents of SIP messages (using<br />&gt; &gt; SIP TLS) between 2 endpoints, i.e.:<br />&gt; &gt; - To use 5061 port instead of 5060 port,<br />&gt; &gt; - To use sips uri instead of sip uri...<br />&gt; &gt;<br />&gt; &gt; For example, T1 and T2 communicates with &quot;Server A&quot; like that:<br />&gt; &gt; 1) T1 and T2 send REGISTER to &quot;Server A&quot;<br />&gt; &gt; 2) T1 and T2 received 200 OK from &quot;Server A&quot;<br />&gt; &gt; ...<br />&gt; &gt; 3) &quot;Server A&quot; sends an INVITE message to T1 and T2<br />&gt; &gt; ...<br />&gt; &gt; 4) RTP flow between T1 and T2 (this should not be encrypted)<br />&gt; &gt; ...<br />&gt; &gt; 5) &quot;Server A&quot; sends a BYE request to T1 and T2<br />&gt; &gt; ...<br />&gt; &gt;<br />&gt; &gt; All those exchanges are made on Transport layer TCP or UDP on port 5060.<br />&gt; &gt; T1 and T2 are not able to support TLS but &quot;Server A&quot; needs to<br />&gt; &gt; receive/send messages in SIP TLS.<br />&gt; &gt; I would like to insert Kamailio between T1 and &quot;Server A&quot;, T2 and<br />&gt; &gt; &quot;Server B&quot; in order to encrypt contents of SIP messages.<br />&gt; &gt;<br />&gt; &gt; I have some questions about that:<br />&gt; &gt; - I think Kamailio can do that but I am not sure, can you confirm that<br />&gt; &gt; to me please?<br />&gt; <br />&gt; Yes, you can do that with Kamailio<br />&gt; <br />&gt; &gt; - Can I use Kamailio as it is to do that?<br />&gt; <br />&gt; Almost yes. You only have to load the TLS module and tell Kamailio to <br />&gt; listen on port 5061 for TLS.<br />&gt; <br />&gt; Probably some modifications to the default configuration are needed.<br />&gt; <br />&gt; &gt; - Do I have to add a &quot;Route&quot; header in requests in order that requests<br />&gt; &gt; between T1 and &quot;Server A&quot; go through Kamailio<br />&gt; <br />&gt; Yes. When record-routing is activated (it is activated in the default <br />&gt; config), all in-dialog requests (ACK, reINVITE, BYE) will be routed <br />&gt; automatically via Kamailio.<br />&gt; <br />&gt; The more complicated part will be the initial requests (REGISTER, <br />&gt; INVITE). Requests from the clients to the server are quite easy to handle:<br />&gt; <br />&gt; if (src_ip != ip.address.of.server) {<br />&gt;    $du = &quot;sip:ip.address.of.server;transport=tls&quot;;<br />&gt;    t_relay();<br />&gt; <br />&gt; Complicated are INVITEs from the server to the client. Usually during <br />&gt; registration the server stores the contact information of the client, to <br />&gt; send incoming calls to this address. This is either the information in <br />&gt; the Contact header, or the IP address:port from which the REGISTER was <br />&gt; received (if the server performs NAT traversal).<br />&gt; <br />&gt; Both cases are bad - as the server should send the request to Kamailio, <br />&gt; but Kamailio needs to know where to forward the request.<br />&gt; <br />&gt; The proper solution is using &quot;Path&quot; -&gt; see documentation of the Path <br />&gt; module. If your servers supports &quot;Path&quot;, then you are finished.<br />&gt; <br />&gt; If your server does not support Path, there are 2 approaches:<br />&gt; <br />&gt; A) The server stores the Contact, but sends the INVITE requests always <br />&gt; to Kamailio. Therefore, the server needs some kond of &quot;outbound proxy&quot; <br />&gt; functionality.<br />&gt; <br />&gt; B) Kamailio stores the contact of the client, and forwards the REGISTER <br />&gt; with a contact pointing to itself. Thus, server will lookup the client, <br />&gt; finds the IP address of Kamailio and forwards the request. Then Kamailio <br />&gt; again looks up the client in the location table and then forwards the <br />&gt; request. This only works, if Kamailio puts an unique identifier of the <br />&gt; client into the username part of the Contact header.<br />&gt; <br />&gt; <br />&gt; &gt; - Does Kamailio is able to intercept SIP packets automatically (with a<br />&gt; &gt; certain configuration)?<br />&gt; <br />&gt; No. Other nodes have to send SIP messages to Kamailio. This is why <br />&gt; record-routing is needed to tell the other clients to route in-dialog <br />&gt; requests via Kamailio too.<br />&gt; <br />&gt; &gt; - Do you know difference between Freeswitch and Kamailio? (because I<br />&gt; &gt; have seen that Freeswitch can do what I need:<br />&gt; &gt; see Figure4: http://wiki.freeswitch.org/wiki/SIP_TLS)<br />&gt; <br />&gt; No.<br />&gt; <br />&gt; Klaus<br />&gt; <br />&gt; &gt;<br />&gt; &gt; Thank you very much for your input.<br />&gt; &gt; Regards<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt; <br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt;<br />&gt; &gt; _______________________________________________<br />&gt; &gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br />&gt; &gt; sr-users@lists.sip-router.org<br />&gt; &gt; http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br />&gt; <br />&gt; _______________________________________________<br />&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br />&gt; sr-users@lists.sip-router.org<br />&gt; http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br />&gt; </blockquote><BR><BR><a target=_blank href=https://compte.laposte.net/inscription/index.do?jeux=2011FOOTER_generique><img style="margin: 0pt;" src="http://webmail.laposte.net/webmail/fr_FR/panels/images/pied-page-generique_2.jpg" alt=""><a>