(Page 14 of 16 in this chapter)
ppxSetTalker
Description
- Sets a talker for a connection.
Prototype
- DWORD ppxSetTalker ( PPXHD ppxhd,
PPX_MVIP_ADDR *talker )
- ppxhd Handle returned by ppxCreateConnection or by ppxOpenConnection.
- talker Pointer to a PPX_MVIP_ADDR structure. The structure is defined as follows:
typedef struct
{
DWORD switch_number;
DWORD bus;
DWORD stream;
DWORD timeslot;
} PPX_MVIP_ADDR
- See the Details section for a description of these fields.
Return Values
Events
Details
- This function sets the talker for a connection. If the connection has listeners attached, a switch connection is made to connect the listeners to the talker. If the talker and listeners are on different boards, telephony bus timeslots are allocated to make the connection.
- If there was a talker already attached to the connection, the original talker is disconnected before the new talker is connected. Any unused timeslots are freed.
- Specifying talker = NULL removes any previous talker to the connection. Any timeslots will be freed and the listeners receive the default pattern.
- The PPX_MVIP_ADDR structure contains the following fields:
See Also
- ppxAddListeners
Example
void WhileTheyWait( MYCONTEXT *cx )
{
DWORD e;
char ppxname [20];
DemoStartProtocol( cx->hd, cx->protocol, NULL, NULL );
/* Allocate a connection */
sprintf( ppxname, "ppxdemo%01d", cx->id );
e = ppxCreateConnection( cx->hd, ppxname, &ppx_parms,
&(ppxhd[cx->id]) );
if (e != SUCCESS)
{
printf("Unable to create a connection ; returns: %d\n",e);
exit(-1);
}
/*
* Set this port as the talker on this "Please hold...will try
* that extension now" connection
*/
talkers[cx->id].switch_number = cx->swi;
talkers[cx->id].bus = MVIP95_LOCAL_BUS;
talkers[cx->id].stream = dsp_stream;
talkers[cx->id].timeslot = cx->time_slot;
e = ppxSetTalker( ppxhd[cx->id], &talkers[cx->id] );
if( e != SUCCESS )
{
printf("Could not set talker\n");
exit(-1);
}
(Page 14 of 16 in this chapter)
tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights
reserved.