cpl-cStandard cpl-c modules implements a CPLi (Call Processing Language) interpreter. Support for uploading/downloading/removing scripts via SIP REGISTER method is implemented. Bogdan-Andrei Iancu 1. CPLi ModuleCopyright © 2003 FhG FOKUS
cpl-c modules implements a CPL (Call Processing Language) interpreter. Support for uploading/downloading/removing scripts via SIP REGISTER method is implemented. 1.2.1. SERi ModulesThe following modules must be loaded before this module:
A SQL URL have to be given to the module for knowing where the database containing the table with CPL scripts is locates. If required a user name and password can be specified for allowing the module to connect to the database server. WarningThis parameter is mandatory. Indicates the name of the table that store the CPL scripts. This table must be locate into the database specified by "cpl_db" parameter. For more about the format of the CPL table please see modules/cpl-c/init.mysql. WarningThis parameter is mandatory. Points to the DTD file describing the CPL grammar. The file name may include also the path to the file. This path can be absolute or relative (be careful the path will be relative to the starting directory of SER). WarningThis parameter is mandatory. Example 3. Set cpl_dtd_file parameter ...
modparam("cpl_c","cpl_dtd_file","/etc/seri/cpl-06.dtd")
...
Points to a directory where should be created all the log file generated by the LOG CPL node. A log file per user will be created (on demand) having the name username.log. NoteIf this parameter is absent, the logging will be disabled without generating error on execution. Tells for how many time is allow to have recurse for PROXY CPL node If it has value 2, when doing proxy, only twice the proxy action will be re-triggered by a redirect response; the third time, the proxy execution will end by going on REDIRECTION branchi. The recurse feature can be disable by setting this parameter to 0 Default value of this parameter is 0. Before doing proxy (forward), a script route can be executed. All modifications made by that route will be reflected only for the current branch. Default value of this parameter is 0 (none). Starts the execution of the CPL script. The user name is fetched from new_uri or requested uri or from To header -in this order- (for incoming execution) or from FROM header (for outgoing execution). Regarding the statefuli/stateless message processing, the function is very flexible, being able to run in different modes (see below the"mode" parameter). Normally this function will end script execution. There is no guaranty that the CPL script interpretation ended when ser script ended also (for the same INVITE ;-)) - this can happen when the CPL script does a PROXY and the script interpretation pause after proxying and it will be resume when some reply is received (this can happen in a different process of SER). If the function returns to script, the SIP server should continue with the normal behavior as if no script existed. When some error is returned, the function itself haven't sent any SIP error reply (this can be done from script). Meaning of the parameters is as follows:
This function MUST be called only for REGISTER requests. It checks if the current REGISTER request is related or not with CPL script upload/download/ remove. If it is, all the needed operation will be done. For checking if the REGISTER is CPL related, the function looks fist to "Content-Type" header. If it exists and has a the mime type set to "application/cpl+xml" means this is a CPL script upload/remove operation. The distinction between to case is made by looking at "Content-Disposition" header; id its value is "script;action=store", means it's an upload; if it's "script;action=remove", means it's a remove operation; other values are considered to be errors. If no "Content-Type" header is present, the function looks to "Accept" header and if it contains the "*" or "application/cpl-xml" the request it will be consider one for downloading CPL scripts. The functions returns to script only if the REGISTER is not related to CPL. In other case, the function will send by itself the necessary replies (stateless - using sl), including for errors. |
Navigation |
||||