call control api - dialed number

Status
Not open for further replies.

manfer

Silver Partner
Advanced Certified
Joined
Oct 19, 2017
Messages
131
Reaction score
23
I'm trying to monitor incoming calls with 3CX Call Control API v2.0.0.0

I do it with PhoneSystem.Updated listening to the events of EntityName "CONNECTION" and status "connected".

All good. I get incoming and outgoing calls that way. I get almost all the details I need. But there is one that I have not been able to get.

On incoming calls I can know the caller number, the extension to which the call is connected but I can't know which is the number that the outside caller has dialed. The DialedNumber property for incoming calls is blank. Something that seems by design reading DialedNumber description:

"Provides number which was dialed by the originator of an outbound connection. This property provides valid information only for outbound connections on external line. (DN property is an ExternalLine object"

So, anyone knows how to get the dialed number for incoming calls? Anyone knows if I should look deeper in the call control API to try to find that dialed number info or is something that I'm not going to be able to achieve with v2.0.0.0 API?

In case it is not possible with v2.0.0.0 API, is this something available on v3.0.0.0?

Where can I get v3.0.0.0 documentation to have a look?

Thanks.
 
That information is available in the AttachedData collection. I don't remember exactly which value you need to look for, but check with the debugger or log the values you have and you will get what you need.
 
Ok I will try to look deeper in the objects available in AttachedData.

I forgot to mention that the external call is routed to a ring group before reaching the extension in my test environment and is going to be routed to a queu in the final version I need to implement. Just in case that makes a difference.

The real problem is that there are going to be many queues with different DDIs.

And identifying the queue is not going to be enough because:
  • It is possible that some days on the year for any reasons a DDI have to be routed to a different queue.
  • It is possible that we implement a queue as and final route for a not answered call on other queue.
This means the queue number is not going to uniquely the DDI.

Thanks.
 
Last edited:
After hours trying to find this I'm totally unable to get a solution.

The event:

External number: 555555555 (a mobile phone)
calls
DDI: 888888888
routed to:
Ring Group: 800
with members:
DNs: 111, 112, 113
answered by:
DN: 112

The details I get
Code:
LastChangeStatus=07/03/2019 16:06:12
IsOutbound=False
IsInbound=True
DialedNumber=
ExternalParty=555555555
InternalParty=Wexternalline.46: 10000 on Wprovider.2: pbx.domain.foo:5060 - FooName
Status=Connected
HistoryIDOfTheCall=0000000000000000_56
OriginatedBy=Wringgroup.48: 800
ReferredBy=0
CallConnectionID=2
CallID=56
OnBehalfOf=
DN=Wextension.42: 112
OtherCallParties=TCX.Configuration.Interop.Wconnection[]
RecordingState=Stop
    AttachedData:prevCall=0
        prevLeg=0
        devcontact=sip:[email protected]:5064
        lookup_displayname=FooName FooSurname
        directcallctrl=1
        sip_dialog_set_id=a_long_hash_here
        extnumber=555555555
        chid=0000000000000000_56

So I can only get the external number that calls and the extension that answers the call. But I have not been able to find the DDI.

I looked RingGroup class just in case I could gather more details from OriginatedBy but doesn't look a place to look for details of the current call.

I have looked too into InternalParty DN and I have not been able to get more details either.

Am I missing something?

I'm testing on a free version of 3CX PBX which is the one I installed to use for development. Could this be the problem? Does AttachedData contain more details in a PRO version?

Thanks.
 
Sorry,

Another important detail, just in case it makes a difference too. I'm running a program coded with v2.0.0.0 Call Control API on an instance of 3CX Phone System 16.0.0.1375 free license
 
The free license is not a problem, the API is the same for every license.

Do you have a DID defined for the SIP Trunk where you receive the call? In that case there is a property name "inbound_did" which will have the value you need...
 
  • Like
Reactions: manfer
That pointed me in the correct direction.

The SIP Trunk has several DIDs. In this test environment I was still using just the default route from the trunk configuration itself. Once I added and Inbound Rule for the DID, with same route than the default but using a specific rule, two new properties appeared in the AttachedData, inbound_did and inbound_did_rule.

Many Thanks.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei