Browse code

sbc:cc: some documentation on header based cc

Stefan Sayer authored on 04/10/2011 14:00:02
Showing 2 changed files
... ...
@@ -361,11 +361,12 @@ the B leg is used (session_expires, minimum_timer etc).
361 361
 Call control modules
362 362
 --------------------
363 363
 Call control (CC) modules for the sbc application implement business logic which controls
364
-how the SBC operates. For example, a CCmodule can implement concurrent call limits, call
364
+how the SBC operates. For example, a CC module can implement concurrent call limits, call
365 365
 limits per user, enforce other policies, or implement routing logic.
366 366
 
367 367
 Multiple CC modules may be applied for one call. The data that the CC modules get from the
368
-call may be freely configured.
368
+call may be freely configured. Call control modules may also be applied through message parts
369
+(replacement patterns).
369 370
 
370 371
 Example: 
371 372
   Limiting From-User to 5 parallel calls, and 90 seconds maximum call duration:
... ...
@@ -376,6 +377,19 @@ Example:
376 377
     call_timer_module=cc_call_timer
377 378
     call_timer_timer=90
378 379
 
380
+Example:
381
+  Applying 90 seconds maximum call duration and other call control from a header:
382
+    call_control=call_timer,$H(P-CallControl)
383
+    call_timer_module=cc_call_timer
384
+    call_timer_timer=90
385
+
386
+   SIP message:
387
+    INVITE sip:foo@bar.net SIP/2.0
388
+    From: sip:a@example.com;tag=1234
389
+    To: b@example.com
390
+    P-CallControl: cc_pcalls;uuid=$rU, cc_pcalls;uuid=a_user
391
+    ...
392
+
379 393
 See also Readme.sbc_call_control.txt.
380 394
 
381 395
 Call control: Prepaid
... ...
@@ -30,6 +30,21 @@ substitution patterns, e.g.:
30 30
 will pass the contents of the Header named "P-UUID" as value "uuid" and the contents of "P-Call-Limit"
31 31
 as "max_calls".
32 32
 
33
+Alternatively, call control can also be set through message parts by using replacement patterns.
34
+Example:
35
+   call_control=cc_pcalls,$H(P-Call-Control)
36
+
37
+The header 'P-Call-Control' is a comma separated list of call control configurations, with key,value pairs
38
+appended, i.e. of the form module_name;param=val;param=val. 
39
+Example: 
40
+  P-Call-Control: cc_prepaid;uuid=joe, cc_pcalls;uuid=joe;max_calls=10
41
+
42
+As usual with multi-value headers, several separate headers may be used, so the above example is
43
+equivalent to:
44
+  P-Call-Control: cc_prepaid;uuid=joe
45
+  P-Call-Control: cc_pcalls;uuid=joe;max_calls=10
46
+
47
+
33 48
 Several CC modules are implemented
34 49
   o cc_pcalls         - parallel calls limiting
35 50
   o cc_call_timer     - call timer (maximum call duration)
... ...
@@ -141,7 +156,7 @@ Synopsis:
141 156
     call_profile->cc_vars.erase("mycc::myvar");
142 157
 
143 158
 If several invocations of the same call control module should be independent from each other,
144
-CC variables may be prefixed by the CC namespace
159
+CC variables should be prefixed by the CC namespace
145 160
 (e.g. args[CC_API_PARAMS_CC_NAMESPACE + "::" + var_name).
146 161
 
147 162