Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 2.56 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /**
  2.  * Patterns
  3.  * ----------------------------------------------------------------
  4.  *      X,A         matches any digit from 0-9
  5.  *       P          matches any digit from 0-8
  6.  *       Z          matches any digit from 1-9
  7.  *       N          matches any digit from 2-9
  8.  *    [1237-9]      matches any digit or letter in the brackets
  9.  *                      (in this example, 1,2,3,7,8,9)
  10.  *       .          wildcard, matches one or more characters
  11.  *       !          wildcard, matches zero or more characters immediately
  12.  *      ( )         Creates the number group used to dial out
  13.  *       ?          makes the preceding number optional
  14.  *
  15.  *
  16.  * Important Notes
  17.  * ---------------------------------------------------------------
  18.  *  ->   Use the parentheses to group the numbers you want to use for
  19.  *       outbound dialing.  If you do not have a group the entire
  20.  *       pattern will be used.
  21.  *  ->   For convience you may place spaces in the patterns, these will
  22.  *       be removed for you
  23.  *  ->   If you are are attempting to include any of the above pattern
  24.  *       charaters (such as X), you must escape it via \ example \X.
  25.  *  ->   All patterns must be provided as uppercase (where appropriate)
  26.  *
  27.  * Example 1
  28.  * ---------------------------------------------------------------
  29.  *       Pattern = 1?(XXXXXXXXX)
  30.  *       Number Dialed = 15558675309
  31.  *       As Sent to Trunk = {trunk_prepend}5558675309
  32.  *       ---------------------------------------------------------
  33.  *       In this case the first 1 is optional (as indicated by the
  34.  *       explanation point after it) and if present is outside the
  35.  *       number groups used to send to the trunk.
  36.  *
  37.  *
  38.  * Example 2
  39.  * ---------------------------------------------------------------
  40.  *       Pattern = 91?(XXXXXXXXX)
  41.  *       Number Dialed = 95558675309
  42.  *       As Sent to Trunk = {trunk_prepend}5558675309
  43.  *       ---------------------------------------------------------
  44.  *       In this case you must dial 9 first, then an optional 1 followed
  45.  *       by exactly 10 digits.  Both the 9 and, if present, the 1 will
  46.  *       NOT be sent to the trunk.
  47.  */
  48. $config['outbound_patterns'][] = array(
  49.     'name' => '10-digit US',
  50.     'patterns' => array(
  51.         '1?(NPA NXX XXXX)',
  52.         '411',
  53.         '611'
  54.     )
  55. );
  56.  
  57. $config['outbound_patterns'][] = array(
  58.     'name' => 'International (011+)',
  59.     'patterns' => array(
  60.         '011(X.)'
  61.     )
  62. );
  63.  
  64. $config['outbound_patterns'][] = array(
  65.     'name' => 'Emergency Services (911)',
  66.     'patterns' => array(
  67.         '911'
  68.     )
  69. );