sl_send_request subroutine

Purpose

Send a request primitive to a signaling process.

Library

The signaling interface library (libsl.a).

C syntax

#include <slsigpr.h>
...
SL_RET_CODE 	            sl_send_request (
    SL_PROC_TYPE        	sl_proc_type,
    SL_REQUEST_ST *      psignalingRequest,
    int *                piseq_no
);

Description

This subroutine is used by a channel process or custom server to send requests to a signaling process. Typical requests are to make an outgoing call, to accept an incoming call, and to clear an established call. The caller must initialize the SL_REQUEST_ST data structure to contain the required primitive and its parameters.

The signaling interface checks the primitive for validity. This checking is limited to range checking of parameters. The signaling process is responsible for further (semantic) checks.

In certain cases the signaling interface adds some additional parameters if they are required by the primitive. If this occurs, the updated values of the parameters are stored in the psignalingRequest structure, and are available to the caller on return from the subroutine call.

See Signaling interface primitives for the semantics of individual requests, a description of the parameters for each request, and a description of which parameters are mandatory.

If a request is invalid, an non-0 return code is returned, and the request is not sent to the signaling process. If the request is valid it is sent to the specified signaling process.

All request primitives have corresponding confirm primitives. The caller should wait for the response using the sl_receive_confirm() subroutine, specifying the command sequence number returned in *piseq_no.

Parameters

sl_proc_type
The signaling process type.
psignalingRequest
A pointer to the request primitive being sent. The following fields must be completed
id
Must be set to SLID_REQUEST_ST.
iseq_no
Must be set to 0. On return from sl_send_request(), the signaling interface will update this field with the sequence number allocated for the primitive. This sequence number can then be specified when calling sl_receive_confirm().
pidCHP
Must be set to the process id of the calling process.
Command
Must be set to the id of the primitive:

Command.name.generic must be one of the values defined for type SL_GENERIC_TYPE.

Command.name.specific must be SL_TAG_REQUEST.

Parms
Must be set to one of the request primitives listed in Table 1.
piseq_no
On return from the subroutine, the signaling interface updates this field with the sequence number allocated for the primitive. This sequence number can then be specified when calling the sl_receive_confirm() subroutine. On successful return from the subroutine, piseq_no has the same value as psignalingRequest–>iseq_no.

Return values

SLRC_ERROR_READING_CONFIG
An error occurred reading the Blueworx Voice Response signaling interface configuration.
SLRC_ERRNO
An AIX error has occurred. Check the value of errno for more information. If errno is set to EINTR, then retry the operation.
SLRC_INVALID_ARGS
Invalid parameter: psignalingRequest is NULL.
SLRC_INVALID_CALL_REF
The primitive has specified an invalid call reference. The only valid call reference for SL_CALL_SETUP_REQ is SL_CALL_REF_NULL. For other primitives a non-null call reference is required.
SLRC_INVALID_CALLED_NUM_LEN
The primitive is an SL_CALL_SETUP_REQ and the number supplied in the called_no field of psignalingRequest–>Parms.call_setup_request_st.phone_num is longer than SL_PHONE_NUM_LEN – 1 digits.
SLRC_INVALID_CHAN
The primitive has specified an invalid channel or pack.
SLRC_INVALID_COMMAND
Invalid parameter: psignalingRequest–>Command.name.generic is not a valid member of the enumeration SL_GENERIC_TYPE.
SLRC_INVALID_LENGTH
psignalingRequest–> Parms has an invalid sizetLength field.
SLRC_INVALID_REQUEST_ID
Invalid parameter: psignalingRequest–> id is not set to SLID_REQUEST_ST.
SLRC_INVALID_SEQUENCE_NO
Invalid parameter: psignalingRequest–> iseq_no is invalid (not 0).
SLRC_INVALID_SL_TYPE
The value of sl_proc_type is not one of those defined in the SL_PROC_TYPE enumeration.
SLRC_NOT_INSTALLED
The signaling process specified in sl_proc_type is not installed, or has not registered with the signaling interface, or has terminated abnormally.
SLRC_NOT_REGISTERED
The signaling process is not registered because an error has occurred. The most likely reason is that another signaling process with the same signaling process type is already registered.
SLRC_NOT_REQUEST
Invalid parameter: psignalingRequest–> Command.name.specific is not set to SL_TAG_REQUEST.
SLRC_OK
Successful.

Related information