Dialogic Dialogic Global Call IP IP Phone User Manual


 
156 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
IP-Specific Operations
IPPARM_RX_RECVONLY – Media streaming has been initiated for a half-duplex
receive-only connection. The parameter value is an IP_CAPABILITY structure containing
the coder configuration that resulted from the capability exchange with the remote peer.
IPPARM_TX_INACTIVE – Media streaming in the transmit direction has been
suspended. The parameter value is an IP_CAPABILITY structure containing the coder
configuration that resulted from the capability exchange with the remote peer.
IPPARM_RX_INACTIVE – Media streaming in the receive direction has been
suspended. The parameter value is an IP_CAPABILITY structure containing the coder
configuration that resulted from the capability exchange with the remote peer.
When the parameter value in the GC_PARM_BLK structure is IPPARM_TX_CONNECTED,
indicating that a transmit media stream connection has occurred, the GC_PARM_BLK structure
will also contain the local and remote RTP addresses. These addresses are handled as an
RTP_ADDR data structure, which contains both the port number and the IP address. The parameter
set ID used for the RTP addresses is IPSET_RTP_ADDRESS, and the parameter IDs are
IPPARM_LOCAL and IPPARM_REMOTE.
RTP Address and Coder Information Retrieval Example
The following code snippet illustrates how to retrieve the RTP addresses and negotiated coder
information from a media stream connection event:
//When the event is an extension event:
GC_PARM_BLKP gcParmBlk;
EXTENSIONEVTBLK *pextensionBlk;
GC_PARM_DATA *parmp = NULL;
RTP_ADDR l_RTA1,l_RTA2;
pextensionBlk = (EXTENSIONEVTBLK *)(m_pMetaEvent->extevtdatap);
gcParmBlk = (&(pextensionBlk->parmblk));
GC_PARM_DATAP l_pParmData;
IP_CAPABILITYl_IPCap;
switch(pextensionBlk->ext_id)
{
case IPEXTID_MEDIAINFO:
//get the coder info:
l_pParmData = gc_util_find_parm(gcParmBlk, IPSET_MEDIA_STATE, IPPARM_TX_CONNECTED);
if(l_pParmData != NULL)
{
memcpy(&l_IPCap, l_pParmData->value_buf, l_pParmData->value_size);
// get the local RTP address:
l_pParmData= gc_util_find_parm(gcParmBlk, IPSET_RTP_ADDRESS, IPPARM_LOCAL);
if(l_pParmData!= NULL)
{
memcpy(&l_RTA1,l_pParmData->value_buf,l_pParmData->value_size);
}
//get the remote RTP address:
l_pParmData =gc_util_find_parm(gcParmBlk, IPSET_RTP_ADDRESS, IPPARM_REMOTE);
if(l_pParmData != NULL)
{
memcpy(&l_RTA2, l_pParmData->value_buf, l_pParmData->value_size);
}
}