Standard
cpl-c modules implements a CPLi [1] (Call Processing Language) interpreter. Support for uploading/downloading/removing scripts via SIP REGISTER method is implemented.
Bogdan-Andrei Iancu
i [2] Module
Copyright © 2003 FhG FOKUS
| Revision History | |
|---|---|
| Revision $Revision: 1.3 $ | $Date: 2005/08/24 22:26:17 $ |
i [3] Modules
The following modules must be loaded before this module:
-
tm. Transaction Manager, used for proxying/forkingi [4] requests.
-
sl. StateLess module - used for sending statelessi [5] reply when responding to REGISTER request or for sending back error responses.
-
usrloc. User location module - used for implementing lookup("registration") (adding into location set of the users' contact)
i [6]/cpl-06.dtd") ...
i [7]. The recurse feature can be disable by setting this parameter to 0
Default value of this parameter is 0.
Default value of this parameter is 6.
Meaning of the parameters is as follows:
-
type - which part of the script should be run; set it to "incoming" for having the incoming part of script executed (when an INVITE is received) or to "outgoing" for running the outgoing part of script (when a user is generating an INVITE - call).
-
mode - sets the interpreter mode as stateless/stateful behavior. The following modes are accepted:
-
IS_STATELESS - the current INVITE has no transactioni [11] created yet. All replies (redirection or deny) will be done is a stateless way. The execution will switch to stateful only when proxy is done. So, if the function returns, will be in stateless mode.
-
IS_STATEFUL - the current INVITE has already a transaction associated. All signaling operations (replies or proxy) will be done in stateful way.So, if the function returns, will be in stateful mode.
-
FORCE_STATEFUL - the current INVITE has no transaction created yet. All signaling operations will be done is a stateful way (on signaling, the transaction will be created from within the interpreter). So, if the function returns, will be in stateless mode.
Note
is_stateful is very difficult to manage from the routing script (script processing can continue in stateful mode); is_stateless is the fastest and consumes less resources (transaction is created only if proxying is done), but there is only a minimal protection against retransmissionsi [12] (since replies are send statelessly); force_stateful is a good compromise - all signaling is done stateful (retransmissioni [13] protection) and in the same time, if returning to script, it will be in stateless mode (easy to continue the routing script execution)
-
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.
http://www.iptel.org/ser/doc/modules/cpl-c
Links:
[1] http://www.iptel.org/glossary#term169
[2] http://www.iptel.org/glossary#term169
[3] http://www.iptel.org/glossary/term/244
[4] http://www.iptel.org/glossary#term68
[5] http://www.iptel.org/glossary/term/70
[6] http://www.iptel.org/glossary/term/244
[7] http://www.iptel.org/glossary#term253
[8] http://www.iptel.org/glossary#term187
[9] http://www.iptel.org/glossary#term256
[10] http://www.iptel.org/glossary#term71
[11] http://www.iptel.org/glossary#term69
[12] http://www.iptel.org/glossary#term72
[13] http://www.iptel.org/glossary#term72