<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 at 3:12 AM, Chirag Desai <span dir="ltr"><<a href="mailto:djchillerz@gmail.com" target="_blank">djchillerz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi all,<br><br></div>I'm using Kamailio + Asterisk 13 (PJSIP), where Kamailio (using rtpengine) acts as the registrar and forwards all calls to Asterisk.<br><br></div><div>This works fine when using udp / tcp and RTP. When switching to TLS/SRTP, the call is set up correctly, however, I get no audio.<br><br></div><div>When I skip kamailio and connect my two endpoints to asterisk directly I get a perfect call with SRTP. <br><br>The same is also true when I skip asterisk and have the call handled by Kamailio (using RTPEngine).<br></div><div><br></div>In PJSIP my transports look like this:<br><br>[transport-tcp]<br>type=transport<br>protocol=tcp    ;udp,tcp,tls,ws,wss<br>bind=<a href="http://0.0.0.0:5060" target="_blank">0.0.0.0:5060</a><br>local_net=[asterisk local ip]/17<br>external_media_address=[asterisk external ip]<br>external_signaling_address=[asterisk external ip]<br><br>[transport-tls]<br>type=transport<br>protocol=tls<br>bind=<a href="http://0.0.0.0:5063" target="_blank">0.0.0.0:5063</a><br>ca_list_file=/etc/asterisk/certificates/cert.crt<br>cert_file=/etc/asterisk/certificates/certificate.crt<br>priv_key_file=/etc/asterisk/certificates/key.key<br>method=tlsv1<br><br><br></div>My endpoint looks like this:<br><br>[kamailio]<br>type=endpoint<br>context=kam_out<br>disallow=all<br>allow=alaw<br>allow=g722<br>allow=ulaw<br>allow=gsm<br>aors=kamailio<br>direct_media=no<br>media_encryption=sdes<br>media_address=[Asterisk Local IP]<br>rtp_symmetric=yes<br>force_rport=no<br>rewrite_contact=yes<br>outbound_proxy=sip:[Kamailio Local IP]:5060\;transport=tcp\;lr<br><br>[kamailio]<br>type=identify<br>endpoint=kamailio<br>match=[Kamailio Local IP]/17<br><br>[kamailio]<br>type=aor<br>contact=sip:[Kamailio Local IP]:5060\;transport=tcp<br><br></div><br></div>My dialplan looks like this<br><div><br>[kam_out]<br><br>exten => 1001,1,Playback(demo-echotest)  ; Let them know what's going on<br>        same => n,Echo                     ; Do the echo test<br>        same => n,Playback(demo-echodone)  ; Let them know it's over<br>        same => n,Hangup()<br><br><br>exten => _kb-.,1,NoOp(Calling a registred user with number ${EXTEN})<br>        same => n,Set(callee=${PJSIP_HEADER(read,To)})<br>        same => n,Set(callee=${callee:5})<br>        same => n,Set(callee=${callee:0:-1}) ; removes the ><br>        same => n,Dial(PJSIP/kamailio/sip:${callee})<br>        same => n,Hangup()<br><br></div><div>When a call comes via kamailio it comes with a prefix of 'kb' if the value is an extension e.g. 1000 - 1999. Otherwise users can dial a prefix of 45 e.g. 451001 to hit the Echo Test.<br><br></div><div>As mentioned the echo test works fine, however the actual call between two endpoints has no audio. RTP debug shows nothing. PJSIP shows two channels in a simple bridge, but no sound. Usually PJSIP says RTP Probation passed and shows the IP address but in this case it does not.<br><br></div></div></blockquote><div><br></div><div>The PJSIP stack only provides SIP signalling; it doesn't interfere with the media handling in Asterisk. The handling of media is done by the RTP engine implementation, res_rtp_asterisk.<br><br></div><div>I don't think this is a problem, however, with res_rtp_asterisk or Asterisk. If RTP debug doesn't show any traffic, then Asterisk is almost certainly not receiving any media.<br><br></div><div>What does a PCAP show? I'd look at where the RTPEngine is forwarding your RTP packets off to, and see if they are getting sent somewhere other than Asterisk.<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>I'm guessing the issue is something funny in PJSIP, although I'm not 100% since it does work when I turn SRTP and TLS off.<br><br></div><div>For testing I'm using CsipSimple and a Snom 760. Both are set with SRTP mandatory and are using TLS to talk to Kamailio.<br><br></div><div>When kamailio talks to asterisk it uses TCP over a local network.<br><br></div><div>I've been pulling my hair out for days. I really would appreciate any ideas or some pointing in the right direction here.<br><br></div><div>Thanks in advance,<br><br></div><div>C<br></div></div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Director of Technology<br></div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div><div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div></div></div></div>
</div></div>