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.
