I am making a Asterisk Client in C# WinForms using Asterisk.NET. My client is listening to one extension only.We can view the calls, reject or transfer etc to the calls coming to my extensions. I need source channel to transfer the call, and source channel can be got only from Dial Event. Recently, I noticed that The Dial Event happens everytime when any of the extension connected to the server starts dialling. I want to filter it out, only the call coming to my extension only.
void manager_Dial(object sender, DialEvent e)
{
CallingInfo.src_channel = e.Channel;
}
e.dialString is giving me the Destination Extension number; But I don't know if it become null according to the server status. Moreover, what will happen if some external calls coming to me, I wont get Dial event or Source channel, Then it cannot be transferred. Right ?
You can't.
Asterisk not allow such functionality.
You can read all and filter by your code needed extension. You can write deamon which will filter on server and send to your app only needed deamon.
Reason: asterisk is pbx, all not pbx functionality is limited.
Also you can send in dialplan UserEvent with any field you want before dialling and after answer, catch UserEvent only.