[Freeswitch-users] tone_detect vs. ignore_early_media AND mod_fifo

Jeroen C. van Gelderen slim at thegreek.com
Mon Oct 11 03:30:52 PDT 2010


 

Hmm. the plot thickens.

 

When I bridge my FXO port to the SIP-GSM gateway directly (i.e. without
using mod_fifo) I don't seem to need monitor_early_media_fail. Using
tone_detect on the A leg works fine when "ignore_early_media=true" is used
on the B leg:

 

The following dialplan excerpt WORKS (i.e. FXO hang-ups are detected at all
stages by tone_detect):

 

    <extension name="pan_125">

      <condition field="${freetdm_span_name}"
expression="^span_fxo_helpdesk$">

        <!-- Detect busy tone from Panasonic -->

        <action application="tone_detect" data="busy-pan 350,440 r 0 hangup
undef 2"/>

 

        <action application="answer"/>

 

        <action application="set" data="continue_on_fail=true"/>

        <action application="set" data="instant_ringback=true"/>

        <action application="set" data="ringback=%(1000,1500,440.0,480.0)"/>

 

        <action application="bridge"
data="{ignore_early_media=true}sofia/internal/1??????76??@192.168.3.11:5060"
/>

        <action application="bridge"
data="{ignore_early_media=true}sofia/internal/1??????77??@192.168.3.11:5060"
/>

      </condition>

    </extension>

 

The problem seems to occur only when mod_fifo is added to the mix:

 

    <extension name="test2">

      <condition field="${freetdm_span_name}" expression="^span_fxo_test$">

        <!-- Detect busy tone from Panasonic -->

        <action application="tone_detect" data="busy-pan 350,440 r 0 hangup
undef 2"/>

 

        <action application="answer"/>

 

        <action application="playback" data="thankyou.wav"/>

        <action application="set" data="fifo_music=$${hold_music}"/>

        <action application="fifo" data="fifo_helpdesk in"/>

      </condition>

    </extension>

 

In all cases: 

-          tone_detect works BEFORE the call is handed to mod_fifo (i.e.
during playback)

-          tone_detect works AFTER the call is established by mod_fifo and
audio is being exchanged between A and B leg.

 

IF the A leg (with tone_detect enabled) is handed to mod_fifo AND there are
no agents in the fifo THEN tone_detect does not work. Mod_fifo simply plays
MOH to the A leg perpetually.

 

IF the A leg (with tone_detect enabled) is handed to mod_fifo AND mod_fifo
places an outbound call with "ignore_early_media=true" THEN tone_detect does
not work on the A leg during the early media phase on leg B.

 

IF the A leg (with tone_detect enabled) is handed to mod_fifo AND mod_fifo
places an outbound call with "ignore_early_media=false" THEN tone_detect
does work. I guess this is because audio is being exchanged between A and B
legs.

 

Any idea what would cause the tone_detect to be "suspended" when mod_fifo is
in the mix?

Cheers,
-Slim
--
Jeroen C. "Slim" van Gelderen



  _____  

From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Jeroen
C. van Gelderen
Sent: Monday, October 11, 2010 03:13
To: 'FreeSWITCH Users Help'
Subject: Re: [Freeswitch-users] tone_detect vs. ignore_early_media (per
leg?)

 

Thank you for the quick response.

 

It looks like monitor_early_media_fail should do what I need (thanks for the
suggestion!) but I can't seem to make it work. See below for my uneducated
best guess why.

 

In my case the failure conditions from the GSM side are handled out-of-band
by SIP. That leaves only one failure condition I need to listen for in early
media (the Panasonic far-end hang up on FXO) which can successfully be
detected with:

 

  <action application="tone_detect" data="busy-pan 350,440 r 0 hangup>

 

This results in the following log entries:

 

[DEBUG] switch_ivr_async.c:2072 Adding tone spec 350,440 index 0 hits 1

[DEBUG] switch_core_media_bug.c:360 Attaching BUG to FreeTDM/4:1/

 

Translating tone_detect to monitor_early_media_fail I tried the following:

 

  <action application="set" data="result=${fifo_member(add fifo_helpdesk
{fifo_member_wait=nowait,ignore_early_media=true,monitor_early_media_fail=bu
sy-pan:1:350+440}sofia/internal/${caller_id_number}@192.168.3.11:5060)}"/>

 

This results in the following relevant log entries:

 

[DEBUG] switch_channel.c:2444 (sofia/internal/1876??????@192.168.3.11:5060)
Callstate Change RINGING -> EARLY

[DEBUG] switch_ivr_async.c:2072 Adding tone spec 350,440 index 0 hits 1

[DEBUG] switch_core_media_bug.c:360 Attaching BUG to
sofia/internal/1??????7693 at 192.168.3.11:5060

 

So Freeswitch is listening for the right tones (tone_spec present and
identical to the one used in tone_detect approach) but it isn't detecting
them. The obvious difference is in the BUG attachment.

 

Is it possible that BUG isn't listening to the right (A) leg in the case of
monitor_early_media_fail? Or is this too easy? :-)

Cheers,
-Slim
--
Jeroen C. "Slim" van Gelderen

  _____  

From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Michael
Collins
Sent: Sunday, October 10, 2010 19:01
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] tone_detect vs. ignore_early_media (per
leg?)

 

Check out monitor_early_media_fail:
http://wiki.freeswitch.org/wiki/Channel_Variables#monitor_early_media_fail

It is a hybrid of ignoring early media and listening to early media for
various conditions. In your case you'll need to play around with it. In your
case you need to figure out which early media scenarios count as a "fail"
and will cause processing to move on as if the call really did fail. 

Roll up your sleeves, you have some work to do. :)

-MC

On Sat, Oct 9, 2010 at 9:24 PM, Jeroen C. van Gelderen <slim at thegreek.com>
wrote:

Hi Guys,

I have a legacy Panasonic PBX which does not support CPC/Disconnect
Supervision. Calls from this PBX are sent to Freeswitch by way of
DAHDI/FreeTDM FXO ports (on a Xorcom Astribank). I use tone_detect to deal
with far-end hang-ups. This works fine:

<!-- Detect busy tone from Panasonic -->
<action application="tone_detect" data="busy 350,440 r 0 hangup 4"/>

Some calls from the Panasonic PBX are put in a FIFO and from there they are
sent to a SIP-to-GSM bridge (GoIP) to be terminated on one of 3 GSM phones
in a round-robin fashion.

The GSM bridge requires me to use "ignore_early_media=true" otherwise the
caller will receive messages like "the number you are calling does not
answer". When I set "ignore_early_media=true" the FIFO correctly keeps
hunting for a GSM phone that is actually answered and will ignore phones
that are busy, no-answer or turned off. This too works fine.

The problem occurs when the two are combined as follows:

Panasonic PBX --FXO--> Freeswitch --SIP--> GSM-bridge

If I enable ignore_early_media then tone_detect doesn't work UNTIL one of
the GSMs is answered. This is a problem when none of the GSMs are answered
and the Panasonic PBX hangs up. The FXO port will stay "up" and the FIFO
will keep hunting until it times out.

If I don't use "ignore_early_media=true" then tone_detect works fine but
then every telco message gets mistaken for an answered call and the hunting
stops early.

I tried changing this example line from my fifo.conf:

<member timeout="30" simo="1" lag="5">
{member_wait=nowait,ignore_early_media=true}sofia/internal/1??????7701 at 192.1
68.3.11:5060
</member>

to

<member timeout="30" simo="1" lag="5">
{member_wait=nowait}[ignore_early_media=true]sofia/internal/1??????7701 at 192.
168.3.11:5060
</member>

in a vain attempt to ignore early media on the SIP leg only. This doesn't
seem to do anything however.

Can anyone clue me in on what I'm missing? I've snipped the relevant
configuration bits below. I have the feeling I'm missing something obvious.

Cheers,
-Slim

----8<----8<----8<----8<----8<----

<configuration name="fifo.conf" description="FIFO Configuration">
 <settings>
   <param name="delete-all-outbound-member-on-startup" value="false"/>
 </settings>
 <fifos>
   <fifo name="cool_fifo@$${domain}" importance="0">

     <member timeout="30" simo="1" lag="5">
{member_wait=nowait,ignore_early_media=true}sofia/internal/1??????7701 at 192.1
68.3.11:5060</member>

     <member timeout="30" simo="1" lag="5">
{member_wait=nowait,ignore_early_media=true}sofia/internal/1??????7693 at 192.1
68.3.11:5060</member>

     <member timeout="30" simo="1" lag="5">
{member_wait=nowait,ignore_early_media=true}sofia/internal/1??????7698 at 192.1
68.3.11:5060</member>

   </fifo>
 </fifos>
</configuration>

----8<----8<----8<----8<----8<----

<include>
 <context name="pbx_test">

   <extension name="test1">
     <condition field="${freetdm_span_name}" expression="^span_fxo_test$">
       <action application="answer"/>

       <!-- Detect busy tone from Panasonic -->
       <action application="tone_detect" data="busy 350,440 r 0 hangup 4"/>

       <action application="playback"
data="ivr/ivr-hold_connect_call.wav"/>

       <action application="fifo" data="cool_fifo@$${domain} in"/>

     </condition>
   </extension>
 </context>
</include>

----8<----8<----8<----8<----8<----

Cheers,
-Slim
--
Jeroen C. "Slim" van Gelderen



_______________________________________________
FreeSWITCH-users mailing list
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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20101011/25a73f82/attachment-0001.html 


More information about the FreeSWITCH-users mailing list