# Module parameter for database access.

## `db_url` (String)

URL to the database containing the data.

Default value is &defaultrodb;.

### Set `db_url` parameter

    ...
    modparam("carrierroute", "db_url", "&exampledb;")
    ...

## `carrierroute_table` (String)

Name of the carrierroute table for the carrierroute module.

Default value is carrierroute.

### Set `carrierroute_table` parameter

    ...
    modparam("carrierroute", "carrierroute_table", "carrierroute")
    ...

## `carrierroute_id_col` (string)

Name of the column contains the unique identifier of a route.

### Set `carrierroute_id_col` parameter

    ...
    modparam("carrierroute", "carrierroute_id_col", "id")
    ...

## `carrierroute_carrier_col` (string)

This column contains the carrier id.

### Set `carrierroute_carrier_col` parameter

    ...
    modparam("carrierroute", "carrierroute_carrier_col", "carrier")
    ...

## `carrierroute_domain_col` (string)

This column contains the routing domain id. You can define several routing domains to have different routing rules. Maybe you use domain 0 for normal routing and domain 1 if domain 0 failed.

### Set `carrierroute_domain_col` parameter

    ...
    modparam("carrierroute", "carrierroute_domain_col", "domain")
    ...

## `carrierroute_scan_prefix_col` (string)

Name of column contains the scan prefixes. Scan prefixes define the matching portion of a phone number, e.g. when we have the scan prefixes 49721 and 49, the called number is 49721913740, it matches 49721, because the longest match is taken. If no prefix matches, the number is not routed. To prevent this, an empty prefix value of could be added.

### Set `carrierroute_scan_prefix_col` parameter

    ...
    modparam("carrierroute", "carrierroute_scan_prefix_col", "scan_prefix")
    ...

## `carrierroute_flags_col` (string)

This column contains the flags used for rule matching.

### Set `carrierroute_flags_col` parameter

    ...
    modparam("carrierroute", "carrierroute_flags_col", "flags")
    ...

## `carrierroute_mask_col` (string)

This column contains the mask that is applied to the message flags before rule matching.

### Set `carrierroute_mask_col` parameter

    ...
    modparam("carrierroute", "carrierroute_mask_col", "mask")
    ...

## `carrierroute_prob_col` (string)

Name of column contains the probability. The probability value is used to distribute the traffic between several gateways. Let's say 70 % of the traffic shall be routed to gateway A, the other 30 % shall be routed to gateway B, we define a rule for gateway A with a prob value of 0.7 and a rule for gateway B with a prob value of 0.3.

If all probabilities for a given prefix, tree and domain don't add to 100%, the prefix values will be adjusted according the given prob values. E.g. if three hosts with prob values of 0.5, 0.5 and 0.4 are defined, the resulting probabilities are 35.714, 35.714 and 28.571%. But it is better to choose meaningful values in the first place because of clarity.

### Set `carrierroute_prob_col` parameter

    ...
    modparam("carrierroute", "carrierroute_prob_col", "prob")
    ...

## `carrierroute_strip_col` (string)

Name of the column contains the number of digits to be stripped of the userpart of an URI before prepending rewrite_prefix.

### Set `carrierroute_strip_col` parameter

    ...
    modparam("carrierroute", "carrierroute_strip_col", "strip")
    ...

## `carrierroute_rewrite_host_col` (string)

Name of column contains the rewrite prefixes. Here you can define a rewrite prefix for the localpart of the SIP URI. An empty field represents a blocklist entry, anything else is put as domain part into the Request URI of the SIP message.

### Set `carrierroute_rewrite_host_col` parameter

    ...
    modparam("carrierroute", "carrierroute_rewrite_host_col", "rewrite_host")
    ...

## `carrierroute_rewrite_prefix_col` (string)

Name of column contains the rewrite prefixes. Here you can define a rewrite prefix for the localpart of the SIP URI.

### Set `carrierroute_rewrite_prefix_col` parameter

    ...
    modparam("carrierroute", "carrierroute_rewrite_prefix_col", "rewrite_prefix")
    ...

## `carrierroute_rewrite_suffix_col` (string)

Name of column contains the rewrite suffixes. Here you can define a rewrite suffix for the localpart of the SIP URI.

