[Freeswitch-users] How to generate A-leg simulated ringing.

Keith Laaks keithl at voxtelecom.co.za
Tue Sep 25 16:04:15 PDT 2007


Hi All,

I have tried to use freeswitch to do a 'call-back' type of feature like
this:

a) I issue via xmlrpc (or eventsocket) an 'originate'. Freeswitch places
SIP call to destination specified (let's call this leg-A).
b) As soon as A answers, freeswitch hits a specified context, with the
following xml:

  <extension name="eventsocket_xentry">
     <condition field="${xtrigger}" expression="9876"/>
     <!--This variable is set in the originate command - so the
condition is only met when called via that interface-->
     <condition field="destination_number"
expression="^1((1|2|3|4|5|7|8)\d.*)$">
        <action application="sleep" data="600"/>
        <action application="set" data="wkl_bridge_target=$0"/> <!--
This is the number to be bridged to later on! -->
        <action application="playback" data="/fs/core/beep.G729"/>
        <action application="sleep" data="600"/>
        <action application="ivr" data="verifyhumanbeing"/> <!-- Do the
IVR where we confirm real person answering -->
                                                            <!-- The IVR
fails and hangs up the A-leg if no response -->
    </condition>
  </extension>

  <extension name="postkeypress">  <!-- If in the above ivr the called
party presses '4' then the ivr jumps to this extension-->
     <condition field="destination_number" expression="postkeypress">
        <action application="playback" data="/fs/core/vm-dialout.G729"/>

        <action application="set"
data="ringback=/fs/core/niceringsound.G729"/>

        <action application="set" data="continue_on_fail=true"/> <!--
Dialplan continue processing on called party busy/offline.-->

        <action application="set" data="export_vars=ringback"/>  
        <action application="set"
data="bridge_pre_execute_bleg_app=ringback"/> <!-- With or without no
sound on A-leg. What does this do? -->
        <action application="bridge"
data="sofia/profile_provider/${wkl_bridge_target}@111.222.333.444:5060"/
>

        <action application="playback" data="/fs/core/beeperr.G729"/>
        <action application="playback" data="/fs/core/vm-goodbye.G729"/>
     </condition>
  </extension>


c) On answer, A hears a beep-tone, an IVR message asking him to enter
digit.
d) On detecting the digit being pressed, the IVR 'action' is to go to
the 'postkeypress' extension.
e) A then hears a message about 'Please wait while I place your call'.

Up to this point everything works as expected.

f) Freeswitch then starts the 'bridge' by calling a destination number
(say B) passed as xmlrpc originate parameter, routed via the specified
SIP provider.

PROBLEM:

Although the SIP provider does actually provide in-band progress tones,
on the A side there is total silence until B answers
(or if that leg fails, the tone and goodbye message).


I have tried various combinations of 'ringback' related application, but
can't find a way of getting some audio being played back to the A leg
(not that part of the call is already answered at this point)
concurrently with the B-leg awaiting answer. 

If there is some way of doing this, or fixing the above 'challenge',
please help.

Note that since my SIP providers all only do G.729, I have some
limitations. Not sure if the conference feature will be useful without a
proper Alaw to G729 transcoder.


Thanks in advance for any assistance.

Best Regards

Keith







More information about the FreeSWITCH-users mailing list