]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 250] externalizePhoneNumber cannot be controlled server-side
authorDarren Nickerson <darren.nickerson@ifax.com>
Thu, 23 May 2002 20:05:14 +0000 (20:05 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Thu, 23 May 2002 20:05:14 +0000 (20:05 +0000)
Applied Alvaro Aguilera's patch, after Lee embellished with fine docs

etc/dialrules
faxd/faxQueueApp.c++
faxd/faxQueueApp.h
man/dialrules.4f

index 119f3c74214868152c99c387392452bfeb54357e..685b99a8a177f150fb6387e6bbf1f370a59991e0 100644 (file)
@@ -3,7 +3,7 @@
 ! HylaFAX (tm) Dialing String Processing Rules.
 !
 ! This file describes how to process user-specified dialing strings
-! to create two items:
+! to create three items:
 !
 ! CanonicalNumber: a unique string that is derived from all dialing
 ! strings to the same destination phone number.  This string is used
 ! telephone.  This string should be void of any characters that might
 ! confuse the modem.
 !
+! DisplayNumber: the external, displayable, form of a number that
+! does not include private information which should not be displayed
+! to clients.
+!
 Area=${AreaCode}               ! local area code
 Country=${CountryCode}         ! local country code
 IDPrefix=${InternationalPrefix}        ! prefix for placing an international call
@@ -60,3 +64,9 @@ DialString := [
 ^[+]${Country}         = ${LDPrefix}           ! long distance call
 ^[+]                   = ${IDPrefix}           ! international call
 ]
+!
+! Strip private information from the dial string which should not be
+! displayed to clients.  By default, DisplayNumber is not set.
+!
+! DisplayNumber := [
+! ]
index c1bf2086fee63493ab43c0c02e35ffe2f1653e41..2c10ba7a4e5a73205012efe60a0b6bfaa65607aa 100644 (file)
@@ -1599,6 +1599,7 @@ faxQueueApp::submitJob(Job& job, FaxRequest& req, bool checkState)
      * destination phone number.
      */
     job.dest = canonicalizePhoneNumber(req.number);
+    req.external = externalizePhoneNumber(req.number);
     if (job.dest == "") {
        if (req.external == "")                 // NB: for notification logic
            req.external = req.number;
@@ -2922,6 +2923,18 @@ faxQueueApp::canonicalizePhoneNumber(const fxStr& ds)
        return ds;
 }
 
+/*
+ * Convert a dialstring to an external format.
+ */
+fxStr
+faxQueueApp::externalizePhoneNumber(const fxStr& ds)
+{
+    if (dialRules)
+       return dialRules->displayNumber(ds);
+    else
+       return ds;
+}
+
 /*
  * Create an appropriate UUCP lock instance.
  */
index 549d652d5d92f95d08bb167c0c4f53d70d5a543a..60d55a4db451e79867e494942909b8aa4dd3381a 100644 (file)
@@ -152,6 +152,7 @@ private:
     void       configTrace(const char* fmt, ...);
     void       setDialRules(const char* name);
     fxStr      canonicalizePhoneNumber(const fxStr& ds);
+    fxStr      externalizePhoneNumber(const fxStr& ds);
 // modem support
     void       scanForModems();
     bool       assignModem(Job& job, const DestControlInfo&);
index c454dc7f6bd881e8403a9c2054844921e7674334..2f959722be4c5500772daf14e188a5863e5cf10b 100644 (file)
@@ -35,14 +35,15 @@ dialrules \- \*(Fx dial string processing rules
 A dial string specifies how to dial the telephone in order to
 reach a destination facsimile machine, or similar device.
 This string is supplied by a user with each outgoing facsimile job.
-User-supplied dial strings need to be processed in two ways by the
+User-supplied dial strings need to be processed in three ways by the
 \*(Fx server processes:
 to craft a canonical phone number for use in locating the
-receiver's capabilities, and
-to process into a form suitable for sending to a modem.
-In addition client applications may need to process a dial string
+receiver's capabilities, 
+to process into a form suitable for sending to a modem, and
 to formulate an external form that does not include private information
 such as a credit card access code.
+In addition, client applications may also need to process a dial string
+to formulate an external form.
 Phone number canonicalization and dial string preparation
 are done according to 
 .I "dial string processing rules"