### Set `carrierroute_rewrite_suffix_col` parameter

    ...
    modparam("carrierroute", "carrierroute_rewrite_suffix_col", "rewrite_suffix")
    ...

## `carrierroute_description_col` (string)

A comment for the route entry, useful for larger routing tables. The comment is also displayed by the rpc cmd "cr.dump_routes".

### Set `carrierroute_description_col` parameter

    ...
    modparam("carrierroute", "carrierroute_description_col", "description")
    ...

## `carrierfailureroute_table` (String)

Name of the carrierfailureroute table for the carrierroute module.

Default value is carrierfailureroute.

### Set `carrierfailureroute_table` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_table", "carrierfailureroute")
    ...

## `carrierfailureroute_id_col` (string)

This column contains the unique identifier of a failure route.

### Set `carrierfailureroute_id_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_id_col", "id")
    ...

## `carrierfailureroute_carrier_col` (string)

This column contains the carrier id.

### Set `carrierfailureroute_carrier_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_carrier_col", "carrier")
    ...

## `carrierfailureroute_domain_col` (string)

This column contains the routing domain id. You can define several routing domains to have different routing rules. Maybe you use domain 0 for normal routing and domain 1 if domain 0 failed.

### Set `carrierfailureroute_domain_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_domain_col", "domain")
    ...

## `carrierfailureroute_scan_prefix_col` (string)

Name of column contains the scan prefixes. Scan prefixes define the matching portion of a phone number, e.g. we have the scan prefixes 49721 and 49, the called number is 49721913740, it matches 49721, because the longest match is taken. If no prefix matches, the number is not failure routed. To prevent this, an empty prefix value of could be added.

### Set `carrierfailureroute_scan_prefix_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_scan_prefix_col", "scan_prefix")
    ...

## `carrierfailureroute_host_name_col` (string)

Name of the column containing the host name of the last routing destination, using for rules matching.

### Set `carrierfailureroute_host_name_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_host_name_col", "host_name")
    ...

## `carrierfailureroute_reply_code_col` (string)

This column contains the reply code used for rule matching.

### Set `carrierfailureroute_reply_code_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_reply_code_col", "reply_code")
    ...

## `carrierfailureroute_flags_col` (string)

This column contains the flags used for rule matching.

### Set `carrierfailureroute_flags_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_flags_col", "flags")
    ...

## `carrierfailureroute_mask_col` (string)

This column contains the mask that is applied to the message flags before rule matching.

### Set `carrierfailureroute_mask_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_mask_col", "mask")
    ...

## `carrierfailureroute_next_domain_col` (string)

This column contains the route domain id that should be used for the next routing attempt.

### Set `carrierfailureroute_next_domain_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_next_domain_col", "next_domain")
    ...

## `carrierfailureroute_description_col` (string)

A comment for the route entry, useful for larger routing tables.

### Set `carrierfailureroute_description_col` parameter

    ...
    modparam("carrierroute", "carrierfailureroute_description_col", "description")
    ...

## `carrier_name_table` (String)

Name of the carrier_name table for the carrierroute module.

Default value is carrier_name.

### Set `carrier_name_table` parameter

    ...
    modparam("carrierroute", "carrier_name_table", "carrier_name")
    ...

## `carrier_name_id_col` (string)

Name of the column containing the unique identifier of a carrier.

### Set `carrier_name_id_col` parameter

    ...
    modparam("carrierroute", "carrier_name_id_col", "id")
    ...

## `carrier_name_carrier_col` (string)

This column contains the carrier name.

### Set `carrier_name_carrier_col` parameter

    ...
    modparam("carrierroute", "carrier_name_carrier_col", "carrier")
    ...

## `domain_name_table` (String)

Name of the domain_name table for the carrierroute module.

Default value is domain_name.

### Set `domain_name_table` parameter

    ...
    modparam("carrierroute", "domain_name_table", "domain_name")
    ...

## `domain_name_id_col` (string)

Name of the column containing the unique identifier of a domain.

### Set `domain_name_id_col` parameter

    ...
    modparam("carrierroute", "domain_name_id_col", "id")
    ...

## `domain_name_domain_col` (string)

This column contains the domain name.

### Set `domain_name_domain_col` parameter

    ...
    modparam("carrierroute", "domain_name_domain_col", "domain")
    ...