ppxRemoveListeners

Removes listeners from a connection.

Prototype

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

Argument

Description

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

Refer to the Details section for a description of these fields.

count

Number of listeners to remove.


Return values

Return value

Description

SUCCESS

 

CTAERR_DRIVER_ERROR

Underlying driver retrieved an unrecognized error. Call swiGetLastError to retrieve the MVIP device error code.

CTAERR_INVALID_HANDLE

ppxhd is not a valid connection handle.

CTAERR_NOT_FOUND

One of the listeners is not defined in the PPX configuration file.

CTAERR_OUT_OF_MEMORY

Unable to allocate memory.

CTAERR_SVR_COMM

Natural Access server communication error.

PPXERR_COMM_FAILURE

Problems were encountered when communicating with the PPX server.

PPXERR_DRIVER_OPEN_FAILED

Driver open failed, or the driver DLL or device was not found.

PPXERR_INVALID_COUNT

Number of supplied listeners is less than count.

PPXERR_INVALID_SWITCH

Switch number specified is inaccessible from the specified bus:stream:timeslot.

PPXERR_NOT_CONNECTED

One of the listeners is not receiving output on the connection.

PPXERR_NOT_LISTENER

One of the listeners is incapable of receiving output from the connection.

SWIERR_INVALID_STREAM

One or more of the specified streams is invalid.

SWIERR_INVALID_TIMESLOT

One or more of the specified timeslots is invalid.


Details

ppxRemoveListeners removes listeners from a connection. All unused intervening timeslots are freed, but the talker remains associated with the connection.

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.


Refer to Removing listeners from a connection for more information.

See also

ppxAddListeners

Example

DWORD VoiceConx( CTAHD ctahd, MYCONTEXT *cust, BOOL make_conn )
{
    DWORD         ret;
    
    listeners[cust->id].stream = 1;
    listeners[cust->id].timeslot = cust->time_slot;        
    listeners[cust->id].switch_number = cust->swi ;
    listeners[cust->id].bus = MVIP95_LOCAL_BUS;
    
    if ( cust->conn_state == CTX_ONHOLD )
    {
       /*
        * If the caller had been put on hold, need to take them
        * off of hold before making the voice connection to the
        * Operator.
        */
 
       ppxRemoveListeners( ppxhd[HOLD_MSG], &listeners[cust->id], 1 );
    }
}