|Summary:||ASTERISK-13936: [patch] New dialplan application that tell Asterisk to not generate/send Manager Event for the current call|
|Reporter:||Joel Vandal (jvandal)||Labels:|
|Date Opened:||2009-04-10 10:28:50||Date Closed:||2009-11-02 08:51:01.000-0600|
|Environment:||Attachments:||( 0) app_manager-1.4.c|
( 1) app_manager-1.6.c
( 2) noami-1.4.diff
( 3) noami-1.6.diff
|Description:||We heavily use Asterisk Manager Interface (AMI) to get events and in some call scenarios, like using Page application to dial 300 local channel, we receive lots of events that we want to ignore.|
I have add a new NoAMI() dial plan application that tell Asterisk to not generate/send Manager Event for the current call.
By example :
exten => s,1,NoAMI()
exten => s,n,NoCDR()
exten => s,n,Page(Local/101@paging&Local/102@paging&Local/1-3@paging&...)
exten => s,n,Hangup
****** ADDITIONAL INFORMATION ******
-= Info about application 'NoAMI' =-
Tell Asterisk to not send Manager Event for the current call
NoAMI(): This application will tell Asterisk not to send Manager Event for the
|Comments:||By: Joel Vandal (jvandal) 2009-04-10 10:31:03|
Currently, the patch is based on Asterisk 188.8.131.52 but will provide patch for SVN branches/1.6.
Will upload patches in few hours.
By: Tilghman Lesher (tilghman) 2009-04-10 10:48:07
Actually, patches should be against trunk, not any of the release branches.
By: Joel Vandal (jvandal) 2009-04-10 11:05:26
Ok, if I provide a patch based on latest update of http://svn.digium.com/svn/asterisk/trunk this will be ok ?
By: Tilghman Lesher (tilghman) 2009-04-10 11:38:16
Yes, latest trunk would be good.
By: Joel Vandal (jvandal) 2009-04-10 11:46:17
ok, new patch (noami-1.6.diff and app_manager-1.6.c) are based on latest trunk.
By: Clod Patry (junky) 2009-04-12 23:01:59
+ if (c->send_manager) everywhere,
don't you think that will be easier and more manageable in long term to have it directly in the manager_event() ?
You also should use channel instead of call, since this is only for channel, not the call.
Tell Asterisk to not send Manager Event for the current *call*.
By: Joel Vandal (jvandal) 2009-04-13 17:11:11
junky, Any hints on how to do this, the manager_event function has no "knowledge" about the channel.
The only way I see is to parse and extract 'Channel:' from the event variable, and loop through all available channel... or maybe add 'channel' support on manager_event function.
Please note, my C knowledge are very basic.
By: Leif Madsen (lmadsen) 2009-04-14 07:19:00
Assigned to junky for now to comment; please set this back to 'confirmed' and unassign yourself once done. Thanks!
By: Joel Vandal (jvandal) 2009-04-15 20:37:22
I have set ' ... for the current *call* ' because when we use NoAMI() application, it will disable all events for dialplan (Newexten) and, if I have correctly patch it, for all channels that will be involved in the current *call*.
Not all manager_event calls need to be checked for the 'c->send_manager' flag or cannot be checked because no channel variable are available, by example on app_voicemail.c or app_queue.c.
On a performance side, I dont think it will be "optimal" to check for the 'send_manager' flag directly in the manager_event, because we will have to loop through available channel and do pattern matching for variable like 'Channel' or 'Source'.
By: Clod Patry (junky) 2009-05-03 19:23:46
jvandal: i will have this in mind when designing my google summer of code.
Be in touch soon.
By: Russell Bryant (russell) 2009-11-02 08:50:44.000-0600
Thank you very much for the contribution.
As you have seen, the manager interface does not lend itself to only getting the events you want because of a number of design decisions. I'm not willing to add a patch that relies on checking a variable throughout the code base every time manager_event() is used. I honestly think to solve what you really want the "right" way, it will require a new interface completely.