Accessing custom SIP headers from an RCML or Visual Designer application
CPaaS provides an additional interface to communicate with an RCML/Visual Designer application by means of custom SIP headers. The idea is that all custom SIP headers in a SIP message are detected and converted to HTTP parameters in the request to the RCML application using a convention. The RCML application can consume this parameters. Furthermore, Visual Designer converts these parameters to RVD variables and makes them available to its modules.
RCML applications
The following conventions are followed:
-
Any SIP header starting with X- prefix is custom.
-
HTTP parameters are created out of each custom SIP header by adding the SipHeader_ prefix to its name.
Example mappings from SIP header names to HTTP parameter names:
X-My-Header -> SipHeader_X-My-Header
Thus the SipHeader_X-My-Header will be available as typical GET or POST parameter in the RCML application.
Visual Designer applications
Visual Designer will take the previous convention one step further and create a Visual Designer variable out of the parameter. Thus, the mapping from a custom SIP header to an Visual Designer variable will be the following:
X-My-Header -> $core_x_my_header
So, if X-My-Header SIP header arrives at CPaaS, Visual Designer will have a variable named $core_x_my_header available in its modules. Note the following:
-
All characters are converted to lower case. This happens because although SIP headers are not case insesitive while Visual Designer variables are.
-
All non alpha numeric characters i.e. [^A-Za-z0-9_], are converted to `_' (underscore). That happens because Visual Designer has some additional restrictions for naming variables. Here is the regular expression that is used for invalid characters to underscore: