[Freeswitch-users] Call back through SIP trunk

Michael Collins msc at freeswitch.org
Tue Jan 6 19:42:33 MSK 2015


Hi Sina,

Were you able to figure this one out? Also, I didn't see anywhere in this
thread what the outbound leg would be connected to. For example, when you
call out to the caller ID number received on the initial call, what will
the other leg be connected to? Do you have a user or an IVR or what? Just
curious. You can't make an outbound call without connecting that leg to
something.

-MC

On Fri, Jan 2, 2015 at 4:22 PM, Sina Owolabi <notify.sina at gmail.com> wrote:

> Hi Avi
>
> I'm really sorry to bother you offlist again, but I am really, really
> stumped.
> This is my first time with lua or any kind of coding and I am
> scrambling to make amends for that.
>
> Could you please help me with some kind of example script I can use for
> this?
>
> On Thu, Jan 1, 2015 at 2:09 PM, Avi Marcus <avi at avimarcus.net> wrote:
> > Once you hangup, unless you have zombie exec, the call ends and it won't
> > transfer nor execute the lua script.
> >
> > Also, if you have the lua do the hangup, it can directly access all the
> > channel variables itself.
> >
> > Alternatively, you can set a hangup hook and pass everything:
> > <action application="set" data="api_hangup_hook=lua callback.lua
> > ${effective_caller_id_number} ${destination_number}"/>
> >
> > -Avi
> >
> > On Thu, Jan 1, 2015 at 2:12 PM, Sina Owolabi <notify.sina at gmail.com>
> wrote:
> >>
> >> Avi,
> >>
> >> thanks and happy new year!
> >> I'm trying to  using a public extension to receive the call, hangup
> >> and transfer to the extension that is actually doing the lua'ing (so
> >> to speak):
> >>
> >> <extension name="callback-caller1">
> >>     <condition field="${caller_id_number}"
> >> expression="^0(\d{10})$"require-nested="false">
> >>        <action application="set"
> >> data="effective_caller_id_number=+123${1}"/>
> >>        <action application="set"
> >> data="effective_caller_id_name=+123${1}"/>
> >>     </condition>
> >>     <condition field="destination_number" expression="^0123456(7)(8)$">
> >>       <action application="ring_ready" />
> >>       <action application="sleep" data="3000"/>
> >>       <action application="set" data="ringback=%(2000, 4000, 440.0,
> >> 480.0)"/>
> >>       <action application="hangup" />
> >>       <action application="transfer" data="1213 XML default"/>
> >>    </condition>
> >>
> >> <extension name="1213">
> >>      <condition field="destination_number" expression="^1213$">
> >>         <action application="lua" data="callback.lua
> >> ${effective_caller_id_number} ${destination_number}"/>
> >>      </condition
> >>
> >> Please is this the proper way to collect data from the first leg to
> >> pass to the lua script?
> >>
> >> On Wed, Dec 31, 2014 at 6:36 PM, Avi Marcus <avi at avimarcus.net> wrote:
> >> > I've used a lua script to grab the information (and make sure it's a
> >> > valid
> >> > callback), hangup, and then run:
> >> >
> >> > freeswitch.msleep(2000); --wait 2 seconds to make sure their side will
> >> > actually have the call over
> >> > api = freeswitch.API()
> >> > api:execute("originate", your-dialstring)
> >> >
> >> > -Avi
> >> >
> >> > On Wed, Dec 31, 2014 at 11:37 AM, Sina Owolabi <notify.sina at gmail.com
> >
> >> > wrote:
> >> >>
> >> >> Hi List!
> >> >>
> >> >>
> >> >> FreeSWITCHNewbie here.
> >> >> Please can I have some guidance on how to setup call back?
> >> >>
> >> >> I would like to be able to dial the DID attached to the SIP trunk
> >> >> Freeswitch is registered to, and then have freeSWITCH hang up the
> call
> >> >> and dial the caller id number back through any other SIP trunk
> >> >> FreeSWITCH Is registered with, but with the origination number set to
> >> >> the DID that the first call came through in the first place.
> >> >>
> >> >> Please is this possible just through the dial plan?
> >> >>
> >> >> Thanks for any help!
> >> >>
> >> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150106/eab1be82/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list