
Description | Cautions | Example | Errors | See Also
The d42_openfeaturesession( ) function opens a feature session on a specified channel and phone set specified by an extension number in the buffer. Once a feature session is opened, the user may use the functions that require a feature session to be open, for example, d42_writetodisplay( ). The events that require a feature session to be open--for example T_SOFTKEYDATAREADY--are also enabled. The user must pass a valid extension number to the function to establish the feature session with the board channel and the extension number specified.
The type of display the phone set has available is returned when the d42_openfeaturesession( ) function is called.
Parameter |
Description |
devh: |
specifies the channel number. |
szDnNumber: |
specifies the extension of the phone set on which the feature session is to be opened |
piTermType: |
points to an unsigned integer that contains a value indicating what type of display is available on a phone set. The following values define the type of display available |
iEvtMask |
The events to be received during the feature session. These may be either D42_EVT_SOFTKEY (receive notification of button pushes) or D42_EVT_ASYNCCLOSEFEATSESSION (receive notification of feature session close). |
This function is valid only with the Nortel Norstar PBX.
Only one feature session is supported per channel.
This function sets the parameter values for the channel parameters D4CH_SOFTKEYINPUT and D4CH_TERMINATEFEATURE to 1 for enabled.
void main(void)
{
int devh;
int rc = 0;
char szDnNumber = "221";
int iTerminalType;
int iEvtMask = D42_EVT_SOFTKEY | D42_EVT_ASYNCCLOSEFEATSESSION
/* Open Channel Device */
if ( (devh = dx_open("dxxxB1C1",NULL))==-1)
{
printf("Error dx_open()\n");
exit(-1);
} /* End dx_open */
/* Open a feature session */
if ( (rc = d42_openfeaturesession (devh, szDnNumber, &iTerminalType, iEvtMask )) == -1)
{
printf("Error d42_closefeaturesession():\n");
dx_close(devh);
exit(-1);
} /* End d42_brdstatus*/
/*something is done */
/* close the feature session */
if ( (rc = d42_closefeaturesession (devh)) == -1)
{
printf("Error d42_closefeaturesession():\n");
dx_close(devh);
exit(-1);
} /* End d42_brdstatus*/
dx_close(devh);
} /* End main */
If this function returns -1 to indicate a failure, one of the following (most common) codes will be contained in dx_errno. For a complete list of error codes and definitions, refer to Appendix C.
ED42_BADDDEVICE |
Invalid or wrong device handle sent to the function |
ED42_UNSUPPORTED |
Function not supported on this board |
ED42_SYSTEM |
System level error |
ED42_INVALARG |
Invalid argument passed to function |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation