Asterisk: detect incoming call
In asterisk/elastix/freepbx, how do you....
开发者_StackOverflow1- detect an incoming call
2- read the caller id
3- do something...(perform function)
?
In Your Incoming context you can check the callerId of the incoming call, if the callerId matches then you can perform the actions required in dailplan or from using AGI
My general advice: read Asterisk book. It will give you most answers.
Calls to your asterisk will land in some context, probably
incoming
, but you can define different contexts for different callers.There is function callerid, you can use it in your dialplan or AGI scripts
I use AGI scripts written in Python (there are libraries for Python, Perl and other popular languages), which connect to CRM WebService, check caller group by callerid and can prompt differently if call is from me or other employee and differently if one our customers is calling. Different prompts are in different contexts and AGI only set some variables.
精彩评论