Browse Source

cr: fix error in documentation related to failure_route

Henning Westerholt 15 years ago
parent
commit
bf570f4b5f
2 changed files with 36 additions and 32 deletions
  1. 33 31
      modules/carrierroute/README
  2. 3 1
      modules/carrierroute/doc/carrierroute_admin.xml

+ 33 - 31
modules/carrierroute/README

@@ -12,7 +12,7 @@ Henning Westerholt
 
 
    1&1 Internet AG
    1&1 Internet AG
 
 
-   Copyright © 2007 1&1 Internet AG
+   Copyright © 2007 1&1 Internet AG
    Revision History
    Revision History
    Revision $Revision$ $Date$
    Revision $Revision$ $Date$
      __________________________________________________________________
      __________________________________________________________________
@@ -273,7 +273,7 @@ Chapter 1. Admin Guide
    use the lcr and dispatcher module.
    use the lcr and dispatcher module.
 
 
    If you want to use this module in failure routes, then you need to call
    If you want to use this module in failure routes, then you need to call
-   “append_branch()� after rewriting the request URI in order to relay the
+   "append_branch()" after rewriting the request URI in order to relay the
    message to the new target. Its also supportes the usage of database
    message to the new target. Its also supportes the usage of database
    derived failure routing descisions with the carrierfailureroute table.
    derived failure routing descisions with the carrierfailureroute table.
 
 
@@ -290,7 +290,7 @@ Chapter 1. Admin Guide
        needs the capability to issue raw queries. Its not possible to use
        needs the capability to issue raw queries. Its not possible to use
        the dbtext or db_berkeley module at the moment.
        the dbtext or db_berkeley module at the moment.
      * The tm module, when you want to use the $T_reply_code
      * The tm module, when you want to use the $T_reply_code
-       pseudo-variable in the “cr_next_domain� function.
+       pseudo-variable in the "cr_next_domain" function.
 
 
 2.2. External Libraries or Applications
 2.2. External Libraries or Applications
 
 
@@ -317,7 +317,7 @@ Chapter 1. Admin Guide
 
 
    The name of the table containing the subscribers
    The name of the table containing the subscribers
 
 
-   Default value is “subscriber�.
+   Default value is "subscriber".
 
 
    Example 1.1. Set subscriber_table parameter
    Example 1.1. Set subscriber_table parameter
 ...
 ...
@@ -329,7 +329,7 @@ modparam("carrierroute", "subscriber_table", "subscriber")
    The name of the column in the subscriber table containing the
    The name of the column in the subscriber table containing the
    usernames.
    usernames.
 
 
-   Default value is “username�.
+   Default value is "username".
 
 
    Example 1.2. Set subscriber_user_col parameter
    Example 1.2. Set subscriber_user_col parameter
 ...
 ...
@@ -341,7 +341,7 @@ modparam("carrierroute", "subscriber_user_col", "username")
    The name of the column in the subscriber table containing the domain of
    The name of the column in the subscriber table containing the domain of
    the subscriber.
    the subscriber.
 
 
-   Default value is “domain�.
+   Default value is "domain".
 
 
    Example 1.3. Set subscriber_domain_col parameter
    Example 1.3. Set subscriber_domain_col parameter
 ...
 ...
@@ -353,7 +353,7 @@ modparam("carrierroute", "subscriber_domain_col", "domain")
    The name of the column in the subscriber table containing the carrier
    The name of the column in the subscriber table containing the carrier
    id of the subscriber.
    id of the subscriber.
 
 
-   Default value is “cr_preferred_carrier�.
+   Default value is "cr_preferred_carrier".
 
 
    Example 1.4. Set subscriber_carrier_col parameter
    Example 1.4. Set subscriber_carrier_col parameter
 ...
 ...
@@ -365,7 +365,7 @@ modparam("carrierroute", "subscriber_carrier_col", "cr_preferred_carrier")
    Specifies whether the module loads its config data from a file or from
    Specifies whether the module loads its config data from a file or from
    a database. Possible values are file or db.
    a database. Possible values are file or db.
 
 
-   Default value is “file�.
+   Default value is "file".
 
 
    Example 1.5. Set config_source parameter
    Example 1.5. Set config_source parameter
 ...
 ...
@@ -376,7 +376,7 @@ modparam("carrierroute", "config_source", "file")
 
 
    Specifies the path to the config file.
    Specifies the path to the config file.
 
 
-   Default value is “/etc/kamailio/carrierroute.conf�.
+   Default value is "/etc/kamailio/carrierroute.conf".
 
 
    Example 1.6. Set config_file parameter
    Example 1.6. Set config_file parameter
 ...
 ...
@@ -388,7 +388,7 @@ modparam("carrierroute", "config_file", "/etc/kamailio/carrierroute.conf")
    The name of the carrier tree used per default (if the current
    The name of the carrier tree used per default (if the current
    subscriber has no preferred tree)
    subscriber has no preferred tree)
 
 
-   Default value is “default�.
+   Default value is "default".
 
 
    Example 1.7. Set default_tree parameter
    Example 1.7. Set default_tree parameter
 ...
 ...
@@ -401,7 +401,7 @@ modparam("carrierroute", "default_tree", "default")
    use the domain part for user matching or not. This parameter is tunable
    use the domain part for user matching or not. This parameter is tunable
    via the ser cfg framework.
    via the ser cfg framework.
 
 
-   Default value is “0�.
+   Default value is "0".
 
 
    Example 1.8. Set use_domain parameter
    Example 1.8. Set use_domain parameter
 ...
 ...
@@ -415,7 +415,7 @@ modparam("carrierroute", "use_domain", 0)
    1, the default tree is used. Otherwise, cr_user_rewrite_uri returns an
    1, the default tree is used. Otherwise, cr_user_rewrite_uri returns an
    error. This parameter is tunable via the ser cfg framework.
    error. This parameter is tunable via the ser cfg framework.
 
 
-   Default value is “1�.
+   Default value is "1".
 
 
    Example 1.9. Set fallback_default parameter
    Example 1.9. Set fallback_default parameter
 ...
 ...
@@ -430,7 +430,7 @@ modparam("carrierroute", "fallback_default", 1)
    The database driver must support the fetch_result() capability. This
    The database driver must support the fetch_result() capability. This
    parameter is tunable via the ser cfg framework.
    parameter is tunable via the ser cfg framework.
 
 
-   Default value is “2000�.
+   Default value is "2000".
 
 
    Example 1.10. Set fetch_rows parameter
    Example 1.10. Set fetch_rows parameter
 ...
 ...
@@ -446,7 +446,7 @@ modparam("carrierroute", "fetch_rows", 3000)
    matching. Please be aware that memory requirements for storing the
    matching. Please be aware that memory requirements for storing the
    routing tree in shared memory will also increase by a factor of 12.8.
    routing tree in shared memory will also increase by a factor of 12.8.
 
 
-   Default value is “10�.
+   Default value is "10".
 
 
    Example 1.11. Set match_mode parameter
    Example 1.11. Set match_mode parameter
 ...
 ...
@@ -489,7 +489,7 @@ cr_tree_rewrite_uri(tree, domain)
    used in the config file mode, as it needs a mapping of the given user
    used in the config file mode, as it needs a mapping of the given user
    to a certain carrier. The is derived from a database entry belonging to
    to a certain carrier. The is derived from a database entry belonging to
    the user parameter. This mapping must be available in the table that is
    the user parameter. This mapping must be available in the table that is
-   specified in the “subscriber_table� variable. This data is not cached
+   specified in the "subscriber_table" variable. This data is not cached
    in memory, that means for every execution of this function a database
    in memory, that means for every execution of this function a database
    query will be done.
    query will be done.
 
 
@@ -519,7 +519,7 @@ descavp)
 
 
    If flags and masks values are specified in the routing rule, they will
    If flags and masks values are specified in the routing rule, they will
    be compared by this function to the message flags. Specify a flag and
    be compared by this function to the message flags. Specify a flag and
-   mask value of “0� to match to all possible message flags (this is the
+   mask value of "0" to match to all possible message flags (this is the
    default value). If flags and mask are not zero, and no match to the
    default value). If flags and mask are not zero, and no match to the
    message flags is possible, no routing will be done. The calculation of
    message flags is possible, no routing will be done. The calculation of
    the hash and the load-balancing is done after the flags matching.
    the hash and the load-balancing is done after the flags matching.
