HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

364 HP-UX C SIP Stack Programmers Guide
Extension Support
does not recognize the option-tag on the Require header, the
server responds with a 420 response message and adds an
Unsupported header with the unsupported option-tag.
For more information, see the Configuration chapter.
Sample Code
The following code configures the SIP Stack to support two extensions:
PRACK—(reliable provisional responses) specified by the
100rel option tag
MyExtn—(a proprietary extension) specified by the MyExt
option tag.
The SIP Stack is configured to reject unsupported extensions.
/*==========================================================================*/
static RvStatus AppStackInitialize(OUT RvSipStackHandle *phStack)
{
RvStatus rv;
RvSipStackCfg stackCfg;
RvSipStackInitCfg(sizeof(stackCfg),&stackCfg);
/*Configures the Stack to support 100rel and MyExt*./
stackCfg.supportedExtensionList = "100rel,MyExt";
/*Configures the Stack to add the supported list to messages.*/
stackCfg.addSupportedListToMsg = RV_TRUE;
/*Configures the Stack to reject unsupported extensions.*/
stackCfg.rejectUnsupportedExtensions = RV_TRUE;
/*Calls the Stack initialization function.*/
rv = RvSipStackConstruct(sizeof(stackCfg),&stackCfg,phStack);
return rv;
}
/*==========================================================================*/
The rejectUnsupportedExtension configuration parameter influences the
behavior of call-legs only. If you work with the Transaction API, you can use
the function, RvSipTransactionIsUnsupportedExtRequired(). If the result is
RV_TRUE, you may reject the request using the 420 response code. In such a
case, the Unsupported header will be added to the reject message automatically.