[Freeswitch-users] tone_detect vs. ignore_early_media (per leg?)

Jeroen C. van Gelderen slim at thegreek.com
Mon Oct 11 01:12:34 PDT 2010


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/01787409/attachment-0001.html 


More information about the FreeSWITCH-users mailing list