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

User to User - Answers are provided by the community. 3CX does NOT provide technical support via this forum. Commercial grade support should NOT be expected

Moderators: kevin, 3CX staff

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

Postby kr0st » Wed Jan 18, 2012 12:18 pm

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.
kr0st
New User
 
Posts: 2
Joined: Sun Jan 08, 2012 5:08 pm

Re: Call Control API: how to tell which number is calling wh

Postby SY » Wed Jan 18, 2012 3:18 pm

You need to check documentation for ActiveConnection.DN and ActiveConnection.ExternalParty properties.
Stepan
3CX Development Team

3CX News, Tips and How to's at http://www.3cx.com/blog/
Very useful links are listed on http://www.3cx.com/support/index.html
SY
3CX Support
3CX Support
 
Posts: 2362
Joined: Fri Jan 26, 2007 2:14 pm

Re: Call Control API: how to tell which number is calling wh

Postby simonatkins » Wed Feb 08, 2012 10:36 pm

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
simonatkins
New User
 
Posts: 6
Joined: Wed Nov 02, 2011 10:35 pm


Return to 3CX Phone System - General (Community-led, no tech support)


Who is online

Users browsing this forum: No registered users and 0 guests

Announcements: