Getting the PartyNumber of an incoming call

Getting the PartyNumber of an incoming call

Post by sr » Sun, 14 Jun 2009 03:20:50

Hi there,

uhm I've a problem.
I've written an application that shows the user which number is

It works perfectly on a normal telephone system. But if I try to get
the number from a PBX ( Private Branch Exchange ) (its the system on
which you need to dial a "0" (in germany) before dialing the proper
number) I get no response from CONNECT_IND_CALLINGPARTYNUMBER. Just
don't know why.

Here the code in question:



QVariant str = CAPI_GET_CMSG(&CMSG,Appl_Id);

if (str != "4356" && i == true) {

QVariant var = (char *)CONNECT_IND_CALLINGPARTYNUMBER; //should hold
the calling number

Thnaks for your held in advance.
Greetings: Stefan Reinhardt

Getting the PartyNumber of an incoming call

Post by Michael Ha » Sun, 14 Jun 2009 07:38:30

> uhm I've a problem.


maybe you're PBX only provides empty Calling/Called party numbers?

Anyway, I am having troubles to understand you're code.
You generate a LISTEN_REQ with CIPMASK = ALL_SERVICES. Allright, then
you send your message to CAPI.
After that you call CAPI_GET_CMSG and check if the return value is !=
4356. I guess with 4356 you mean "0x1104 Queue is empty"

So, if the Queue is not empty and i is TRUE (what is i?) you assume that
str contains a CAPI_CONNECT_IND message (wich also would contain the
calling party number). But how do you know that? It could be any other

So my guess is you are expecting a message (CAPI_CONNECT_IND) but you're
not getting it but another message. And because of that you are not able
to get the calling party number :-)

Regards, Michael


Getting the PartyNumber of an incoming call

Post by CHW » Sun, 14 Jun 2009 18:59:53


maybe you get the called number / dialed digits via overlap receiving
(look at the INFO_IND) which contains the number or
a part of the number (extension)...

If the calling number is restricted, the struct will not show any
number otherwise the struct contains the whole number
(the calling one is the easiest one ;-) )...

I also advise to take a look at the second calling party number
(network provided) ...

Kind regards


Getting the PartyNumber of an incoming call

Post by s » Sun, 14 Jun 2009 23:44:37

thanks to you both for your fast answer.

To Michael Hampicke:
The PBX provides recieving and transmitting the calling number (the
demo32 from the adk works)

some words to the code:

"i" is a bool that makes sure that the correct gui is loaded (for
debugging it's always true)

And yes, 4356 proofs if the queue isn't empty. Hereabout is to say
that I'm workin' with the capi adk the first time and it was the first
idea I had to catch a signal.
Anyway, if str turns to "0" and It's because I'm or somone else is
calling, the CallingPartyNumber stays empty on a PBX.
So from here on I just haven't got a clue how to go on.

To Christian:

Many thanks for your EMail. I'll write you back soon.

Further on: How is it possible to get the calling number from
INFO_IND, and how do I get the second calling party number (both are
named callingpartynumber) ?

Regards: Stefan Reinhardt