|
@@ -1,43 +1,19 @@
|
|
-1. Xprint Module
|
|
|
|
|
|
+The Xprint Module
|
|
|
|
|
|
Elena-Ramona Modroiu
|
|
Elena-Ramona Modroiu
|
|
|
|
|
|
Asipto
|
|
Asipto
|
|
|
|
|
|
- Copyright © 2003 FhG FOKUS
|
|
|
|
|
|
+ Copyright © 2003 FhG FOKUS
|
|
__________________________________________________________________
|
|
__________________________________________________________________
|
|
|
|
|
|
- 1.1. Overview
|
|
|
|
- 1.2. Implemented Specifiers
|
|
|
|
- 1.3. Parameters
|
|
|
|
|
|
+ List of Examples
|
|
|
|
|
|
- 1.3.1. buf_size (integer)
|
|
|
|
|
|
+ 1. Set buf_size parameter
|
|
|
|
+ 2. xplog usage
|
|
|
|
+ 3. xpdbg usage
|
|
|
|
|
|
- 1.4. Functions
|
|
|
|
-
|
|
|
|
- 1.4.1. xplog(level, format)
|
|
|
|
- 1.4.2. xpdbg(format)
|
|
|
|
-
|
|
|
|
- 1.5. Module API
|
|
|
|
-
|
|
|
|
- 1.5.1. Functions
|
|
|
|
-
|
|
|
|
- 1.5.1.1. int xbind(xl_api_t *xl_api)
|
|
|
|
- 1.5.1.2. int xparse(char *s, xl_elog_p *el)
|
|
|
|
- 1.5.1.3. int shm_xparse(char *s, xl_elog_p *el)
|
|
|
|
- 1.5.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb)
|
|
|
|
-
|
|
|
|
- 1.5.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb
|
|
|
|
- cb)
|
|
|
|
-
|
|
|
|
- 1.5.1.6. xfree(xl_elog_p el)
|
|
|
|
- 1.5.1.7. shm_xfree(xl_elog_p el)
|
|
|
|
- 1.5.1.8. int xprint(struct sip_msg* msg, xl_elog_p el, char
|
|
|
|
- *buf, int *len)
|
|
|
|
-
|
|
|
|
- 1.5.1.9. str *xnulstr()
|
|
|
|
-
|
|
|
|
-1.1. Overview
|
|
|
|
|
|
+1. Overview
|
|
|
|
|
|
IMPORTANT: this is former xlog module from SIP Express Router (SER)
|
|
IMPORTANT: this is former xlog module from SIP Express Router (SER)
|
|
kept because it is used by other modules via API to get the value for
|
|
kept because it is used by other modules via API to get the value for
|
|
@@ -46,10 +22,10 @@ Elena-Ramona Modroiu
|
|
|
|
|
|
This module provides the possibility to print user formatted log or
|
|
This module provides the possibility to print user formatted log or
|
|
debug messages from SER scripts, similar to printf function but now a
|
|
debug messages from SER scripts, similar to printf function but now a
|
|
- specifier is replaced with a part of the SIP request. Section 1.2,
|
|
|
|
- “Implemented Specifiers� shows what can be printed out.
|
|
|
|
|
|
+ specifier is replaced with a part of the SIP request. Section 2,
|
|
|
|
+ "Implemented Specifiers" shows what can be printed out.
|
|
|
|
|
|
-1.2. Implemented Specifiers
|
|
|
|
|
|
+2. Implemented Specifiers
|
|
|
|
|
|
* %% : '%'
|
|
* %% : '%'
|
|
* %br : request's first branch
|
|
* %br : request's first branch
|
|
@@ -124,9 +100,11 @@ Elena-Ramona Modroiu
|
|
E.g. %@ruri.user%|@%@ruri.host converts all featured request uri
|
|
E.g. %@ruri.user%|@%@ruri.host converts all featured request uri
|
|
into user@host form only.
|
|
into user@host form only.
|
|
|
|
|
|
-1.3. Parameters
|
|
|
|
|
|
+3. Parameters
|
|
|
|
+
|
|
|
|
+ 3.1. buf_size (integer)
|
|
|
|
|
|
-1.3.1. buf_size (integer)
|
|
|
|
|
|
+3.1. buf_size (integer)
|
|
|
|
|
|
Maximum size of the log message.
|
|
Maximum size of the log message.
|
|
|
|
|
|
@@ -137,9 +115,12 @@ Elena-Ramona Modroiu
|
|
modparam("xprint", "buf_size", 8192)
|
|
modparam("xprint", "buf_size", 8192)
|
|
...
|
|
...
|
|
|
|
|
|
-1.4. Functions
|
|
|
|
|
|
+4. Functions
|
|
|
|
+
|
|
|
|
+ 4.1. xplog(level, format)
|
|
|
|
+ 4.2. xpdbg(format)
|
|
|
|
|
|
-1.4.1. xplog(level, format)
|
|
|
|
|
|
+4.1. xplog(level, format)
|
|
|
|
|
|
Print a formated message using LOG function.
|
|
Print a formated message using LOG function.
|
|
|
|
|
|
@@ -160,7 +141,7 @@ modparam("xprint", "buf_size", 8192)
|
|
xplog("L_ERR", "time [%Tf] method <%rm> r-uri <%ru> 2nd via <%{via[1]}>\n");
|
|
xplog("L_ERR", "time [%Tf] method <%rm> r-uri <%ru> 2nd via <%{via[1]}>\n");
|
|
...
|
|
...
|
|
|
|
|
|
-1.4.2. xpdbg(format)
|
|
|
|
|
|
+4.2. xpdbg(format)
|
|
|
|
|
|
Print a formatted message using DBG function.
|
|
Print a formatted message using DBG function.
|
|
|
|
|
|
@@ -172,11 +153,25 @@ xplog("L_ERR", "time [%Tf] method <%rm> r-uri <%ru> 2nd via <%{via[1]}>\n");
|
|
xpdbg("time [%Tf] method <%rm> r-uri <%ru>\n");
|
|
xpdbg("time [%Tf] method <%rm> r-uri <%ru>\n");
|
|
...
|
|
...
|
|
|
|
|
|
-1.5. Module API
|
|
|
|
|
|
+5. Module API
|
|
|
|
+
|
|
|
|
+ 5.1. Functions
|
|
|
|
+
|
|
|
|
+ 5.1.1. int xbind(xl_api_t *xl_api)
|
|
|
|
+ 5.1.2. int xparse(char *s, xl_elog_p *el)
|
|
|
|
+ 5.1.3. int shm_xparse(char *s, xl_elog_p *el)
|
|
|
|
+ 5.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb)
|
|
|
|
+ 5.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb cb)
|
|
|
|
+ 5.1.6. xfree(xl_elog_p el)
|
|
|
|
+ 5.1.7. shm_xfree(xl_elog_p el)
|
|
|
|
+ 5.1.8. int xprint(struct sip_msg* msg, xl_elog_p el, char *buf,
|
|
|
|
+ int *len)
|
|
|
|
+
|
|
|
|
+ 5.1.9. str *xnulstr()
|
|
|
|
|
|
-1.5.1. Functions
|
|
|
|
|
|
+5.1. Functions
|
|
|
|
|
|
-1.5.1.1. int xbind(xl_api_t *xl_api)
|
|
|
|
|
|
+5.1.1. int xbind(xl_api_t *xl_api)
|
|
|
|
|
|
Bind to the xprint module API.
|
|
Bind to the xprint module API.
|
|
|
|
|
|
@@ -187,7 +182,7 @@ xpdbg("time [%Tf] method <%rm> r-uri <%ru>\n");
|
|
|
|
|
|
Return value: 0 - success, <0 - error.
|
|
Return value: 0 - success, <0 - error.
|
|
|
|
|
|
-1.5.1.2. int xparse(char *s, xl_elog_p *el)
|
|
|
|
|
|
+5.1.2. int xparse(char *s, xl_elog_p *el)
|
|
|
|
|
|
Parse an xl-formatted string in private memory.
|
|
Parse an xl-formatted string in private memory.
|
|
|
|
|
|
@@ -197,12 +192,12 @@ xpdbg("time [%Tf] method <%rm> r-uri <%ru>\n");
|
|
|
|
|
|
Return value: 0 - success, <0 - error.
|
|
Return value: 0 - success, <0 - error.
|
|
|
|
|
|
-1.5.1.3. int shm_xparse(char *s, xl_elog_p *el)
|
|
|
|
|
|
+5.1.3. int shm_xparse(char *s, xl_elog_p *el)
|
|
|
|
|
|
Parse an xl-formatted string in shared memory. See xparse() function
|
|
Parse an xl-formatted string in shared memory. See xparse() function
|
|
for details.
|
|
for details.
|
|
|
|
|
|
-1.5.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb)
|
|
|
|
|
|
+5.1.4. int xparse2(char *s, xl_elog_p *el, xl_parse_cb cb)
|
|
|
|
|
|
Parse an xl-formatted string in private memory. This function is able
|
|
Parse an xl-formatted string in private memory. This function is able
|
|
to identify regular expression back references, for example \1, \2,
|
|
to identify regular expression back references, for example \1, \2,
|
|
@@ -229,26 +224,26 @@ xpdbg("time [%Tf] method <%rm> r-uri <%ru>\n");
|
|
|
|
|
|
Return value: 0 - success, <0 - error.
|
|
Return value: 0 - success, <0 - error.
|
|
|
|
|
|
-1.5.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb cb)
|
|
|
|
|
|
+5.1.5. int shm_xparse2(char *s, xl_elog_p *el, xl_parse_cb cb)
|
|
|
|
|
|
Parse an xl-formatted string in shared memory supporting regular
|
|
Parse an xl-formatted string in shared memory supporting regular
|
|
expression back references. See xparse2() function for details.
|
|
expression back references. See xparse2() function for details.
|
|
|
|
|
|
-1.5.1.6. xfree(xl_elog_p el)
|
|
|
|
|
|
+5.1.6. xfree(xl_elog_p el)
|
|
|
|
|
|
Free the xl-lib list allocated by xparse() or xparse2().
|
|
Free the xl-lib list allocated by xparse() or xparse2().
|
|
|
|
|
|
Meaning of the parameters is as follows:
|
|
Meaning of the parameters is as follows:
|
|
* el - xl-lib list to be freed.
|
|
* el - xl-lib list to be freed.
|
|
|
|
|
|
-1.5.1.7. shm_xfree(xl_elog_p el)
|
|
|
|
|
|
+5.1.7. shm_xfree(xl_elog_p el)
|
|
|
|
|
|
Free the xl-lib list allocated by shm_xparse() or shm_xparse2().
|
|
Free the xl-lib list allocated by shm_xparse() or shm_xparse2().
|
|
|
|
|
|
Meaning of the parameters is as follows:
|
|
Meaning of the parameters is as follows:
|
|
* el - xl-lib list to be freed.
|
|
* el - xl-lib list to be freed.
|
|
|
|
|
|
-1.5.1.8. int xprint(struct sip_msg* msg, xl_elog_p el, char *buf, int *len)
|
|
|
|
|
|
+5.1.8. int xprint(struct sip_msg* msg, xl_elog_p el, char *buf, int *len)
|
|
|
|
|
|
Evaluate the xl-formatted string and print the result into a buffer.
|
|
Evaluate the xl-formatted string and print the result into a buffer.
|
|
|
|
|
|
@@ -261,6 +256,6 @@ xpdbg("time [%Tf] method <%rm> r-uri <%ru>\n");
|
|
|
|
|
|
Return value: 0 - success, <0 - error.
|
|
Return value: 0 - success, <0 - error.
|
|
|
|
|
|
-1.5.1.9. str *xnulstr()
|
|
|
|
|
|
+5.1.9. str *xnulstr()
|
|
|
|
|
|
Return the string "<null>".
|
|
Return the string "<null>".
|