@@ -756,13 +756,15 @@ route {
 }
 }
 
 
 failure_route[1] {
 failure_route[1] {
+        revert_uri();
         # In case of failure, send it to an alternative route:
         # In case of failure, send it to an alternative route:
         if (t_check_status("408|5[0-9][0-9]")) {
         if (t_check_status("408|5[0-9][0-9]")) {
-                #choose route domain 1 of the default carrier
+        #choose route domain 1 of the default carrier
         if(!cr_route("default", "1", "$rU", "$rU", "call_id")){
         if(!cr_route("default", "1", "$rU", "$rU", "call_id")){
                         t_reply("403", "Not allowed");
                         t_reply("403", "Not allowed");
                 } else {
                 } else {
                         t_on_failure("2");
                         t_on_failure("2");
+                        append_branch();
                         t_relay();
                         t_relay();
                 }
                 }
         }
         }
@@ -828,7 +830,7 @@ failure_route[1] {
    Don't use a hash index value of zero. If you ommit the hash completly,
    Don't use a hash index value of zero. If you ommit the hash completly,
    the module gives them a autogenerated value, starting from one.
    the module gives them a autogenerated value, starting from one.
 
 
-   Use the “NULL� prefix to specify an empty prefix in the config file.
+   Use the "NULL" prefix to specify an empty prefix in the config file.
    Please note that the prefix is matched against the request URI (or to
    Please note that the prefix is matched against the request URI (or to
    URI), if they did not contain a valid (numerical) URI, no match is
    URI), if they did not contain a valid (numerical) URI, no match is
    possible. So for loadbalancing purposes e.g. for your registrars, you
    possible. So for loadbalancing purposes e.g. for your registrars, you
@@ -919,21 +921,21 @@ domain register {
 +----+---------+--------+-------------+-------+------+---------------+
 +----+---------+--------+-------------+-------+------+---------------+
 ...
 ...
 
 
-   This table contains three routes to two gateways for the “49� prefix,
+   This table contains three routes to two gateways for the "49" prefix,
    and a default route for other prefixes over carrier 2 and carrier 1.
    and a default route for other prefixes over carrier 2 and carrier 1.
    The gateways for the default carrier will be used for functions that
    The gateways for the default carrier will be used for functions that
    don't support the user specific carrier lookup. The routing rules for
    don't support the user specific carrier lookup. The routing rules for
-   carrier 1 and carrier 2 for the “49� prefix contains a additional rule
+   carrier 1 and carrier 2 for the "49" prefix contains a additional rule
    with the domain 2, that can be used for example as fallback if the
    with the domain 2, that can be used for example as fallback if the
    gateways in domain 1 are not reachable. Two more fallback rules (domain
    gateways in domain 1 are not reachable. Two more fallback rules (domain
    3 and 4) for carrier 1 are also supplied to support the functionality
    3 and 4) for carrier 1 are also supplied to support the functionality
    of the carrierfailureroute table example that is provided in the next
    of the carrierfailureroute table example that is provided in the next
    section.
    section.
 
 
-   This table provides also a “carrier 1� routing rule for the “49�
+   This table provides also a "carrier 1" routing rule for the "49"
    prefix, that is only choosen if some message flags are set. If this
    prefix, that is only choosen if some message flags are set. If this
-   flags are not set, the other two rules are used. The “strip�, “mask�
-   and “comment� colums are omitted for brevity.
+   flags are not set, the other two rules are used. The "strip", "mask"
+   and "comment" colums are omitted for brevity.
 
 
    Example 1.21. Example database content - simple carrierfailureroute
    Example 1.21. Example database content - simple carrierfailureroute
    table
    table
@@ -946,10 +948,10 @@ domain register {
 +----+---------+--------+---------------+------------+-------------+
 +----+---------+--------+---------------+------------+-------------+
 ...
 ...
 
 
-   This table contains two failure routes for the “gw.carrier1-1� and “-2�
+   This table contains two failure routes for the "gw.carrier1-1" and "-2"
    gateways. For any (failure) reply code the respective next domain is
    gateways. For any (failure) reply code the respective next domain is
    choosen. After that no more failure routes are available, an error will
    choosen. After that no more failure routes are available, an error will
-   be returned from the “cr_next_domain� function. Not all table colums
+   be returned from the "cr_next_domain" function. Not all table colums
    are show here for brevity.
    are show here for brevity.
 
 
    For each failure route domain and carrier that is added to the
    For each failure route domain and carrier that is added to the
@@ -1010,7 +1012,7 @@ domain register {
 
 
 7.3. User specific routing
 7.3. User specific routing
 
 
-   For a functional routing the “cr_preferred_carrier� column must be
+   For a functional routing the "cr_preferred_carrier" column must be
    added to the subscriber table (or to the table and column that you
    added to the subscriber table (or to the table and column that you
    specified as modul parameter) to choose the actual carrier for the
    specified as modul parameter) to choose the actual carrier for the
    users.
    users.
@@ -1062,7 +1064,7 @@ Chapter 2. Module parameter for database access.
 
 
    URL to the database containing the data.
    URL to the database containing the data.
 
 
-   Default value is “mysql://openserro:openserro@localhost/openser�.
+   Default value is "mysql://openserro:openserro@localhost/openser".
 
 
    Example 2.1. Set db_url parameter
    Example 2.1. Set db_url parameter
 ...
 ...
@@ -1073,7 +1075,7 @@ modparam("carrierroute", "db_url", "dbdriver://username:password@dbhost/dbname")
 
 
    Name of the carrierroute table for the carrierroute module.
    Name of the carrierroute table for the carrierroute module.
 
 
-   Default value is “carrierroute�.
+   Default value is "carrierroute".
 
 
    Example 2.2. Set carrierroute_table parameter
    Example 2.2. Set carrierroute_table parameter
 ...
 ...
@@ -1216,7 +1218,7 @@ modparam("carrierroute", "carrierroute_description_col", "description")
 
 
    Name of the carrierfailureroute table for the carrierroute module.
    Name of the carrierfailureroute table for the carrierroute module.
 
 
-   Default value is “carrierfailureroute�.
+   Default value is "carrierfailureroute".
 
 
    Example 2.15. Set carrierfailureroute_table parameter
    Example 2.15. Set carrierfailureroute_table parameter
 ...
 ...
@@ -1327,7 +1329,7 @@ modparam("carrierroute", "carrierfailureroute_description_col", "description")
 
 
    Name of the carrier_name table for the carrierroute module.
    Name of the carrier_name table for the carrierroute module.
 
 
-   Default value is “carrier_name�.
+   Default value is "carrier_name".
 
 
    Example 2.26. Set carrier_name_table parameter
    Example 2.26. Set carrier_name_table parameter
 ...
 ...
@@ -1356,7 +1358,7 @@ modparam("carrierroute", "carrier_name_carrier_col", "carrier")
 
 
    Name of the domain_name table for the carrierroute module.
    Name of the domain_name table for the carrierroute module.
 
 
-   Default value is “domain_name�.
+   Default value is "domain_name".
 
 
    Example 2.29. Set domain_name_table parameter
    Example 2.29. Set domain_name_table parameter
 ...
 ...

+ 3 - 1
modules/carrierroute/doc/carrierroute_admin.xml

@@ -837,13 +837,15 @@ route {
 }
 }
 
 
 failure_route[1] {
 failure_route[1] {
+	revert_uri();
 	# In case of failure, send it to an alternative route:
 	# In case of failure, send it to an alternative route:
 	if (t_check_status("408|5[0-9][0-9]")) {
 	if (t_check_status("408|5[0-9][0-9]")) {
-		#choose route domain 1 of the default carrier
+	#choose route domain 1 of the default carrier
 	if(!cr_route("default", "1", "$rU", "$rU", "call_id")){
 	if(!cr_route("default", "1", "$rU", "$rU", "call_id")){
 			t_reply("403", "Not allowed");
 			t_reply("403", "Not allowed");
 		} else {
 		} else {
 			t_on_failure("2");
 			t_on_failure("2");
+			append_branch();
 			t_relay();
 			t_relay();
 		}
 		}
 	}
 	}