Call Control API: how to tell which number is calling which?

Status
Not open for further replies.

kr0st

Joined
Jan 8, 2012
Messages
2
Reaction score
0
I am using PhoneSystem instance and handle events “Inserted” and “Updated”.
When handler receives an event it gets “NotificationEventArgs e”. So, when “e.ConfObject is ActiveConnection” and status of connection is “ConnectionStatus.Connected” exactly at this moment I would like to know who called who. To be more precise, I would like to know if call was from our PBX or to our PBX, also number of the caller and number (caller id) that accepted the call (picked up the phone).

Example: some external number 123456789 called to our PBX and call was connected to extension 123, so when call is connected I need to understand that it’s actually 123456789 called to 123 and not vice versa. It’s not clear to me how to get this info from members of ActiveConnection.

I have read Call Control API manual and also compiled, ran and studied examples but it does not help – I see pattern when internal extension calls another extension, in this case I am able to tell who called who but when external line and sip trunks come into play everything breaks. It would be great if somebody knew the exact logic of what values and when are assigned to ActiveConnection members.

Would be grateful for any advice from somebody who maybe already tried doing something similar.
 
Re: Call Control API: how to tell which number is calling wh

You need to check documentation for ActiveConnection.DN and ActiveConnection.ExternalParty properties.
 
Re: Call Control API: how to tell which number is calling wh

Ok so this should help:

Inserted Event:
Dialling is a call noticed from DN (Caller) to externalparty (Callee)
Ringing is the call offered DN is who it is offered to externalparty is offeredFrom
Ignore the connected in this event!

Updated Event
ignore dialling and ringing events!
ConnectionStatus.Connected is the call connected DN is who made the call, externalparty is who it is to

Deleted Event:
Dialing: the call abandoned whilst the user started dialling but never finished dialling the number.
Ringing: the call abandoned whilst being offered/ringing
Connected: the call disconnected having been connected. Note you can use the isInbound and isOutbound bools to work out who hung up first, caller or callee! I shall leave that as an exercise to the reader.

rgds
 
Status
Not open for further replies.

Members Online Now

Forum statistics

Threads
111,852
Messages
589,389
Members
164,691
Latest member
Daz1964