Table of Contents Index NMS Glossary Previous Page Next Page (Page 2 of 17 in this chapter) Version


ppxAddListeners

Description

Adds listeners to a connection.

Prototype

DWORD ppxAddListeners ( PPXHD ppxhd,
PPX_MVIP_ADDR listeners[],
unsigned count )

ppxhd Handle returned by ppxCreateConnection or by ppxOpenConnection.

listeners[] 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.

count Number of listeners to add.

Return Values

Events

Details

This function adds listeners to a connection. If the connection already has a talker attached, switch connections are made to connect the listeners to the talker. If the talker and listeners are on different boards, telephony bus timeslots are used to make the connection.

If no talker is attached, the listeners have the default pattern of the connection sent to them.

The PPX_MVIP_ADDR structure contains the following fields:
Field

Description

switch_number

Switch number of the board as defined in ppx.cfg.

bus

Acceptable values are:
MVIP95_MVIP_BUS
MVIP95_LOCAL_BUS

stream

The stream number of the listener.

timeslot

The timeslot of the listener.

See Also

ppxCreateConnection, ppxOpenConnection, ppxRemoveListeners, ppxSetDefaultPattern, ppxSetTalker

Example

DWORD KeepOnHold( MYCONTEXT *cx )
{
    DWORD e;
    unsigned port_id;  
    CTA_EVENT event;
    
    port_id = cx->id;
    
    if( cx->conn_state != CTX_ONHOLD )
    {
        /* Need to add as a listener to the hold message
         * connection.
         */
         
        cx->conn_state = CTX_ONHOLD;
                             
        listeners[port_id].switch_number = cx->swi; 
        listeners[port_id].bus = MVIP95_LOCAL_BUS;
        listeners[port_id].stream = 1;
        listeners[port_id].timeslot = cx->time_slot;
  
        e = ppxAddListeners( ppxhd[HOLD_MSG], 
                             &listeners[port_id], 1 );  
        if (e != SUCCESS)
        {
            return e;
        }
    }


Table of Contents Index NMS Glossary Previous Page Next Page (Page 2 of 17 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, NMS Communications Corporation. All rights reserved.