|
@@ -111,8 +111,13 @@ modparam("phonenum", "smode", 0)
|
|
<title><function>phonenum_match</function> usage</title>
|
|
<title><function>phonenum_match</function> usage</title>
|
|
<programlisting format="linespecific">
|
|
<programlisting format="linespecific">
|
|
...
|
|
...
|
|
-if(phonenum_match("1-484-555-8888", "src"))
|
|
|
|
- xlog("number normalized to: $phn(src=>num)\n");
|
|
|
|
|
|
+if(phonenum_match("1-484-555-8888", "src")) {
|
|
|
|
+ if($phn(src=>valid)==1) {
|
|
|
|
+ xlog("number normalized to: $phn(src=>normalized)\n");
|
|
|
|
+ } else {
|
|
|
|
+ xlog("number normalization error: $phn(src=>error)\n");
|
|
|
|
+ }
|
|
|
|
+}
|
|
...
|
|
...
|
|
</programlisting>
|
|
</programlisting>
|
|
</example>
|
|
</example>
|
|
@@ -131,16 +136,27 @@ if(phonenum_match("1-484-555-8888", "src"))
|
|
</para>
|
|
</para>
|
|
<itemizedlist>
|
|
<itemizedlist>
|
|
<listitem><para>
|
|
<listitem><para>
|
|
- <emphasis>number</emphasis> - normalized phone number
|
|
|
|
|
|
+ <emphasis>number</emphasis> - phone number that is matched
|
|
</para></listitem>
|
|
</para></listitem>
|
|
<listitem><para>
|
|
<listitem><para>
|
|
- <emphasis>country</emphasis> - country for phone number
|
|
|
|
|
|
+ <emphasis>valid</emphasis> - 1 if the matched number has a
|
|
|
|
+ valid result; 0 otherwise
|
|
</para></listitem>
|
|
</para></listitem>
|
|
<listitem><para>
|
|
<listitem><para>
|
|
- <emphasis>region</emphasis> - region for phone number
|
|
|
|
|
|
+ <emphasis>normalized</emphasis> - normalized phone number
|
|
</para></listitem>
|
|
</para></listitem>
|
|
<listitem><para>
|
|
<listitem><para>
|
|
- <emphasis>operator</emphasis> - operator for phone number
|
|
|
|
|
|
+ <emphasis>cctel</emphasis> - country code for phone number
|
|
|
|
+ </para></listitem>
|
|
|
|
+ <listitem><para>
|
|
|
|
+ <emphasis>ltype</emphasis> - local network type
|
|
|
|
+ </para></listitem>
|
|
|
|
+ <listitem><para>
|
|
|
|
+ <emphasis>ndesc</emphasis> - phone number description
|
|
|
|
+ </para></listitem>
|
|
|
|
+ <listitem><para>
|
|
|
|
+ <emphasis>error</emphasis> - error string if phone number
|
|
|
|
+ matching fails.
|
|
</para></listitem>
|
|
</para></listitem>
|
|
</itemizedlist>
|
|
</itemizedlist>
|
|
</listitem>
|
|
</listitem>
|