[Freeswitch-users] Hangup and wait for connection after dialed extension is busy.

mayamatakeshi mayamatakeshi at gmail.com
Thu Oct 21 10:12:26 UTC 2021

On Thu, Oct 21, 2021 at 10:03 AM mayamatakeshi <mayamatakeshi at gmail.com>

> On Wed, Oct 20, 2021 at 11:14 PM PaweĊ‚ Femur Wojtal <freeswitch at femur.pl>
> wrote:
>> Hello!
>> Imagine the situation.
>> I call internal extension. It is busy. So I press *0 and hangup. When
>> leg B finishes its connection, freeswitch calls us both and bridges.
>> How do I get such functionality? I will be grateful for any suggestion.
> Maybe someone knows an easier way but if I needed something like this, I
> would try:
>   - send the call to a lua script after the bridge fails due to BUSY
> (channel variable last_bridge_hangup_cause==USER_BUSY)
>   - ask the user to confirm if he/she wants to get a callback
>   - if yes, find the UUID of the extension call. This could be obtained
> from channel variables (probably originate_signal_bond or originated_legs)
> if not, I would use Freeswitch.dbh (
> https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference)
> to search for the extension that is busy.

Sorry, actually, you cannot use the channel variables to find the UUID as
they would be for the Leg B you just attempted. You need to find the UUID
of the active call that is making the extension B busy.
So you need to use freeswitch.dbh.

>   - set a hangup hook to be execute when the extension call terminates (
> https://freeswitch.org/confluence/display/FREESWITCH/api_hangup_hook)
>   - the hook would be a lua script that would make the callback to you and
> after answer try to call the extension.
> obs:
>   - if the hangup hook fails to be set, it could be because the call ended
> while we were doing the processing so I would execute the callback right
> away).
>   - in the callback, before calling the extension I would ask for
> confirmation again as by that time you might not want to call the extension
> anymore
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20211021/cae7fdeb/attachment.html>

More information about the FreeSWITCH-users mailing list