Discussion:
CAPI_GET_MESSAGE
(too old to reply)
rs232
2008-01-19 16:00:31 UTC
Permalink
Hi,
I'm developing a simple application using capi.
I have readed a lot of message in this group but I don't find a
solution, so any new solution is appreciate.

my message buffer is sized correctly, I think:
CAPI_REGISTER( 1024 + 2*1024 , 2 , 7 , 2048 ,Appid )

Why when I call CAPI_GET_MESSAGE the msg structure is empty?

CAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage);

This function CAPI_GET_MESSAGE returns 0, but the second parameter (my
msg structure)
is not filled with any values!

Ex. I see with a capi monitor my REQ message and the corresponding
CONF message, but I don't be able to read CONF message with
CAPI_GET_MESSAGE!

Thanks
mx
Danilo Kempf
2008-01-23 06:55:19 UTC
Permalink
Post by rs232
Why when I call CAPI_GET_MESSAGE the msg structure is empty?
CAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage);
This function CAPI_GET_MESSAGE returns 0, but the second parameter (my=
msg structure)
is not filled with any values!
It's just a guess, but maybe you're putting a pointer to a chunk of memo=
ry =

into CAPI_GET_MESSAGE() and expect that memory to be filled with a CAPI =
=

message? CAPI_GET_MESSAGE() expects a pointer to a pointer instead -- =

after it returns the pointed-to pointer will point to a chunk of memory =
=

belonging to the CAPI implementation and containing a message.

So, it's really:

void *msg =3D NULL;
if( !CAPI_GET_MESSAGE( applId, &msg ) ) {
/* msg !=3D NULL here (ideally) */
}

The chunk of memory your CAPI application "lends" you may (but needn't) =
=

become invalid with the next call to CAPI_GET_MESSAGE(), so you might wa=
nt =

to copy the message from there for your perusal.


Regards,

Danilo
rs232
2008-01-30 21:46:11 UTC
Permalink
Post by rs232
Why when I call CAPI_GET_MESSAGE the msg structure is empty?
CAPI_GET_MESSAGE (DWORD ApplID, PVOID *ppCAPIMessage);
This function CAPI_GET_MESSAGE returns 0, but the second parameter (my
msg structure)
is not filled with any values!
It's just a guess, but maybe you're putting a pointer to a chunk of memory
into CAPI_GET_MESSAGE() and expect that memory to be filled with a CAPI
message? CAPI_GET_MESSAGE() expects a pointer to a pointer instead --
after it returns the pointed-to pointer will point to a chunk of memory
belonging to the CAPI implementation and containing a message.
void *msg = NULL;
if( !CAPI_GET_MESSAGE( applId, &msg ) ) {
/* msg != NULL here (ideally) */
}
The chunk of memory your CAPI application "lends" you may (but needn't)
become invalid with the next call to CAPI_GET_MESSAGE(), so you might want
to copy the message from there for your perusal.
Regards,
Danilo
Hi Danilo,
thanks for your suggestion.
Do you know where I find any examples of the structs contained in
CONNECT_REQ message?
(Called Party Number, Calling Parting Number,...,Called Party
Subaddress, ... B protocol etc..)

thanks
bye rs232
Lothar Kimmeringer
2008-01-31 18:20:56 UTC
Permalink
Post by rs232
Do you know where I find any examples of the structs contained in
CONNECT_REQ message?
(Called Party Number, Calling Parting Number,...,Called Party
Subaddress, ... B protocol etc..)
Everything is explained in the first part of the CAPI-specification.
You can download it at http://www.capi.org/download/capi20-1.pdf
So e.g. CalledPartyNumber as being explained on page 80f, contains
one byte with the type of the number and the numbering plan and
the number itself as list of bytes.

Every struct is added to the main message by a length-indicator
and the struct-data as shown before. A CalledPartyNumber with
the default-value 0x80 for number-type and numbering plan and
the number 08154711 would reside inside the message as
0x08 0x80 0x00 0x08 0x01 0x05 0x04 0x07 0x01 0x01


Regards, Lothar
--
Lothar Kimmeringer E-Mail: ***@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
Loading...