I have a macro that is triggering a growl message to be sent to my desktop computer when a call comes into to our customer service queue. Asterisk is sending me three duplicate Growl messages every time a call is received, one for each extension in the Queue.
How can I trigger this macro only for extension 6822?
; Rings one or more extensions. Handles things like call forwarding and DND
; We don’t call dial directly for anything internal anymore.
; ARGS: $TIMER, $OPTIONS, $EXT1, $EXT2, $EXT3, …
; Use a Macro call such as the following:
; Macro(dial,$DIAL_TIMER,$DIAL_OPTIONS,$EXT1,$EXT2,$EXT3,…)
[macro-dial]
exten => s,1,GotoIf($["${MOHCLASS}" = “”]?dial)
;PIXAR MOD dialecticphp.agi
exten => s,n,AGI(dialecticphp.agi)[/code]
I also tried this but it did not work:
;PIXAR MOD dialecticphp.agi
exten => 6822,n,AGI(dialecticphp.agi)
[quote=“david55”]You haven’t provided enough information for me to really understand what you are trying to do and the context in which you are trying to do it.
(Incidentally, macros are deprecated.)[/quote]
This macro gets executed three times when a caller enters a call queue that contains three extensions:
exten => s,n,AGI(dialecticphp.agi)
I tried to modify the macro so it only gets executed when extension 6822 is called but this version of the macro does nothing at all:
exten => 6822,n,AGI(dialecticphp.agi)
In what version were macros deprecated and what has replaced them? I am using Asterisk version 1.6.2.13.
Macro was deprecated in 1.6.1 and possibly 1.6.0. Internally it is now implemented using the subroutine mechanism, with only limited attempts to retain the original semantics. New designs should use subroutines. I am pretty sure the version you are using has had the macros removed from the sample extensions.conf.
The macro gets called when someone calls in. Currently it is getting triggered three times (once for each extension in the call queue). We only want it to be called once, for just one of the extensions in the call queue.
I am not really sure what the definition of a macro is. What were are doing is calling a AGI script written in PHP. It is being called using the following line in the extensions.conf:
exten => s,n,AGI(dialecticphp.agi)
I am not sure that this is the proper place to put it but this is only place that it has worked so far.
I am not exactly sure what you mean by “how is it being called?”. All the php script is doing is making a database connection and modifying some fields based on incoming agi parameters. It doesn’t do anything with extensions, trunks, inbound routes, etc.