+ornJoXjZ5tSadho4
a=sendrecv
As
we can see, there are two "m=" lines in the SDP of the offer; one for
RTP and another for SRTP. FreeSWITCH-1.0.7 answers the call by sending
200OK with the following SDP:
v=0
o=FreeSWITCH 1291628984 1291628985 IN IP4 47.152.232.156
s=FreeSWITCH
c=IN IP4 47.152.232.156
t=0 0
m=audio 11280 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
m=audio 0 RTP/SAVP 19
As
you can see above, FreeSWITCH accepts the RTP stream and rejects the
SRTP stream (by sending port as 0) in the SDP. The SIP phone sends the media in
RTP(which is expected). But, FreeSWITCH sends the
media in SRTP to the SIP phone. I believe this is a bug in FreeSWITCH as it is
supposed to send the media in RTP since it accepted RTP in the answer
(200OK).
Query:
======In order to make FreeSWITCH select SRTP in the SDP of the answer(200OK), I made the following change(in
bold) in FS dial plan:
<extension name="IVR">
<condition field="destination_number" expression="^IVR$">
<action application="set" data="sip_secure_media=true"/>
<action application="bridge" data="loopback/app=socket:47.152.232.156:8084 async full"/>
</condition
</extension>In
FreeSWITCH-1.0.6(before updating to 1.0.7), this worked and FS accepted
the SRTP stream and rejected RTP in the answer(200 OK) as shown below:
m=audio 0 RTP/AVP 19
m=audio 12084 RTP/SAVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:hgv7ClqDx1irTRrXq2NEm9Gbouw0969bBU3n+LcM
But after updating the FreeSWITCH-1.0.6 to 1.0.7, the above
mentioned dial plan change (i.e, setting sip_secure_media=true) is not
working. It is still behaving in the same way as it did without the XML
change.
Can you please let me know if anything else needs to be added in
dialplan XML file for enabling SRTP in this case in FreeSWITCH-1.0.7 or
am I missing something here?
I have referred the following FS wiki pages for making the SRTP changes:
http://wiki.freeswitch.org/wiki/Secure_RTPhttp://wiki.freeswitch.org/wiki/SRTP
Note:
There is no issue when the SIP phone is configured in "SRTP only" mode
where only SRTP stream is offered in the SDP of the INVITE. In this
case, SIP phone and FreeSWITCH communicate properly using SRTP. This
doesn't require setting "sip_secure_media=true" in the dialplan XML
file.
P.S: I am a newbie to FreeSWITCH. So, please forgive me if I am asking basic questions.
Thanks
Goutham B G