@@ -0,0 +1,279 @@
+Index: hylafax-6.0.2/README.I4L
+===================================================================
+--- /dev/null
++++ hylafax-6.0.2/README.I4L
+@@ -0,0 +1,10 @@
++
++This version contains sample config files for I4L Class1 and Class2
++modems.
++Note: You have to change ModemResetCmd to reflect your local setup.
++
++It also contains some extentions to dispatch faxes depending on the MSN
++or on the extention of local exchanges via email.
++To use this feature you simply add "<email> <number>" pairs to etc/users
++and use the "ATS23=3&L<numberlist>" I4L command in ModemResetCmd to listen
++on these numbes an transmit the number.
+Index: hylafax-6.0.2/config/Makefile.in
+===================================================================
+--- hylafax-6.0.2.orig/config/Makefile.in
++++ hylafax-6.0.2/config/Makefile.in
+@@ -72,6 +72,7 @@ CONFIGFILES=class1 \
+ iaxmodem \
+ intel-400e \
+ ip568x \
++ linux-isdn-1 \
+ linux-isdn-2 \
+ lucent \
+ lucent-isa \
+Index: hylafax-6.0.2/config/topic
+===================================================================
+--- hylafax-6.0.2.orig/config/topic
++++ hylafax-6.0.2/config/topic
+@@ -5,7 +5,6 @@
+
+ # CONFIG:CLASS1:TP560.*:.*:.*: Manufacturer=Topic Model=TP560
+ # CONFIG:CLASS1:Hamlet H56XCT.*:.*:.*: Manufacturer=Hamlet Model=H56XCT
+-# CONFIG:CLASS1:Linux ISDN.*:.*:.*: Manufacturer=Sedlbauer Model=Speedfax
+ #
+ # BEGIN-SERVER
+ # END-SERVER
+Index: hylafax-6.0.2/etc/Makefile.in
+===================================================================
+--- hylafax-6.0.2.orig/etc/Makefile.in
++++ hylafax-6.0.2/etc/Makefile.in
+@@ -90,6 +90,7 @@ install: default
+ ${PUTSERVER} -F ${SBIN} -m 755 -src probemodem.sh -O probemodem
+ ${PUTSAMPLE} -F ${SPOOL}/etc -m 644 -o xferfaxlog
+ ${PUTSAMPLE} -F ${SPOOL}/etc -m 600 -o hosts.hfaxd
++ ${PUTSAMPLE} -F ${SPOOL}/etc -m 644 -o users
+ for i in ${DIALRULES}; do \
+ ${PUTSERVER} -F ${SPOOL}/etc -m 444 -src ${SRCDIR}/$$i \
+ -idb "config(update)" -O $$i; \
+Index: hylafax-6.0.2/etc/users
+===================================================================
+--- /dev/null
++++ hylafax-6.0.2/etc/users
+@@ -0,0 +1,6 @@
++#
++# Sample users file for FaxDispatch on ISDN lines
++# format: <email> <MSN or extention>
++#
++user1@example.com 123
++user2@example.com 124
+Index: hylafax-6.0.2/faxd/ClassModem.c++
+===================================================================
+--- hylafax-6.0.2.orig/faxd/ClassModem.c++
++++ hylafax-6.0.2/faxd/ClassModem.c++
+@@ -839,6 +839,9 @@ ClassModem::atResponse(char* buf, long m
+ case 'R':
+ if (streq(buf, "RING")) // NB: avoid match of RINGING
+ lastResponse = AT_RING;
++ else if (strneq(buf, "RING/", 5)) { // Match RING/CALLEDPARTYNUMBER
++ lastResponse = AT_RING;
++ }
+ break;
+ case '\020':
+ if (streq(buf, "\020\003")) // DLE/ETX
+@@ -1372,6 +1375,12 @@ ClassModem::waitForRings(u_short rings,
+ if (conf.ringExtended.length() && strneq(rbuf, conf.ringExtended, conf.ringExtended.length())) // extended RING
+ gotring = true;
+ conf.parseCallID(rbuf, callid);
++ fxStr callid_formatted;
++ for (u_int i = 0; i < callid.size(); i++) {
++ callid_formatted.append(callid.id(i));
++ callid_formatted.append(",");
++ }
++ modemTrace("MODEM CID %s", (const char *)callid_formatted);
+ /* DID modems may send DID data in lieu of RING */
+ for (u_int i = 0; i < conf.idConfig.length(); i++) {
+ if (conf.idConfig[i].answerlength && callid.length(i) >= conf.idConfig[i].answerlength)
+@@ -1400,6 +1409,12 @@ ClassModem::waitForRings(u_short rings,
+ * with AT+VRID if we missed it before.
+ */
+ conf.parseCallID(rbuf, callid);
++ fxStr callid_formatted;
++ for (u_int i = 0; i < callid.size(); i++) {
++ callid_formatted.append(callid.id(i));
++ callid_formatted.append(",");
++ }
++ modemTrace("MODEM CID %s", (const char *)callid_formatted);
+ }
+ } while (r != AT_OK && (Sys::now()-ringstart < 3));
+ for (u_int j = 0 ; j < conf.idConfig.length(); j++) {
+Index: hylafax-6.0.2/faxd/FaxServer.c++
+===================================================================
+--- hylafax-6.0.2.orig/faxd/FaxServer.c++
++++ hylafax-6.0.2/faxd/FaxServer.c++
+@@ -250,6 +250,10 @@ void
+ FaxServer::readConfig(const fxStr& filename)
+ {
+ ModemServer::readConfig(filename);
++ if ((FAXNumber == "") && (phoneNumber != ""))
++ FAXNumber = "+" | getcountryCode() |
++ "." | getareaCode() |
++ "." | phoneNumber;
+ if (localIdentifier == "")
+ setLocalIdentifier(canonicalizePhoneNumber(FAXNumber));
+ }
+Index: hylafax-6.0.2/faxd/ServerConfig.c++
+===================================================================
+--- hylafax-6.0.2.orig/faxd/ServerConfig.c++
++++ hylafax-6.0.2/faxd/ServerConfig.c++
+@@ -84,6 +84,7 @@ ServerConfig::S_booltag ServerConfig::bo
+ ServerConfig::S_stringtag ServerConfig::strings[] = {
+ { "logfacility", &ServerConfig::logFacility, LOG_FAX },
+ { "faxnumber", &ServerConfig::FAXNumber },
++{ "phonenumber", &ServerConfig::phoneNumber },
+ { "areacode", &ServerConfig::areaCode },
+ { "countrycode", &ServerConfig::countryCode },
+ { "longdistanceprefix", &ServerConfig::longDistancePrefix },
+Index: hylafax-6.0.2/faxd/ServerConfig.h
+===================================================================
+--- hylafax-6.0.2.orig/faxd/ServerConfig.h
++++ hylafax-6.0.2/faxd/ServerConfig.h
+@@ -123,6 +123,7 @@ public:
+ u_int maxConsecutiveBadCalls; // max consecutive bad phone calls
+ fxStr localIdentifier; // to use in place of FAXNumber
+ fxStr FAXNumber; // phone number
++ fxStr phoneNumber; // the local number without area code
+ u_int maxSetupAttempts; // # times to try initializing modem
+ bool batchLogs; // Batch session logs togther or not
+
+@@ -132,6 +133,8 @@ public:
+
+ fxStr canonicalizePhoneNumber(const fxStr& ds);
+ fxStr prepareDialString(const fxStr& ds);
++ const fxStr& getareaCode() const;
++ const fxStr& getcountryCode() const;
+
+ UUCPLock* getUUCPLock(const fxStr& deviceName);
+
+@@ -144,4 +147,8 @@ public:
+ void configError(const char* fmt, ...);
+ void configTrace(const char* fmt, ...);
+ };
++
++inline const fxStr& ServerConfig::getareaCode() const { return areaCode; }
++inline const fxStr& ServerConfig::getcountryCode() const { return countryCode; }
++
+ #endif /* _ServerConfig_ */
+Index: hylafax-6.0.2/faxsend
+===================================================================
+--- /dev/null
++++ hylafax-6.0.2/faxsend
+@@ -0,0 +1,28 @@
++#!/bin/sh
++#
++# This script is a wrapper to call the correct faxsend
++# program, depending of the modem type
++#
++PARA=$*
++SENDFAX=/usr/lib/fax/faxsend
++
++m_found="no"
++while [ $# -gt 0 ]; do
++ case $1 in
++ "-m")
++ m_found="yes"
++ ;;
++ faxCAPI*)
++ if [ "$m_found" = "yes" ]; then
++ SENDFAX=/usr/bin/c2faxsend
++ fi
++ m_found="no"
++ ;;
++ *)
++ m_found="no"
++ ;;
++ esac
++ shift
++done
++
++$SENDFAX $PARA
+Index: hylafax-6.0.2/util/FaxDispatch.sh
+===================================================================
+--- /dev/null
++++ hylafax-6.0.2/util/FaxDispatch.sh
+@@ -0,0 +1,12 @@
++#
++# Dispatch fax to email depending on own MSN or extention (ISDN lines)
|