[Freeswitch-users] sched_hangup update within active call

Kamil Nigmatullin kamil.nigmatullin at gmail.com
Sat Jun 13 22:05:48 MSD 2015


If I were you I would do the following: As user hits dialplan you call lua
which calls instructions (e.g in JSON) with curl and process this call with
sched_hangup. In the same dialplan you create hangup_hook that leads to
another lua which bills your call. That's it. Simple and relible. And if
you need originate from FS (if you do callback, for example) it is simpler
to use API.

2015-06-12 19:51 GMT+06:00 Vlad Fabi <vaad.fabi at gmail.com>:

> As i said before, i am looking for a multi session per one account
> (balance) billing scheme. I think better way is to catch events (call init
> and call hangup) from FS with Outbound Event Socket Server.
> Scripts\curl modules are quite good for call origination, but hangup
> procedure (run some command\action after channel hangup) have some
> problems, as i remember.
> So, i think the best solution for me is curl modules for call origination
> (to get dialplan) and for call hangup catch events, which affect other
> sessions duration recalculation. But full control with Outbound Event
> Socket Server is more elegant solution with it higload, stuck calls, anysc
> code and etc. problems.
>
>
> On Fri, Jun 12, 2015 at 11:51 AM, Kamil Nigmatullin <
> kamil.nigmatullin at gmail.com> wrote:
>
>> If you think of Monitoring of FS I think Outbound is not what you are
>> looking for. It is more for giving orders from external program than
>> monitoring what is going on there. You will get only that info that you are
>> subscribed for.  And also async programing of external program is also not
>> easy. Each time you have to fetch state from database and deside what to
>> do. I think hybrid scheme is simplier and much more easier to implement and
>> debug.
>>
>> When I did that was fs 1.2 and maybe everything has changed now.
>>
>> 2015-06-12 13:28 GMT+06:00 Vlad Fabi <vaad.fabi at gmail.com>:
>>
>>> Thx for this useful info.
>>>
>>> On Fri, Jun 12, 2015 at 1:42 AM, Stanislav Sinyagin <ssinyagin at gmail.com
>>> > wrote:
>>>
>>>> I added an explanation to Confluence:  https://goo.gl/WbKTH0
>>>>
>>>>
>>>>
>>>> On Wed, Jun 10, 2015 at 12:59 PM, Kamil Nigmatullin
>>>> <kamil.nigmatullin at gmail.com> wrote:
>>>> > Stanislav, IT IS possible to make call longer by using sched_del and
>>>> fire
>>>> > agian sched_hangup.
>>>> >
>>>> > This is the peace of code that works for me.
>>>> >
>>>> >
>>>> > var cmd = 'sched_del '+ channel;
>>>> >
>>>> > client.conn.bgapi(cmd, function(event){
>>>> >   cmd = "sched_hangup +"+ timeout + " " + channel;
>>>> >   client.conn.bgapi(cmd, function(event){
>>>> >       console.log(event.getBody());
>>>> >   });
>>>> > });
>>>> >
>>>> >
>>>> > 2015-06-10 15:00 GMT+06:00 Kamil Nigmatullin <
>>>> kamil.nigmatullin at gmail.com>:
>>>> >>
>>>> >> Yes, maybe, I didn't try make it longer.
>>>> >>
>>>> >> 2015-06-10 14:37 GMT+06:00 Stanislav Sinyagin <ssinyagin at gmail.com>:
>>>> >>>
>>>> >>> well, you're anyway already sending some commands to set or change
>>>> the
>>>> >>> scheduler, so why not also stopping the calls from external
>>>> >>> application.
>>>> >>>
>>>> >>> The current API only allows adding and removing tasks -- you can
>>>> >>> search through the source code yourself. There's no such function as
>>>> >>> modifying an existing scheduled task.
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> On Wed, Jun 10, 2015 at 9:46 AM, Vlad Fabi <vaad.fabi at gmail.com>
>>>> wrote:
>>>> >>> > 2 Stanislav Sinyagin,
>>>> >>> > This mean you should need additionaly scheduler application at
>>>> external
>>>> >>> > side, that controls active calls durations updates and send only
>>>> >>> > session
>>>> >>> > kill to FS. I think such functionality is better to processed by
>>>> FS
>>>> >>> > side.
>>>> >>> >
>>>> >>> > 2 Kamil Nigmatullin,
>>>> >>> > Maybe you remember some keywords ?
>>>> >>> >
>>>> >>> > On Wed, Jun 10, 2015 at 5:26 AM, Kamil Nigmatullin
>>>> >>> > <kamil.nigmatullin at gmail.com> wrote:
>>>> >>> >>
>>>> >>> >> I dont remember how this variable was called but there was
>>>> defenetly
>>>> >>> >> the
>>>> >>> >> way to reschedule hangup during call via esl.
>>>> >>> >>
>>>> >>> >> 10 июня 2015 г. 3:03 пользователь "Stanislav Sinyagin"
>>>> >>> >> <ssinyagin at gmail.com> написал:
>>>> >>> >>
>>>> >>> >>> you can control your calls from an external application via ESL
>>>> and
>>>> >>> >>> do
>>>> >>> >>> uuid_kill when needed. Then you don't have to rely on timers
>>>> inside
>>>> >>> >>> FreeSWITCH.
>>>> >>> >>>
>>>> >>> >>> On Tue, Jun 9, 2015 at 10:23 PM, Vlad Fabi <vaad.fabi at gmail.com
>>>> >
>>>> >>> >>> wrote:
>>>> >>> >>> > As a workaround it's ok, but for production billing solution
>>>> not
>>>> >>> >>> > sure...
>>>> >>> >>> > Anyway thx for help
>>>> >>> >>> >
>>>> >>> >>> > On Tue, Jun 9, 2015 at 7:34 PM, Dušan Dragić
>>>> >>> >>> > <dragic.dusan at gmail.com>
>>>> >>> >>> > wrote:
>>>> >>> >>> >>
>>>> >>> >>> >> There isn't a way to increase or decrease the time but you
>>>> can
>>>> >>> >>> >> delete
>>>> >>> >>> >> the scheduled task with sched_del (find the task id with show
>>>> >>> >>> >> tasks)
>>>> >>> >>> >> and recreate it with sched_hangup.
>>>> >>> >>> >>
>>>> >>> >>> >> On 9 June 2015 at 16:01, Vlad Fabi <vaad.fabi at gmail.com>
>>>> wrote:
>>>> >>> >>> >> > Hi all,
>>>> >>> >>> >> > Is it possible during active call with set sched_hangup
>>>> value
>>>> >>> >>> >> > change
>>>> >>> >>> >> > this
>>>> >>> >>> >> > value to increase\decrease active call duration ?  Or maybe
>>>> >>> >>> >> > there is
>>>> >>> >>> >> > another
>>>> >>> >>> >> > elegant solution to manipulate active call duration.
>>>> >>> >>> >> >
>>>> >>> >>> >> > Thx
>>>> >>> >>> >> >
>>>> >>> >>> >> >
>>>> >>> >>> >> >
>>>> >>> >>> >> >
>>>> >>> >>> >> >
>>>> _________________________________________________________________________
>>>> >>> >>> >> > Professional FreeSWITCH Consulting Services:
>>>> >>> >>> >> > consulting at freeswitch.org
>>>> >>> >>> >> > http://www.freeswitchsolutions.com
>>>> >>> >>> >> >
>>>> >>> >>> >> > Official FreeSWITCH Sites
>>>> >>> >>> >> > http://www.freeswitch.org
>>>> >>> >>> >> > http://confluence.freeswitch.org
>>>> >>> >>> >> > http://www.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
>>>> >>> >>> >> > http://www.freeswitch.org
>>>> >>> >>> >>
>>>> >>> >>> >>
>>>> >>> >>> >>
>>>> >>> >>> >> --
>>>> >>> >>> >> Dušan Dragić
>>>> >>> >>> >>
>>>> >>> >>> >>
>>>> >>> >>> >>
>>>> >>> >>> >>
>>>> _________________________________________________________________________
>>>> >>> >>> >> Professional FreeSWITCH Consulting Services:
>>>> >>> >>> >> consulting at freeswitch.org
>>>> >>> >>> >> http://www.freeswitchsolutions.com
>>>> >>> >>> >>
>>>> >>> >>> >> Official FreeSWITCH Sites
>>>> >>> >>> >> http://www.freeswitch.org
>>>> >>> >>> >> http://confluence.freeswitch.org
>>>> >>> >>> >> http://www.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
>>>> >>> >>> >> http://www.freeswitch.org
>>>> >>> >>> >
>>>> >>> >>> >
>>>> >>> >>> >
>>>> >>> >>> >
>>>> >>> >>> >
>>>> >>> >>> >
>>>> _________________________________________________________________________
>>>> >>> >>> > Professional FreeSWITCH Consulting Services:
>>>> >>> >>> > consulting at freeswitch.org
>>>> >>> >>> > http://www.freeswitchsolutions.com
>>>> >>> >>> >
>>>> >>> >>> > Official FreeSWITCH Sites
>>>> >>> >>> > http://www.freeswitch.org
>>>> >>> >>> > http://confluence.freeswitch.org
>>>> >>> >>> > http://www.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
>>>> >>> >>> > http://www.freeswitch.org
>>>> >>> >>>
>>>> >>> >>>
>>>> >>> >>>
>>>> _________________________________________________________________________
>>>> >>> >>> Professional FreeSWITCH Consulting Services:
>>>> >>> >>> consulting at freeswitch.org
>>>> >>> >>> http://www.freeswitchsolutions.com
>>>> >>> >>>
>>>> >>> >>> Official FreeSWITCH Sites
>>>> >>> >>> http://www.freeswitch.org
>>>> >>> >>> http://confluence.freeswitch.org
>>>> >>> >>> http://www.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
>>>> >>> >>> http://www.freeswitch.org
>>>> >>> >>
>>>> >>> >>
>>>> >>> >>
>>>> >>> >>
>>>> _________________________________________________________________________
>>>> >>> >> Professional FreeSWITCH Consulting Services:
>>>> >>> >> consulting at freeswitch.org
>>>> >>> >> http://www.freeswitchsolutions.com
>>>> >>> >>
>>>> >>> >> Official FreeSWITCH Sites
>>>> >>> >> http://www.freeswitch.org
>>>> >>> >> http://confluence.freeswitch.org
>>>> >>> >> http://www.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
>>>> >>> >> http://www.freeswitch.org
>>>> >>> >
>>>> >>> >
>>>> >>> >
>>>> >>> >
>>>> >>> >
>>>> _________________________________________________________________________
>>>> >>> > Professional FreeSWITCH Consulting Services:
>>>> >>> > consulting at freeswitch.org
>>>> >>> > http://www.freeswitchsolutions.com
>>>> >>> >
>>>> >>> > Official FreeSWITCH Sites
>>>> >>> > http://www.freeswitch.org
>>>> >>> > http://confluence.freeswitch.org
>>>> >>> > http://www.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
>>>> >>> > http://www.freeswitch.org
>>>> >>>
>>>> >>>
>>>> _________________________________________________________________________
>>>> >>> Professional FreeSWITCH Consulting Services:
>>>> >>> consulting at freeswitch.org
>>>> >>> http://www.freeswitchsolutions.com
>>>> >>>
>>>> >>> Official FreeSWITCH Sites
>>>> >>> http://www.freeswitch.org
>>>> >>> http://confluence.freeswitch.org
>>>> >>> http://www.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
>>>> >>> http://www.freeswitch.org
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> Kamil Nigmatullin
>>>> >> Tel: 77272323748
>>>> >> mob: 7 (707) 2517003
>>>> >> Skype: kamil.nigmatullin
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Kamil Nigmatullin
>>>> > Tel: 77272323748
>>>> > mob: 7 (707) 2517003
>>>> > Skype: kamil.nigmatullin
>>>> >
>>>> >
>>>> _________________________________________________________________________
>>>> > Professional FreeSWITCH Consulting Services:
>>>> > consulting at freeswitch.org
>>>> > http://www.freeswitchsolutions.com
>>>> >
>>>> > Official FreeSWITCH Sites
>>>> > http://www.freeswitch.org
>>>> > http://confluence.freeswitch.org
>>>> > http://www.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
>>>> > http://www.freeswitch.org
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>>
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://confluence.freeswitch.org
>>>> http://www.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
>>>> http://www.freeswitch.org
>>>>
>>>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.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
>>> http://www.freeswitch.org
>>>
>>
>>
>>
>> --
>> Kamil Nigmatullin
>> Tel: 77272323748
>> mob: 7 (707) 2517003
>> Skype: kamil.nigmatullin
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.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
>> http://www.freeswitch.org
>>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.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
> http://www.freeswitch.org
>



-- 
Kamil Nigmatullin
Tel: 77272323748
mob: 7 (707) 2517003
Skype: kamil.nigmatullin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150614/31aeb19f/attachment-0001.html 


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