[Freeswitch-users] SBC In-band DTMF

support at ecn.net.au support at ecn.net.au
Fri Jan 18 08:19:31 MSK 2013


Thanks for the replies so far, your input is greatly appreciated


Our configuration is

TELCO --SIP--> FREESWITCH/SBC --SIP--> PBX

Our Telco uses Inband DTMF for tones.

Our legacy SBC platform (openser) simply proxied the content through and the PBX's recognised the inband dtmf tones and
acted accordingly.

Since moving onto FreeSwitch an SBC DTMF on calls made from the telco through to a PBX are not being recognised by the PBX
as inband (ie no DTMF).

A few notes:

1) We can add start_dtmf as an application prior to bridge and set dtmf_mode none in the Telco facing context and
dtmf_mode rfc2833 in the pbx facing context, and DTMF is recognised on the PBX (as rfc2833), However we had a resultant
issue that audio file playback from IVR's on the Asterisk PBX is clipped (first 2 seconds or so of each sound file
being played  and this does not occur on voice mail box recordings - tested with the same audio file) - interestingly on
Freeswitch 1.0.6 this clipping does not occur, on 1.2.x or the unstable 1.3 every version exhibits this odd behaviour. (Sound from
remote IVR on PBX clipped). An interesting notes using the record session application, the clipping is not apparent, only to the
calling party. (Could this possibly be legitimate bug that should be submitted?)

So we considered that we should be able to just pass the dtmf inband without looking at the media, however so far
we can not seem to make the PBX's recognise DTMF inband on inbound sip calls.

The earlier post
http://lists.freeswitch.org/pipermail/freeswitch-users/2013-January/091332.html

suggested to look at the way freeswitch was setting up the invite to the PBX (perhaps not telling the PBX that
we are using inband).

So we tcpdumped the SIP INVITES from the Telco to the SBC and then from the SBC to the PBX, and also did the same
on our legacy openser SBC as well.

