Requests the establishment of a circuit switched connection.
DWORD ISUPConnectReq ( CTAHD ctahd, SuId suId, SiInstId suInstId, SiInstId spInstId, Bool cirSelFlg, CirId circuit, SiConEvnt *conEvnt)
Argument |
Description |
ctahd |
Natural Access handle returned by ctaCreateContext. |
suId |
ISUP service access point. |
suInstId |
Service user instance ID. |
spInstId |
Service provider instance ID. |
cirSelFlg |
Circuit selection flag. |
circuit |
Circuit ID to be used for this connection if cirSelFlg is set to true. |
conEvnt |
Pointer to the caller's connect event structure containing all parameters (IEs) relevant to establishing this connection. |
Return value |
Description |
ISUP_SUCCESS |
|
CTAERR_BAD_ARGUMENT |
One or more arguments are invalid. |
CTAERR_DRIVER_SEND_FAILED |
Error occurred accessing the TX driver. |
CTAERR_INVALID_CTAHD |
Natural Access handle is invalid. |
When successful, ISUPConnectReq results in an initial address message (IAM) being sent to the far exchange. If the ISUP layer cannot successfully initiate the outgoing connection request (for example, due to network congestion or because the requested is not idle), it returns an asynchronous status indication event to the application with the cause value coded with the reason for the failure.
The value specified in suInstId is passed on to all subsequent events associated with this connection.
If this message is associated with a previously established connection, such as in a circuit reservation or continuity test, the spInstId must be the spInstId value returned in the first event received from the ISUP layer relative to this connection. If this is the first message associated with this connection, this value is coded to zero.
Set the value for cirSelFlg to non-zero (true) since the application must select the circuit.
<NMSBREAK>
#define SAP_ID 0
U8 cdPty[20] = “8479258900”;
U8 cdPtyLen = 0;
U8 *calling = NULL; /* default = no calling pty info in IAM */
U8 cgPty[20];
U8 cgPtyLen = 0;
SiConEvnt siConEvnt;
CTAHD FstCtaHd = Valid CTA Handle;
S16 switchType = ST_ITUWHITE;
SiInstId suInstId = 0;
SiInstId spInstId = 0;
SuId suId = SAP_ID;
CirId circuit = 2; /* Placing call on circuit 2 */
cdPtyLen = ISUPASCIItoBCD(called, cdPty, 20);
cgPtyLen = ISUPASCIItoBCD(calling, cgPty, 20);
printf("cdPtyLen = %d, cgPtyLen = %d\n", cdPtyLen, cgPtyLen);
ISUPInitIAM(switchType, &siConEvnt, cdPty, cdPtyLen, cgPty, cgPtyLen);
status = ISUPConnectReq(FstCtaHd, suId, suInstId, spInstId, 1, circuit, &siConEvnt);
if( status != ISUP_SUCCESS )
printf( "ISUPConnectReq() failed status = %d\n", status );
else
printf( "Initial Address Message sent for circuit %ld\n", circuit )