[Freeswitch-users] Send call to different place on busy vs no answer

Steven Schoch schoch+freeswitch.org at xwin32.com
Fri Apr 9 19:12:30 UTC 2021


As I understand the XML dialplan, when a matching condition is found, it
builds up a list of actions and executes them in order.
So I assume my list of actions would be to bridge to the phones, then
transfer to another extension which would look at the
${originate_dispostion}:

Like:
... Set timeouts ...
  <action application="bridge" data="${group_call(operator@
${domain_name})}"/>
  <action application="transfer" data="front_desk_no_answer">
</extension>

<extension name="front_desk_no_answer">
  <condition field="destination_number"
expression="^front_desk_no_answer$"/>
    <action application="answer"/>
    <action application="sleep" data="500"/>
  <condition field="${originate_disposition}" data="USER_BUSY">
      <action application="say" ..
      <anti-action application="voicemail" ...
  </condition>
</extension>

Does that look like what I need?

-- 
Steve

On Wed, Apr 7, 2021 at 9:18 AM Martin Paterson <martin at pattersong.co.uk>
wrote:

> Steven,
>
> You can check the originate_disposition variable to get the result of
> the bridge, then based on that run the voicemail app or play the
> message. It is possible to do this in the dialplan, something like:
> <condition field="${originate_disposition}" data="USER_BUSY">
>   <action application="say" ..
>   <anti-action application="voicemail" ...
>
> but I find any logic even slightly more complex than 'if this do that'
> in the XML is unreadable because of having to worry about
> require-nested, break and inline and reach for the lua:
> if session:ready() then
>   originate_disposition = session:getVariable("originate_disposition")
>   if originate_disposition == 'USER_BUSY' then
> play message
>   else if originate_disposition == 'ALLOTTED_TIMEOUT' then
> do voicemail
>   else
>     session:consoleLog("INFO", "unhandled disposition" ..
> tostring(originate_disposition) .. "\n")
>     .. do something sensible (like voicemail)
> end
>
> Martin.
>
> Martin Paterson, Pattersong Music
> Reduced orchestrations of G&S
>
> On Wed, 7 Apr 2021 at 06:41, Steven Schoch
> <schoch+freeswitch.org at xwin32.com> wrote:
> >
> > I'm setting up a pbx. Incoming calls to the main number will ring on 3
> "front desk" phones. If all phones are busy, I want to play a message
> saying:
> > "All operators are busy. Please call back in a few minutes or send
> email."
> >
> > However, if the call rings for 20 seconds with no answer, it should
> transfer to voicemail.
> >
> > My dialplan has:
> > <action application="set" data="continue_on_fail=true"/>
> > <action application="set" data="call_timeout=20"/>
> > <action application="bridge" data="${group_call(operator@
> ${domain_name})}"/>
> > <action application="answer"/>
> > <action application="sleep" data="1000"/>
> > <action application="???"/>
> >
> > The last application should be to do one thing (play a message) if the
> bridge failed because all phones were busy, and do something else (transfer
> to voicemail) if there was no answer after 20 seconds.
> >
> > Is this something that can be done in the dialplan? If not, do I use a
> script?
> >
> > --
> > Steve
> > _________________________________________________________________________
> >
> > The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> > Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> > Build your next product on our scalable cloud platform.
> >
> > Join our online community to chat in real time
> https://signalwire.community
> >
> > Professional FreeSWITCH Services
> > sales at freeswitch.com
> > https://freeswitch.com
> >
> > Official FreeSWITCH Sites
> > https://freeswitch.com/oss
> > https://freeswitch.org/confluence
> > https://cluecon.com
> >
> > 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
> > https://freeswitch.com
>
> _________________________________________________________________________
>
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
>
> Join our online community to chat in real time
> https://signalwire.community
>
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
>
> 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
> https://freeswitch.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20210409/d9c38171/attachment.html>


More information about the FreeSWITCH-users mailing list