[Freeswitch-users] Originate and bridge with lua

Nik Middleton nik.middleton at noblesolutions.co.uk
Wed Feb 18 13:27:54 PST 2009


Hi Michael,

Yes that's exactly what it boils down to, an outbound ivr.

Everything is working perfectly, except the bridge to another number.
Because of the nature of the beast the bridge needs to dial an external
number (ie  sofia/gateway/Mygateway/num)  What I'm getting is: 

attempt to perform arithmetic on global 'sofia' (a nil value)

regards


-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of
Michael Collins
Sent: 18 February 2009 21:09
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Originate and bridge with lua

On Wed, Feb 18, 2009 at 11:53 AM, Nik Middleton
<nik.middleton at noblesolutions.co.uk> wrote:
> I'm trying to build an emergency broadcasting solution.
>
> So I place a call, and have ivr in the lua script.  But I also want to
> give them the option of speaking to someone.
>
> If they hit the option to speak to someone, while I can fire an event
to
> originate a call, I'm not sure how I could bridge the 2 call legs.
>
> Regards,

So really, it's just an outbound IVR, no? Just for a specific purpose.

I would recommend using the event socket and bgapi originate commands
from a central program/script/controller thingy. Generate the calls
and then drop them into a dialplan or script that controls them. I
like to use the dialpan but it really does not matter. Using a script
lets you make changes without doing a reloadxml command.

In any case, your originate commands could be something like this:

bgapi originate
{myvar='myval',myvar2='myval2'}sofia/gateway/mygateway/user at domain
5555

Have extension 5555 do the gruntwork of confirming that you actually
had a successful call, got a human on the line, etc. It can also
handle failures that are not handled by the originate itself. (Depends
on whether or not you ignore early media.) In any case, you've got a
single dp entry that handles the mundane call handling. Then, if there
is a human on the line, you can do something like this:

<action application="lua" data="ivr_start.lua ${myval} ${myval2}"/>

Now you can write a plain Lua script that only has to handle the
delivery of the message. You can handle a DTMF event and the callback
function could use session:execute("bridge","agent") to connect the
called party with your agent.

Hope that helps.
-MC

_______________________________________________
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




More information about the FreeSWITCH-users mailing list