What if I only wanted some extensions to use the predial hook context


(Claudio Pelosi) #1

I use this context
[Macro-dialout-trunk-predial-hook]

and inside there are rules of course …
I would like, however, that only some extensions were subject to it while other extensions must ignore these rules or better make other steps, how can I do an if and then an else?


(Avayax) #2

Checkout the ExecIF function in Asterisk.
GotoIf or GoSubIf are also a possibility.
The calling party ID is saved in the AMPUSER variable.


(Lorne Gaetz) #3

See the part in this post titled, “How do I apply custom dialplan selectively on some outbound calls?”.


(Claudio Pelosi) #4

actually I would like to learn “IF” and also “ELSE” and act with “AND” and also “OR”
to use in contexts, can you give me simple examples or sign me adequate documentation?


(Communication Technologies) #5

This:

or this are good places to learn:
http://the-asterisk-book.com/1.6/applikationen-gotoif.html


#6

Also:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_GotoIf