瀏覽代碼

modules: readme files regenerated - corex ... [skip ci]

Kamailio Dev 7 年之前
父節點
當前提交
2c6dae7562
共有 1 個文件被更改,包括 131 次插入102 次删除
  1. 131 102
      src/modules/corex/README

+ 131 - 102
src/modules/corex/README

@@ -39,23 +39,24 @@ Muhammad Shahzad Shafi
         4. Functions
         4. Functions
 
 
               4.1. append_branch([ uri, [ q ] ])
               4.1. append_branch([ uri, [ q ] ])
-              4.2. send([ host [ :port ] ])
+              4.2. send_udp([ host [ :port ] ])
               4.3. send_tcp([ host [ :port ] ])
               4.3. send_tcp([ host [ :port ] ])
               4.4. send_data(uri, data)
               4.4. send_data(uri, data)
-              4.5. is_incoming()
-              4.6. msg_iflag_set(flagname)
-              4.7. msg_iflag_reset(flagname)
-              4.8. msg_iflag_is_set(flagname)
-              4.9. file_read(fpath, var)
-              4.10. file_write(fpath, content)
-              4.11. setxflag(flag)
-              4.12. isxflagset(flag)
-              4.13. resetxflag(flag)
-              4.14. set_send_socket(saddr)
-              4.15. set_recv_socket(saddr)
-              4.16. set_source_address(saddr)
-              4.17. via_add_srvid(flags)
-              4.18. via_add_xavp_params(flags)
+              4.5. sendx(uri, sock, data)
+              4.6. is_incoming()
+              4.7. msg_iflag_set(flagname)
+              4.8. msg_iflag_reset(flagname)
+              4.9. msg_iflag_is_set(flagname)
+              4.10. file_read(fpath, var)
+              4.11. file_write(fpath, content)
+              4.12. setxflag(flag)
+              4.13. isxflagset(flag)
+              4.14. resetxflag(flag)
+              4.15. set_send_socket(saddr)
+              4.16. set_recv_socket(saddr)
+              4.17. set_source_address(saddr)
+              4.18. via_add_srvid(flags)
+              4.19. via_add_xavp_params(flags)
 
 
         5. RPC Commands
         5. RPC Commands
 
 
@@ -79,24 +80,26 @@ Muhammad Shahzad Shafi
    1.3. Set min_msg_len parameter
    1.3. Set min_msg_len parameter
    1.4. Set msg_avp parameter
    1.4. Set msg_avp parameter
    1.5. append_branch usage
    1.5. append_branch usage
-   1.6. send usage
-   1.7. send_data usage
-   1.8. is_incoming usage
-   1.9. msg_iflag_set usage
-   1.10. msg_iflag_reset usage
-   1.11. msg_iflag_is_set usage
-   1.12. file_read usage
-   1.13. file_write usage
-   1.14. setxflag usage
-   1.15. isxflagset usage
-   1.16. resetxflag usage
-   1.17. set_send_socket usage
-   1.18. set_recv_socket usage
-   1.19. set_source_address usage
-   1.20. via_add_srvid usage
-   1.21. via_add_xavp_params usage
-   1.22. event_route[network:msg] use cases
-   1.23. Sample PERL code for do_compress and do_uncompress
+   1.6. send_udp usage
+   1.7. send_tcp usage
+   1.8. send_data usage
+   1.9. sendx usage
+   1.10. is_incoming usage
+   1.11. msg_iflag_set usage
+   1.12. msg_iflag_reset usage
+   1.13. msg_iflag_is_set usage
+   1.14. file_read usage
+   1.15. file_write usage
+   1.16. setxflag usage
+   1.17. isxflagset usage
+   1.18. resetxflag usage
+   1.19. set_send_socket usage
+   1.20. set_recv_socket usage
+   1.21. set_source_address usage
+   1.22. via_add_srvid usage
+   1.23. via_add_xavp_params usage
+   1.24. event_route[network:msg] use cases
+   1.25. Sample PERL code for do_compress and do_uncompress
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -118,23 +121,24 @@ Chapter 1. Admin Guide
    4. Functions
    4. Functions
 
 
         4.1. append_branch([ uri, [ q ] ])
         4.1. append_branch([ uri, [ q ] ])
-        4.2. send([ host [ :port ] ])
+        4.2. send_udp([ host [ :port ] ])
         4.3. send_tcp([ host [ :port ] ])
         4.3. send_tcp([ host [ :port ] ])
         4.4. send_data(uri, data)
         4.4. send_data(uri, data)
-        4.5. is_incoming()
-        4.6. msg_iflag_set(flagname)
-        4.7. msg_iflag_reset(flagname)
-        4.8. msg_iflag_is_set(flagname)
-        4.9. file_read(fpath, var)
-        4.10. file_write(fpath, content)
-        4.11. setxflag(flag)
-        4.12. isxflagset(flag)
-        4.13. resetxflag(flag)
-        4.14. set_send_socket(saddr)
-        4.15. set_recv_socket(saddr)
-        4.16. set_source_address(saddr)
-        4.17. via_add_srvid(flags)
-        4.18. via_add_xavp_params(flags)
+        4.5. sendx(uri, sock, data)
+        4.6. is_incoming()
+        4.7. msg_iflag_set(flagname)
+        4.8. msg_iflag_reset(flagname)
+        4.9. msg_iflag_is_set(flagname)
+        4.10. file_read(fpath, var)
+        4.11. file_write(fpath, content)
+        4.12. setxflag(flag)
+        4.13. isxflagset(flag)
+        4.14. resetxflag(flag)
+        4.15. set_send_socket(saddr)
+        4.16. set_recv_socket(saddr)
+        4.17. set_source_address(saddr)
+        4.18. via_add_srvid(flags)
+        4.19. via_add_xavp_params(flags)
 
 
    5. RPC Commands
    5. RPC Commands
 
 
@@ -255,23 +259,24 @@ modparam("corex", "msg_avp", "$avp(msg)")
 4. Functions
 4. Functions
 
 
    4.1. append_branch([ uri, [ q ] ])
    4.1. append_branch([ uri, [ q ] ])
-   4.2. send([ host [ :port ] ])
+   4.2. send_udp([ host [ :port ] ])
    4.3. send_tcp([ host [ :port ] ])
    4.3. send_tcp([ host [ :port ] ])
    4.4. send_data(uri, data)
    4.4. send_data(uri, data)
-   4.5. is_incoming()
-   4.6. msg_iflag_set(flagname)
-   4.7. msg_iflag_reset(flagname)
-   4.8. msg_iflag_is_set(flagname)
-   4.9. file_read(fpath, var)
-   4.10. file_write(fpath, content)
-   4.11. setxflag(flag)
-   4.12. isxflagset(flag)
-   4.13. resetxflag(flag)
-   4.14. set_send_socket(saddr)
-   4.15. set_recv_socket(saddr)
-   4.16. set_source_address(saddr)
-   4.17. via_add_srvid(flags)
-   4.18. via_add_xavp_params(flags)
+   4.5. sendx(uri, sock, data)
+   4.6. is_incoming()
+   4.7. msg_iflag_set(flagname)
+   4.8. msg_iflag_reset(flagname)
+   4.9. msg_iflag_is_set(flagname)
+   4.10. file_read(fpath, var)
+   4.11. file_write(fpath, content)
+   4.12. setxflag(flag)
+   4.13. isxflagset(flag)
+   4.14. resetxflag(flag)
+   4.15. set_send_socket(saddr)
+   4.16. set_recv_socket(saddr)
+   4.17. set_source_address(saddr)
+   4.18. via_add_srvid(flags)
+   4.19. via_add_xavp_params(flags)
 
 
 4.1.  append_branch([ uri, [ q ] ])
 4.1.  append_branch([ uri, [ q ] ])
 
 
@@ -295,7 +300,7 @@ modparam("corex", "msg_avp", "$avp(msg)")
     append_branch("$avp(uri)", "0.5");
     append_branch("$avp(uri)", "0.5");
 ...
 ...
 
 
-4.2.  send([ host [ :port ] ])
+4.2.  send_udp([ host [ :port ] ])
 
 
    Send the original SIP message to a specific destination in stateless
    Send the original SIP message to a specific destination in stateless
    mode. No changes are applied to received message, no Via header is
    mode. No changes are applied to received message, no Via header is
@@ -309,18 +314,26 @@ modparam("corex", "msg_avp", "$avp(msg)")
 
 
    This function can be used from REQUEST_ROUTE or FAILURE_ROUTE.
    This function can be used from REQUEST_ROUTE or FAILURE_ROUTE.
 
 
-   Example 1.6. send usage
+   Example 1.6. send_udp usage
 ...
 ...
-        send();
-        send("10.20.15.10");
-        send("sip.example.com:5070");
-        send("$var(res)");
+        send_udp();
+        send_udp("10.20.15.10");
+        send_udp("sip.example.com:5070");
+        send_udp("$var(res)");
 ...
 ...
 
 
 4.3.  send_tcp([ host [ :port ] ])
 4.3.  send_tcp([ host [ :port ] ])
 
 
-   This function is identical to send() described above, except that it
-   sends the SIP message using the TCP protocol instead of UDP.
+   This function is identical to send_udp() described above, except that
+   it sends the SIP message using the TCP protocol instead of UDP.
+
+   Example 1.7. send_tcp usage
+...
+        send_tcp();
+        send_tcp("10.20.15.10");
+        send_tcp("sip.example.com:5070");
+        send_tcp("$var(res)");
+...
 
 
 4.4.  send_data(uri, data)
 4.4.  send_data(uri, data)
 
 
@@ -330,12 +343,28 @@ modparam("corex", "msg_avp", "$avp(msg)")
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.7. send_data usage
+   Example 1.8. send_data usage
 ...
 ...
         send_data("sip:example.com:5070;transport=sctp", "Message at $Ts");
         send_data("sip:example.com:5070;transport=sctp", "Message at $Ts");
 ...
 ...
 
 
-4.5.  is_incoming()
+4.5.  sendx(uri, sock, data)
+
+   Send the data to address specified by uri using a specific local
+   socket. All parameters can contain pseudo-variables. The uri parameter
+   has to be a valid SIP URI. The sock parameter has to be a valid socket
+   specifier (like values assigned to $fs). The data parameter can by any
+   arbitrary content.
+
+   This function can be used from ANY_ROUTE.
+
+   Example 1.9. sendx usage
+...
+sendx("sip:example.com:5070;transport=sctp", "sctp:2.3.4.5:5060", "Message at $T
+s");
+...
+
+4.6.  is_incoming()
 
 
    Returns true if contents of message buffer $mb are the data received
    Returns true if contents of message buffer $mb are the data received
    from remote host, otherwise false indicating that the contents of $mb
    from remote host, otherwise false indicating that the contents of $mb
@@ -344,7 +373,7 @@ modparam("corex", "msg_avp", "$avp(msg)")
 
 
    This function can be used from event_route[network:msg].
    This function can be used from event_route[network:msg].
 
 
-   Example 1.8. is_incoming usage
+   Example 1.10. is_incoming usage
 ...
 ...
 event_route[network:msg] {
 event_route[network:msg] {
     if (is_incoming()) {
     if (is_incoming()) {
@@ -357,7 +386,7 @@ event_route[network:msg] {
 }
 }
 ...
 ...
 
 
-4.6.  msg_iflag_set(flagname)
+4.7.  msg_iflag_set(flagname)
 
 
    Set internal SIP message flag. The parameter flagname can be:
    Set internal SIP message flag. The parameter flagname can be:
    USE_UAC_FROM, USE_UAC_TO or UAC_AUTH.
    USE_UAC_FROM, USE_UAC_TO or UAC_AUTH.
@@ -369,56 +398,56 @@ event_route[network:msg] {
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.9. msg_iflag_set usage
+   Example 1.11. msg_iflag_set usage
 ...
 ...
     msg_iflag_set("UAC_AUTH");
     msg_iflag_set("UAC_AUTH");
 ...
 ...
 
 
-4.7.  msg_iflag_reset(flagname)
+4.8.  msg_iflag_reset(flagname)
 
 
    Reset the internal flag given as parameter.
    Reset the internal flag given as parameter.
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.10. msg_iflag_reset usage
+   Example 1.12. msg_iflag_reset usage
 ...
 ...
     msg_iflag_reset("UAC_AUTH");
     msg_iflag_reset("UAC_AUTH");
 ...
 ...
 
 
-4.8.  msg_iflag_is_set(flagname)
+4.9.  msg_iflag_is_set(flagname)
 
 
    Test if the internal flag given as parameter is set.
    Test if the internal flag given as parameter is set.
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.11. msg_iflag_is_set usage
+   Example 1.13. msg_iflag_is_set usage
 ...
 ...
     if(msg_iflag_is_set("UAC_AUTH")) { ... }
     if(msg_iflag_is_set("UAC_AUTH")) { ... }
 ...
 ...
 
 
-4.9.  file_read(fpath, var)
+4.10.  file_read(fpath, var)
 
 
    Read content of a text file into a variable.
    Read content of a text file into a variable.
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.12. file_read usage
+   Example 1.14. file_read usage
 ...
 ...
 if(file_read("/tmp/data.txt", "$var(data)")) { ... }
 if(file_read("/tmp/data.txt", "$var(data)")) { ... }
 ...
 ...
 
 
-4.10.  file_write(fpath, content)
+4.11.  file_write(fpath, content)
 
 
    Write content of parameter to a text file.
    Write content of parameter to a text file.
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.13. file_write usage
+   Example 1.15. file_write usage
 ...
 ...
 if(file_write("/tmp/data.txt", "Data is: $var(data)")) { ... }
 if(file_write("/tmp/data.txt", "Data is: $var(data)")) { ... }
 ...
 ...
 
 
-4.11. setxflag(flag)
+4.12. setxflag(flag)
 
 
    Set the extended message (transaction) flag.
    Set the extended message (transaction) flag.
 
 
@@ -428,7 +457,7 @@ if(file_write("/tmp/data.txt", "Data is: $var(data)")) { ... }
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.14. setxflag usage
+   Example 1.16. setxflag usage
 ...
 ...
 setxflag("1");
 setxflag("1");
 ...
 ...
@@ -436,7 +465,7 @@ $var(flag) = 11;
 setxflag("$var(flag)");
 setxflag("$var(flag)");
 ...
 ...
 
 
-4.12. isxflagset(flag)
+4.13. isxflagset(flag)
 
 
    Return true of the extended message (transaction) flag is set.
    Return true of the extended message (transaction) flag is set.
 
 
@@ -446,7 +475,7 @@ setxflag("$var(flag)");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.15. isxflagset usage
+   Example 1.17. isxflagset usage
 ...
 ...
 if(isxflagset("1"))
 if(isxflagset("1"))
 {
 {
@@ -454,7 +483,7 @@ if(isxflagset("1"))
 }
 }
 ...
 ...
 
 
-4.13. resetxflag(flag)
+4.14. resetxflag(flag)
 
 
    Reset the extended message (transaction) flag.
    Reset the extended message (transaction) flag.
 
 
@@ -464,12 +493,12 @@ if(isxflagset("1"))
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.16. resetxflag usage
+   Example 1.18. resetxflag usage
 ...
 ...
 resetxflag("1");
 resetxflag("1");
 ...
 ...
 
 
-4.14. set_send_socket(saddr)
+4.15. set_send_socket(saddr)
 
 
    Set the socket for sending out.
    Set the socket for sending out.
 
 
@@ -479,12 +508,12 @@ resetxflag("1");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.17. set_send_socket usage
+   Example 1.19. set_send_socket usage
 ...
 ...
 set_send_socket("udp:127.0.0.1:5060");
 set_send_socket("udp:127.0.0.1:5060");
 ...
 ...
 
 
-4.15. set_recv_socket(saddr)
+4.16. set_recv_socket(saddr)
 
 
    Switch local socket used for receiving the message.
    Switch local socket used for receiving the message.
 
 
@@ -494,12 +523,12 @@ set_send_socket("udp:127.0.0.1:5060");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.18. set_recv_socket usage
+   Example 1.20. set_recv_socket usage
 ...
 ...
 set_recv_socket("udp:127.0.0.1:5060");
 set_recv_socket("udp:127.0.0.1:5060");
 ...
 ...
 
 
-4.16. set_source_address(saddr)
+4.17. set_source_address(saddr)
 
 
    Set the source address for the message.
    Set the source address for the message.
 
 
@@ -509,12 +538,12 @@ set_recv_socket("udp:127.0.0.1:5060");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.19. set_source_address usage
+   Example 1.21. set_source_address usage
 ...
 ...
 set_source_address("udp:127.0.0.1:5080");
 set_source_address("udp:127.0.0.1:5080");
 ...
 ...
 
 
-4.17. via_add_srvid(flags)
+4.18. via_add_srvid(flags)
 
 
    Control if srvid parameter is added or not to local Via. If yes, the
    Control if srvid parameter is added or not to local Via. If yes, the
    value is server_id, added only if it is different than 0.
    value is server_id, added only if it is different than 0.
@@ -524,12 +553,12 @@ set_source_address("udp:127.0.0.1:5080");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.20. via_add_srvid usage
+   Example 1.22. via_add_srvid usage
 ...
 ...
 via_add_srv("1");
 via_add_srv("1");
 ...
 ...
 
 
-4.18. via_add_xavp_params(flags)
+4.19. via_add_xavp_params(flags)
 
 
    Control if fields of the xavp with the name specified by
    Control if fields of the xavp with the name specified by
    xavp_via_params global parameter are added or not to local Via.
    xavp_via_params global parameter are added or not to local Via.
@@ -539,7 +568,7 @@ via_add_srv("1");
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.21. via_add_xavp_params usage
+   Example 1.23. via_add_xavp_params usage
 ...
 ...
 via_add_xavp_params("1");
 via_add_xavp_params("1");
 ...
 ...
@@ -678,7 +707,7 @@ via_add_xavp_params("1");
    Next is a basic usage example where encoding and decoding is done using
    Next is a basic usage example where encoding and decoding is done using
    PERL,
    PERL,
 
 
-   Example 1.22. event_route[network:msg] use cases
+   Example 1.24. event_route[network:msg] use cases
 ...
 ...
 loadmodule "app_perl.so"
 loadmodule "app_perl.so"
 loadmodule "corex.so"
 loadmodule "corex.so"
@@ -709,7 +738,7 @@ event_route[network:msg] {
 }
 }
 ...
 ...
 
 
-   Example 1.23. Sample PERL code for do_compress and do_uncompress
+   Example 1.25. Sample PERL code for do_compress and do_uncompress
 ...
 ...
 use strict;
 use strict;
 use warnings;
 use warnings;