the only defined difference that we could ascertain was that when using Freeswitch as the SBC the fmtp:18 media
attribute (present between on the telco's invite on the a leg, and present on the openser->pbx invite on the legacy
is missing on the Freeswitch Invite to the PBX.

Reading suggested to add the

<action application="export" data="sip_append_audio_sdp=a=fmtp:18 annexb=no"/>

directive to add this media attribute to the b-leg SDP.

However (and we may be missing the point here) when we do this it has no impact on the SDP INVITE sent from
the Freeswitch to the PBX (using tcddump to capture the network traffic).

--

It seems we have 2 issues;

the First is why does start_dtmf in freeswitch 1.2.x and 1.3.x clips the sounds (when in 1.0.x it does not)

the Second is why doesn't adding the sip_append_audio_sdp actually add the attribute or how can we make
Freeswitch do this (it appears in reading fmtp:18 and dtmf inband have some relationship, we've made an assumption
that this may be why the PBX's are not looking for inband dtmf on these calls.

any help is really appreciated as we're currently stuck until we figure this out!



Kind Regards,

________________________________
From: Steven Ayre [steveayre at gmail.com]
Sent: Friday, 18 January 2013 11:57 AM
To: FreeSWITCH Users Help
Cc: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] SBC In-band DTMF

<param name="rfc2833-pt" value="0"/>

What're you hoping to do here? This sets the payload type value. 0 is a valid pt. This won't disable it, it'll instead use the value 0. That happens to be the one for G711, so if that codec is enabled you're just going to get a conflict.

More likely you want:

<param name="dtmf-type" value="none"/>


<action application="export" data="sip_append_audio_sdp=a=fmtp:18 annexb=no"/>

This is also probably not a good idea. These are attributes of specific codecs and those modules will set them if required. FS is negotiating and terminating media, you shouldn't be needing to play with the SDP at a low level for what you're trying to do.

Steve on iPhone



On 17 Jan 2013, at 02:58, "support at ecn.net.au<mailto:support at ecn.net.au>" <support at ecn.net.au<mailto:support at ecn.net.au>> wrote:

Hi

This sounds quite posible.

I've tcpdumped sip headers on both the freeswitch and the backend PBX.

The only significant difference I can see between our old SBC and FS is that the old SBC
asserted a media attribute fmtp:18 annexb=no  where  as FS doesn't forward this.

To test it out we have set dtmf_mode to none on both contexts (the context facing the telco
and the context facing the pbx), and set

<param name="rfc2833-pt" value="0"/>

(this may not be needed).

then in the dialplan we have

<action application="export" data="sip_append_audio_sdp=a=fmtp:18 annexb=no"/>

set prior to the bridge.

--

When we sip trace however we are not appending the attribute to the SDP on the INVITE.

Logs and sip headers below:


EXECUTE sofia/aapt/0731111111 at X.Y.Z.A:5060<mailto:sofia/aapt/0731111111 at X.Y.Z.A:5060> export(sip_append_audio_sdp=a=fmtp:18 annexb=no)
2013-01-17 12:34:19.702102 [DEBUG] switch_channel.c:1135 EXPORT (export_vars) [sip_append_audio_sdp]=[a=fmtp:18 annexb=no]
EXECUTE sofia/aapt/0731111111 at X.Y.Z.A:5060<mailto:sofia/aapt/0731111111 at X.Y.Z.A:5060> bridge(sofia/external/0737111111 at A.B.C.X:5060<mailto:sofia/external/0737111111 at A.B.C.X:5060>)
2013-01-17 12:34:19.702102 [DEBUG] switch_channel.c:1089 sofia/aapt/0731111111 at X.Y.Z.A:5060<mailto:sofia/aapt/0731111111 at X.Y.Z.A:5060> EXPORTING[export_vars] [sip_append_audio_sdp]=[a=fmtp:18 annexb=no] to eve
nt
2013-01-17 12:34:19.702102 [DEBUG] switch_ivr_originate.c:2022 Parsing global variables
2013-01-17 12:34:19.702102 [NOTICE] switch_channel.c:968 New Channel sofia/external/0737111111 at A.B.C.X:5060<mailto:sofia/external/0737111111 at A.B.C.X:5060> [a30c650a-87d3-4027-9010-213547d698aa]
2013-01-17 12:34:19.702102 [DEBUG] mod_sofia.c:4977 (sofia/external/0737111111 at A.B.C.X:5060<mailto:sofia/external/0737111111 at A.B.C.X:5060>) State Change CS_NEW -> CS_INIT
2013-01-17 12:34:19.702102 [DEBUG] switch_core_session.c:1283 Send signal sofia/external/0737111111 at A.B.C.X:5060<mailto:sofia/external/0737111111 at A.B.C.X:5060> [BREAK]
2013-01-17 12:34:19.702102 [DEBUG] switch_core_state_machine.c:415 (sofia/external/0737111111 at A.B.C.X:5060<mailto:sofia/external/0737111111 at A.B.C.X:5060>) Running State Change CS_INIT
2013-01-17 12:34:19.702102 [DEBUG] switch_core_state_machine.c:454 (sofia/external/0737111111 at A.B.C.X:5060<mailto:sofia/external/0737111111 at A.B.C.X:5060>) State INIT
2013-01-17 12:34:19.702102 [DEBUG] mod_sofia.c:86 sofia/external/0737111111 at A.B.C.X:5060<mailto:sofia/external/0737111111 at A.B.C.X:5060> SOFIA INIT
2013-01-17 12:34:19.702102 [DEBUG] sofia_glue.c:2647 Local SDP:
v=0
o=FreeSWITCH 1358365507 1358365508 IN IP4 A.B.C.D
s=FreeSWITCH
c=IN IP4 A.B.C.D
t=0 0
m=audio 24552 RTP/AVP 8 0 3 13
a=fmtp:18 annexb=no
a=ptime:20
a=sendrecv


But then the actual Invite doesn't contain the attribute in the SDP

send 1036 bytes to udp/[A.B.C.X]:5060 at 02:34:19.718385:
   ------------------------------------------------------------------------
   INVITE sip:0737111111 at A.B.C.X:5060 SIP/2.0
   Via: SIP/2.0/UDP A.B.C.D:5080;rport;branch=z9hG4bKpUvH6K1ppUSNp
   Max-Forwards: 69
   From: "0731111111" <sip:0731111111 at A.B.C.D>;tag=mH93ZHryv4H2g
   To: <sip:0737111111 at A.B.C.X:5060>
   Call-ID: 3ca1df3f-daf1-1230-f389-002219a7c712
   CSeq: 38858965 INVITE
   Contact: <sip:mod_sofia at A.B.C.D:5080>
   User-Agent: FreeSWITCH-mod_sofia/1.2.5.3+git~20121229T001759Z~e04eab7902
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
   Supported: timer, precondition, path, replaces
   Allow-Events: talk, hold, conference, refer
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 155
   X-Nortel-Profile: DEFAULT
   X-FS-Support: update_display,send_info
   Remote-Party-ID: "0731111111" <sip:0731111111 at A.B.C.D>;party=calling;screen=yes;privacy=off

   v=0
   o=FreeSWITCH 1358365507 1358365508 IN IP4 A.B.C.D
   s=FreeSWITCH
   c=IN IP4 A.B.C.D
   t=0 0
   m=audio 24552 RTP/AVP 8 0 3 13
   a=ptime:20
   ------------------------------------------------------------------------



Are we missing something do you think?



Kind Regards,

________________________________
From: Steven Ayre [steveayre at gmail.com<mailto:steveayre at gmail.com>]
Sent: Thursday, 17 January 2013 4:14 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] SBC In-band DTMF

