tags:

views:

90

answers:

3

In asterisk/elastix/freepbx, how do you....

1- detect an incoming call

2- read the caller id

3- do something...(perform function)

?

A: 

My general advice: read Asterisk book. It will give you most answers.

  1. Calls to your asterisk will land in some context, probably incoming, but you can define different contexts for different callers.

  2. There is function callerid, you can use it in your dialplan or AGI scripts

  3. 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.

Michał Niklas
+8  A: 

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

shrikant.soni