Module: kamailio Branch: master Commit: 4bfcc38c665fd321aee8e6fea8324156ba583f84 URL: https://github.com/kamailio/kamailio/commit/4bfcc38c665fd321aee8e6fea8324156ba583f84
Author: Kamailio Dev <[email protected]> Committer: Kamailio Dev <[email protected]> Date: 2018-03-28T08:31:58+02:00 modules: readme files regenerated - phonenum ... [skip ci] --- Modified: src/modules/phonenum/README --- Diff: https://github.com/kamailio/kamailio/commit/4bfcc38c665fd321aee8e6fea8324156ba583f84.diff Patch: https://github.com/kamailio/kamailio/commit/4bfcc38c665fd321aee8e6fea8324156ba583f84.patch --- diff --git a/src/modules/phonenum/README b/src/modules/phonenum/README index 711a532e65..90f06f2a92 100644 --- a/src/modules/phonenum/README +++ b/src/modules/phonenum/README @@ -30,6 +30,7 @@ Daniel-Constantin Mierla 4. Functions 4.1. phonenum_match(num, pvc) + 4.2. phonenum_match(num, cnc, pvc) 5. Pseudo Variables @@ -37,6 +38,7 @@ Daniel-Constantin Mierla 1.1. Set smode parameter 1.2. phonenum_match usage + 1.3. phonenum_match_cn usage Chapter 1. Admin Guide @@ -55,6 +57,7 @@ Chapter 1. Admin Guide 4. Functions 4.1. phonenum_match(num, pvc) + 4.2. phonenum_match(num, cnc, pvc) 5. Pseudo Variables @@ -107,6 +110,7 @@ modparam("phonenum", "smode", 0) 4. Functions 4.1. phonenum_match(num, pvc) + 4.2. phonenum_match(num, cnc, pvc) 4.1. phonenum_match(num, pvc) @@ -129,6 +133,28 @@ if(phonenum_match("1-484-555-8888", "src")) { } ... +4.2. phonenum_match(num, cnc, pvc) + + Match num against the libphonenumber and set the attributes inside the + pvc container, restricting the rules with a country name code (two + letter, e.g: "DE", "US", "ES"). The function has to be called before + accessing a key via: $phn(pvc=>key). + + The parameters can be static strings or strings with variables. + + It can be used from ANY_ROUTE. + + Example 1.3. phonenum_match_cn usage +... +if(phonenum_match_cn("1-484-555-8888", "US", "src")) { + if($phn(src=>valid)==1) { + xlog("number normalized to: $phn(src=>normalized)\n"); + } else { + xlog("number normalization error: $phn(src=>error)\n"); + } +} +... + 5. Pseudo Variables * $phn(pvc=>key) - pvc is an identifier for this query result; it is _______________________________________________ Kamailio (SER) - Development Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
