Jonathan H
2018-Jul-28 21:08 UTC
[asterisk-users] Any way of "flattening out" 2 channels back into one?
Last question for today, I promise! The problem: In order to disconnect calls after x minutes, I need to do this: [setup] exten => setup,1,Answer() same => n,Set(LIMIT_PLAYAUDIO_CALLER=yes) same => n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en_GB_TNS/time_limit_reached) same => n,Dial(Local/s at root/n,3,L(3540000:60000)) same => n,Hangup() [root] exten => s,1,Verbose(1,Call to: ${CALLERID(name)} from: ${CALLERID(num)}) same => n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1) etc etc Works well, but the result is it looks like there are 2 active calls in the console. Is there any way of forcing the drop of a call after x minutes without doing this "double dialling" business? Thanks
Social Boh
2018-Jul-28 22:04 UTC
[asterisk-users] Any way of "flattening out" 2 channels back into one?
TIMEOUT function: example same => n,Set(TIMEOUT(absolute)=600) after 600 seconds Asterisk Hankup the call Regards --- I'm SoCIaL, MayBe On 7/28/18 16:08, Jonathan H wrote:> Last question for today, I promise! > > The problem: In order to disconnect calls after x minutes, I need to do this: > > [setup] > exten => setup,1,Answer() > same => n,Set(LIMIT_PLAYAUDIO_CALLER=yes) > same => n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en_GB_TNS/time_limit_reached) > same => n,Dial(Local/s at root/n,3,L(3540000:60000)) > same => n,Hangup() > > [root] > exten => s,1,Verbose(1,Call to: ${CALLERID(name)} from: ${CALLERID(num)}) > same => n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1) > > etc etc > > Works well, but the result is it looks like there are 2 active calls > in the console. Is there any way of forcing the drop of a call after x > minutes without doing this "double dialling" business? > > Thanks >
Jonathan H
2018-Jul-28 22:07 UTC
[asterisk-users] Any way of "flattening out" 2 channels back into one?
Oh... I looked at that before, but I don't see how to play a warning before the caller is disconnected with TIMEOUT? On Sat, 28 Jul 2018 at 23:05, Social Boh <social at bohboh.info> wrote:> > TIMEOUT function: > > example > > same => n,Set(TIMEOUT(absolute)=600) > > after 600 seconds Asterisk Hankup the call > > Regards > > --- > I'm SoCIaL, MayBe > > On 7/28/18 16:08, Jonathan H wrote: > > Last question for today, I promise! > > > > The problem: In order to disconnect calls after x minutes, I need to do this: > > > > [setup] > > exten => setup,1,Answer() > > same => n,Set(LIMIT_PLAYAUDIO_CALLER=yes) > > same => n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en_GB_TNS/time_limit_reached) > > same => n,Dial(Local/s at root/n,3,L(3540000:60000)) > > same => n,Hangup() > > > > [root] > > exten => s,1,Verbose(1,Call to: ${CALLERID(name)} from: ${CALLERID(num)}) > > same => n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1) > > > > etc etc > > > > Works well, but the result is it looks like there are 2 active calls > > in the console. Is there any way of forcing the drop of a call after x > > minutes without doing this "double dialling" business? > > > > Thanks > > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Richard Mudgett
2018-Jul-29 13:16 UTC
[asterisk-users] Any way of "flattening out" 2 channels back into one?
On Sat, Jul 28, 2018 at 4:08 PM, Jonathan H <lardconcepts at gmail.com> wrote:> Last question for today, I promise! > > The problem: In order to disconnect calls after x minutes, I need to do > this: > > [setup] > exten => setup,1,Answer() > same => n,Set(LIMIT_PLAYAUDIO_CALLER=yes) > same => n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en_GB_TNS/ > time_limit_reached) > same => n,Dial(Local/s at root/n,3,L(3540000:60000)) > same => n,Hangup() > > [root] > exten => s,1,Verbose(1,Call to: ${CALLERID(name)} from: ${CALLERID(num)}) > same => n,Set(CHANNEL(hangup_handler_push)=hdlr1,s,1) > > etc etc > > Works well, but the result is it looks like there are 2 active calls > in the console. Is there any way of forcing the drop of a call after x > minutes without doing this "double dialling" business? >Heh. This is similar to the example given describing local channel optimization [1] and what happens to state information on those channels when local channels optimize out. The "call" counter you mention from the CLI "core show channels" output is an approximation and is not very accurate. Asterisk has no concept of what a "call" is. That counter simply counts the number of channels that started PBX's to execute dialplan normal. In your dialplan you have two channels that do this and thus two "calls" are counted. If you want to eliminate the "double dialing" business avoid using local channels. Have your incoming PJSIP channels call other PJSIP channels directly. Or you can make it so the local channels can optimize themselves out. Remember you cannot have state information stored on an optimizing local channel as that information goes away when the local channels optimize out. The Dial 'L' option currently puts state on the caller and called channels depending on which features are configured (who hears things). If you set the verbose level to 4 you get information in the log about that. Richard [1] https://wiki.asterisk.org/wiki/display/AST/Local+Channel+Optimization -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180729/52268d88/attachment.html>