home *** CD-ROM | disk | FTP | other *** search
- /* $Revision Header built automatically *************** (do not edit) ************
- **
- ** © Copyright by Dirk Federlein
- **
- ** File : Work:Programming/dfa/rexx/DoCall.rexx
- ** Created on : Monday, 02.08.93 21:13:43
- ** Created by : Dirk Federlein
- ** Current revision : V1.1
- **
- **
- ** Purpose
- ** -------
- ** - Dial script for DFA
- **
- ** Revision V1.1
- ** --------------
- ** created on Monday, 02.08.93 21:17:19 by Dirk Federlein. LogMessage :
- ** - Changed the Script by just deleting some parts.
- ** Now you can't use it from outside of DFA but only from
- ** within DFA, i.e. you have to assign it to a function key.
- **
- ** Of course it is no longer possible to search through addresses
- ** or quit the script _before_ dialing. If you want to use these
- ** extended features, please us the original 'Call.rexx' script
- ** by F. Pecher!
- **
- ** Revision V1.0
- ** --------------
- ** created on Monday, 02.08.93 21:13:43 by Dirk Federlein. LogMessage :
- **
- ** Revision 1.0 from F. Pecher - thanks Frank!
- **
- **
- **
- **
- **
- ** Call.rexx by Frank Pecher
- **
- ** Call a person with DFA
- **
- ** Syntax:
- ** Call <First|Name>
- **
- ** You will be shown the found person and be prompted for dialing, so
- ** you can be sure to call the correct number if the same person has
- ** more than one phone number.
- ** When prompted, you have the following options how to continue:
- ** * q(uit)<CR> don't look for further matches.
- ** * n(o)<CR> find next match.
- ** * y(es)<CR> dial found number
- ** This script will take care to dial the numbers as short as
- ** possible, so if you call somebody with the same dial prefix, the
- ** prefix will not be dialled.
- ** See below how to customize this script for your purposes.
- **
- ** LOCAL DIAL PREFIXES: if these are found in the database, they will
- ** be ommited when dialling. EDIT THESE so that they match the codes of
- ** your country/region.
- **
- ** This batch expects phone codes of the form
- **
- ** +49 (0)7031 278606
- ** ^ ^ ^
- ** | | |
- ** | | personal phone number
- ** | regional pre-code
- ** | the parentheses around the zero mean that it will be
- ** | omitted when the country precode of the found number
- ** | does not match LOCAL_COUNTRY (see below)
- ** |
- ** country pre-code; the '+' will be replaced by LOCAL_OUT (see below)
- **
- ** EXAMPLES:
- ** My own settings: LOCAL_OUT = "0"
- ** LOCAL_COUNTRY = "+49"
- ** LOCAL_REGION = "(0)7031"
- ** LOCAL_NUMBER = "278608"
- **
- ** * Found number: +49 (0)7031 278608
- ** Call.rexx dials nothing and displays an error message.
- **
- ** * Found number: +49 (0)7031 12345
- ** Call.rexx dials: 12345
- **
- ** * Found number: +49 (0)805 11223
- ** Call.rexx dials: 0805 11223
- **
- ** * Found number: +11 (0)321 90807
- ** Call.rexx dials: 011 321 90807
- **
- *********************************************************************************/
-
- LOCAL_OUT = "0"
- LOCAL_COUNTRY = "+49"
- LOCAL_REGION = "(0)931"
- LOCAL_NUMBER = "286914"
-
-
- parse arg person
- person = upper(strip(person))
-
- options RESULTS
-
- say "Searching..."
-
- address "DFA" GetCurrent stem p.
-
- do while RC = 0
- Ignore = 0
-
- name = upper(strip(p.address.2))
- first = upper(strip(p.address.1))
- comment = upper(p.address.15)
-
- origphone = p.address.10
- parse var origphone country " " region " " number
- parse var region "(" regopt ")" regcode
-
- if country ~= LOCAL_COUNTRY then
- phone = LOCAL_OUT||strip(country, L, "+")" "regcode" "number
- else
- do
- if region ~= LOCAL_REGION then
- phone = regopt||regcode" "number
- else
- do
- if number ~= LOCAL_NUMBER then
- phone = number
- else
- do
- say
- say "ERROR"
- say " Either you were trying to call yourself or"
- say " you haven't edited Call.rexx yet."
- say
-
- Ignore = 1
- end
- end
- end
-
- if Ignore = 0 then
- do
- /* Set new phone number */
- address "DFA" edit 'phone="'phone'"'
-
- /* Dial new phone number */
- address "DFA" dial
-
- /* Restore original phone number */
- address "DFA" edit 'phone="'origphone'"'
- exit
- end
- end
-
- exit
-