However under freeswitch if we don't start_dtmf before the bridge the backend PBX boxes don't recognise
the DTMF inband (even though the tones are audible ie you can hear them on a call recording on the
PBX).

Have we missed something here?  We would have thought with inband DTMF on non compressed codec (no
transcoding) that the tones would just work with the media stream?

start_dtmf will detect inband DTMF, and then send out of band on the outgoing leg of the bridge. This is expected. You'll will need to call start_dtmf from dialplan, which can easily be done from dialplan by checking for some condition identifying calls requiring it. If they're authenticating to FS then it'd be trivial to set a variable in their user directory entry that you can test in the dialplan.

Now this is just a guess... During the codec negotiation FS will tell your PBX that it supports telephone-event (RFC2833). It may be that because the PBX sees that in the SDP that it doesn't look for inband DTMF, while when it received the SDP direct from the customer it didn't contain telephone-event and so did check for inband DTMF. Indeed it'd probably be a good idea for them to do so, since if you receive the same DTMF digit both inband and through RFC2833 then you'd be  duplicating digits. So my guess is that the PBX doesn't bother check for inband because FS tells it it's sending out-of-band, which'd differ from before.

-Steve



-Steve




On 16 January 2013 04:02, support at ecn.net.au<mailto:support at ecn.net.au> <support at ecn.net.au<mailto:support at ecn.net.au>> wrote:
> Hi All
>
>
>
> We're quite new to Freeswitch and are in the process of migrating from
> OpenSer (as an SBC) to Freeswitch.
>
>
>
> Mostly all is working well, except an oddity on DTMF.
>
>
>
> Our scenario:
>
>
>
> Telco/SIP Provider A is passing us calls using DTMF inband.
>
>
>
> We have a freeswitch configured as a SBC using 2 sip profiles (telco and
> internal) to topology hide and manage
>
> distribution of calls to the PBX servers located behind the SBC.
>
>
>
> The freeswitch will be handling up to a few hundred calls so we're trying to
> keep it lightweight.
>
>
>
> Behind the SBC is a series of Asterisk and Freeswitch PBX boxes handling
> customer needs.
>
>
>
> An example inbound call profile looks like this:
>
>
>
> <extension name="Inbound 124356">
>
>         <condition field="destination_number" expression="^(123456)$">
>
>                 <action application="pre_answer"/>
>
>                 <action application="start_dtmf" />
>
>                 <action application="bridge"
> data="sofia/external/123456 at INTERNAL.PBX.IP<mailto:sofia/external/123456 at INTERNAL.PBX.IP>:5060"/>
>
>         </condition>
>
> </extension>
>
>
>
> Initially when calling into the platform IVR type applications runinng on
> our PBX boxes would not
>
> work (you could hear the DTMF but the platform did not recognise the tones).
>
>
>
> We have had to add the appliation start_dtmf in order for Freeswitch to pass
> the DTMF to the Asterisk
>
> PBX behind the SBC.   Interestingly on our OpenSer platform we just proxied
> the media (rtpproxy) with
>
> inband DTMF from the Telco and our PBX boxes recognised the inband DTMF
> tones on the PBX platforms and
>
> IVR type applications just worked.
>
>
>
> However under freeswitch if we don't start_dtmf before the bridge the
> backend PBX boxes don't recognise
>
> the DTMF inband (even though the tones are audible ie you can hear them on a
> call recording on the
>
> PBX).
>
>
>
> Have we missed something here?  We would have thought with inband DTMF on
> non compressed codec (no
>
> transcoding) that the tones would just work with the media stream?
>
>
>
> We have confirmed both legs are PCMA and when using start_dtmf the first
> second of the call is clipped.
>
>
>
>
>
>
>
> Kind Regards,
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org<mailto:consulting at freeswitch.org>
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<http://lists.freeswitch.org/mailman/options/freeswitch-users>
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130118/54c0cbcc/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list