[asterisk-bugs] [Asterisk 0011282]: [patch] New Application to take control of applications executed on a channel from the AMI or Console

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Nov 23 11:03:27 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11282 
====================================================================== 
Reported By:                moy
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11282
Category:                   Applications/NewFeature
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 89394 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             11-17-2007 23:09 CST
Last Modified:              11-23-2007 11:03 CST
====================================================================== 
Summary:                    [patch] New Application to take control of
applications executed on a channel from the AMI or Console
Description: 
This new application allow to take control of the applications executed
using the Asterisk console or via AMI.

[default]
exten => _X.,1,Answer()
exten => _X.,2,DynamicApp()
exten => _X.,3,Hangup()

Once the channel enter DynamicApp, it will wait there for applications to
execute. Applications may arrive either from the console or AMI, like
this:

*CLI> dynapp SIP/testing-09124338 Playback hello-world

That will execute Playback application with hello-world arguments.

The same using AMI:

Action: AddDynApp
Channel: SIP/testing-09124338
App: Playback
Data: hello-world

I need some help of you guys to check locking/unlocking of channels, I
think I am doing right, but I am still unsure about some cases. It seems to
work though.

Comments and corrections are always welcomed.
====================================================================== 

---------------------------------------------------------------------- 
 moy - 11-23-07 11:03  
---------------------------------------------------------------------- 
After trying to use heavily app_dynapp to do some stuff I was used to do
with MAGI, I found several limitations ( not being able to query variables,
get execution notification with ID etc ). So I changed my mind, and
implemented an Asynchronous AGI. This is pretty much a new implementation
of David Pollak's idea of integrating AGI and the manager. I just
implemented it using channel datastores to avoid patching the core and keep
the changes mostly in res/res_agi.c.

So here is the idea.

You can send calls to AGI(agi:async). That will put the call to wait for
commands and it will send an event to the manager with the same data an AGI
script receives. Now the manager can start sending AGI commands using the
channel name and a command id. When the AGI command is executed, an event
with the command id is launched with the result of the AGI command. AGI
data is urlencoded for easy management and avoid it to interfer with the
manager protocol, just in case.

Additionally you can also execute AGI commands from the Asterisk console:

  tcore*CLI> agi exec SIP/testing-09a5b960 "EXEC startmusiconhold"
  tcore*CLI> agi exec SIP/testing-09a5b960 "EXEC stopmusiconhold"
  tcore*CLI> agi exec SIP/testing-09a5b960 "EXEC Dial(Agent/23)"

This means one could actually implement a queue using the manager. You can
receive calls and put them in AGI(agi:async) and put them on hold. When you
get some event of an Agent being free to receive calls, the manager can
stop the music on hold and execute Dial to send the call, etc etc.

The CLI feature is mostly useful only for testing.

So, can somebody delete the app_dynapp patch and consider the asyncagi
patch only.

Thanks! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-23-07 11:03  moy            Note Added: 0074236                          
======================================================================




More information about the asterisk-bugs mailing list