简体   繁体   中英

How to execute code before making a call on Asterisk

I have an asterisk pbx server. I'm new to asterisk, I know there are dial plans extensions groups etc. My goal is to handle a dial event do some checks then decide whether to let the call go through or not. I read about ARI AGI AMI and dial plan but I got confused and don't know how to proceed. I just want to execute code (call an API for example) when any number is dialed, and drop the call or let it through according to that.

I know if I do more research I can get something working, but honestly I don't have time. I just need to know where to look.

So I solved it. In case anyone needs this, here's what I did.

I used AsterNET fastAGI and created my service script, which does whatever checks I need and calls HangUp() when needed, else just returns and lets the call go through. Then I called the fastAGI script in the dial plan and it's working perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM