WO2002013500A1 - Software for enabling wireless data flow - Google Patents

Software for enabling wireless data flow Download PDF

Info

Publication number
WO2002013500A1
WO2002013500A1 PCT/US2001/024386 US0124386W WO0213500A1 WO 2002013500 A1 WO2002013500 A1 WO 2002013500A1 US 0124386 W US0124386 W US 0124386W WO 0213500 A1 WO0213500 A1 WO 0213500A1
Authority
WO
WIPO (PCT)
Prior art keywords
return
ret
debug
shift
print
Prior art date
Application number
PCT/US2001/024386
Other languages
French (fr)
Inventor
Art Puryear
Linh Tang
Shengkuo Fan
Joel Zucker
Original Assignee
Lava 2140
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lava 2140 filed Critical Lava 2140
Priority to AU2001284707A priority Critical patent/AU2001284707A1/en
Publication of WO2002013500A1 publication Critical patent/WO2002013500A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • H04W4/14Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/101Access control lists [ACL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/42Systems providing special services or facilities to subscribers
    • H04M3/487Arrangements for providing information services, e.g. recorded voice services or time announcements
    • H04M3/493Interactive information services, e.g. directory enquiries ; Arrangements therefor, e.g. interactive voice response [IVR] systems or voice portals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M3/00Automatic or semi-automatic exchanges
    • H04M3/42Systems providing special services or facilities to subscribers
    • H04M3/50Centralised arrangements for answering calls; Centralised arrangements for recording messages for absent or busy subscribers ; Centralised arrangements for recording messages
    • H04M3/53Centralised arrangements for recording incoming messages, i.e. mailbox systems
    • H04M3/5322Centralised arrangements for recording incoming messages, i.e. mailbox systems for recording text messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M7/00Arrangements for interconnection between switching centres
    • H04M7/006Networks other than PSTN/ISDN providing telephone service, e.g. Voice over Internet Protocol (VoIP), including next generation networks with a packet-switched transport layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/58Message adaptation for wireless communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2207/00Type of exchange or network, i.e. telephonic medium, in which the telephonic communication takes place
    • H04M2207/18Type of exchange or network, i.e. telephonic medium, in which the telephonic communication takes place wireless networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/18Service support devices; Network management devices
    • H04W88/184Messaging devices, e.g. message centre
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W92/00Interfaces specially adapted for wireless communication networks
    • H04W92/02Inter-networking arrangements

Definitions

  • the SMS-capable Wireless Device e.g. a digital handset
  • WD The SMS-capable Wireless Device
  • RAM Remote Administration Module
  • SMS Short Message Service
  • the Lava2140 Application Server is deployed with an optional direct connection to the carrier's short message service center (SMSC).
  • SMSC short message service center
  • the SMSC is configured to relay the short message to the Lava2140 Application Server when the message is destined to a pre-determined numbers. This means that the carrier assigns a number (e.g. 9999) for its wireless clients to reach the Lava2140 Application Server.
  • the wireless modem (assuming MIN is 3103835313) and the wireless device are located within the carrier's SMS roaming area.
  • the wireless modem can be identified by a Mobile Identification Number (MIN)
  • a list of authorized user accounts is set up on the Lava2140 Application Server in the Lava2140 Database.
  • the Lava2140 Application Server uses this information for access control.
  • the end user composes a short message, for instance "Ping TargetServer", on the wireless device and sends it to the number 9999 if an optional direct connection is established, or to the wireless modem number 310-383-5313..
  • the SMSC receives this short message and relay the message to the Lava2140 Application Server through either the direction connection or the wireless modem.
  • the Lava2140 Application Server receives the text message "Ping TargetServer" from the SMSC direction connection or the wireless modem.
  • the Lava2140 Application Server authenticates the request by checking the MIN that is embedded in the message packet according to the SMS protocol definition against its profile in the Database.
  • the Lava2140 Application Server parses the text message and identifies and validates the command.
  • the Lava2140 Application Server issues a "ping TargetServer" command and wait for the result.
  • the Lava2140 Application Server generates a response based on the command result and breaks it down to multiple short messages to comply with the length limit imposed by the SMSC if necessary.
  • the Lava2140 Application Server sends the response to the SMSC through the direct connection or wireless modem.
  • the SMSC deliver the response to the end user.
  • the administrative commands are expandable, customizable, and dynamic.
  • the system can be implemented in most wireless networks.
  • the wireless modem can be replaced by a wireless handset that interfaces with the Lava2140 Application Server.
  • the request is initiated by the end users, however, is can work in conjunction with the Alert Module to create a set of monitoring functionalities.
  • the SMS-capable Wireless Device e.g. a digital handset
  • WD The SMS-capable Wireless Device
  • AM Alert Module
  • SMS Short Message Service
  • the Lava2140 Application Server is deployed with an optional direct connection to the carrier's short message service center (SMSC).
  • SMSC short message service center
  • the SMSC assigns Lava2140 Application Server a number (e.g. 9999) as the identifier within its the wireless network.
  • the wireless modem (assuming MTN is 3103835313) and the wireless device are located within the carrier's SMS roaming area.
  • the wireless modem can be identified by a Mobile Identification Number (MIN)
  • a list of authorized user accounts is set up on the Lava2140 Application Server in the Lava2140 Database.
  • the Lava2140 Application Server uses this information for access control.
  • the Target Server sends an alert request to the Lava2140 Application Server.
  • the Lava2140 Application Server generates an alert message, for instance, "Host 1 disk space 90% full, require immediate attention!” according to the alert request and breaks it down to multiple messages to comply with the message length limit imposed by the SMSC if necessary.
  • the Lava2140 Application Server queries the Lava2140 Database to compute the eligible message recipients each with a wireless device identification number (e.g. digital handset MEN).
  • the Lava2140 Application Server sends the alert message to the SMSC through an optional direct connection or the wireless modem.
  • the SMSC deliver the message to the recipients.
  • the alert requests are expandable, customizable, and dynamic.
  • the system can be implemented in most wireless networks.
  • the wireless modem can be replaced by a wireless handset that interfaces with the Lava2140 Application Server.
  • the request is initiated by the target servers, however, is can work in conjunction with the Remote Administration Module to create a set of interactive administration functions.
  • IR port on a wireless device and the Bluetooth interface integrate remote control capabilities into wireless devices. This Is done by remembering the remote control commands for a particular device and then retrieving them later to control the device. This requires a means of inputting/reading/retrieving the remote control command set for a device. With current technology this involves having the end user input the command set or using a learn function built into numerous devices such as TV, VCR, etc. Input methods include reading the command set from a series of bar codes, reading it from the WEB s'rte of the device manufacturer, reading command sets that have been stored on the Lava2140 WEB site, and other methods. Once the appropriate codes have been retrieved, then this object will present a menu of remote control commands to the end user and the user can choose one command to activate. Activation of the command involves sending an IR signal to the device to be controlled via the IR port on the wireless device.
  • value added services include calendar functions and location based functions among others.
  • the portal maintains context information and allows access to the database in order to provide these services.
  • For calendar functionality the end user's information is kept on the Lava Server and presented to ttie user through the portal As the user travels, location based services will automatically adjust the calendar information based on time zone, date, and time.
  • the base station is a mini PBX which uses the Bluetooth system to detect a wireless device being in range of the PBX While the device is in range, if the device owner has enabled it, the device will have access to any information maintained by the base station. This includes land-line access to e-mail, WEB sites, faxes, voice mail, etc. It also allows the device to receive broadcast messages from this private base station. This allows a commercial establishment to broadcast advertisements/announcements to any wireless devices within proximity of their establishment.
  • the Lava TTS feature converts any textual content into spoken words that can be played over the air for the wireless end user. This eliminates the user having to read the information on the wireless device's small screen.
  • the Lava VR feature efiminates having to type in commands and other information on the wireless devices keyboard/keypad. This feature recognizes the words spoken by the end user and converts them into text that Is • then passed into the Lava Server for processing. This module also adds an heuristic typing aid to anticipate text input
  • This module allows the creation of certain graphic images (such as icons) and sound clips ( ⁇ 10 seconds), the storage of these graphics/sounds, and (he exchanging of them. This is done by downloading a program onto the phone that manages the creation and exchange of these graphics/sounds.
  • This program is a SIM Toolkit (STK) program for GSM phones, a J2ME program for Java embedded phones, or a CHTML program for CHTML phones.
  • STK SIM Toolkit
  • J2ME program for Java embedded phones
  • CHTML program CHTML phones.
  • the graphic sound files are stored on the Lava Server so that the end user can select any of the files that they have created or exchanged with others.
  • This module allows a wireless device to be used in conjunction with a bar code scanner to read bar codes and pass them back to the Lava Server.
  • PTT Portable Data Terminal
  • any wireless device to be used as a Portable Data Terminal (PDT). This is accomplished by having the wireless device contact the bar code scanner via the Bluetooth interface in order to exchange the scanned information. Using this same interface the wireless device can also interface with Point Of Sates (POS) terminals to exchange information and get receipts for transactions.
  • POS Point Of Sates
  • the languages included are English, Spanish, German, Portugeese, Mandarin, Kanjii, Tagalog and others.This is done by having the Language Translation Modute perform the translation within the Lava Server.
  • This module broadcasts a survey packet to ktenfified parties.
  • the party receiving the packet has an option as to whether to reject the survey, respond now, respond later, or forward the packet on to someone else.
  • the survey packet is broken into many sub-packets each of which contains a question and a list of responses.
  • the first question is always "would you like to respond to this survey?", with answers yes, not now (they will next be asked when), not ever, and forward (they will next be asked where to send it). Following this question a new sub-packet is sent for every question in the servey.
  • the context for this interaction, along with the answers given so far, are stored on the Lava Server by the Interactive Survey Modute.
  • the parties to receive the survey are chosen by the conductor of the survey and could include random choice, demographic based choice, location based choice (the user just happened to be in the neighborhood where the survey was being conducted), and other methods.
  • This module stores location information for an end user and later uses that stored information to determine the distance and direction from the users current location to the stored location.
  • the current location is derived from the wireless carriers triangulation and is stored in latitude, longitude, and elevation. This information can be stored on the Lava Server for future reference. Finding a previous location requires two separate actions. The first retrieves the current location and stores it and the second retrieves the current location and compares it to a stored location. Uses for this service include locating an automobile in a large parking lot such as at a concert or ball game or allowing children and adults to rendevous back at an original location like at a fair, festival, or amusement park. Camp On Module
  • This module allows a user to send an interactive request message to another user's wireless device. This message will remain queued to that receiving device until the user of the device responds to the message. This response could be to discard the request, to answer the request with a text message, or to accept the request. Discarding the request causes a response message to be sent to the message originator that says that their request was not accepted. Answering the message with a text message sends that message to the originator. Usually this will be a message such as "Sorry, I cannot accommodate you today, but if you contact me again on Friday, I should be able to help you". Accepting the request indicates that the respondent wishes to connect with the originator. A text message accompanying the response indicates to the originator what action to take.
  • a possible scenario is the following: At 10 am Joe sends a Camp On message to his boss Susan which says "Susan, I need 10 minutes of your time sometime today to discuss the Johnson project". Susan receives this message while in a meeting and does not respond to 'rt for a few hours. At 3:15 pm Susan accepts the message with the text "I am free for the next half hour”. Joe's mobile device rings with the acceptance message causing him to get up and go to Susans office.
  • the Wireless Personal Television (WPTV) Module interfaces to a remote system to gain access to five video being captured by that remote system. This is used to connect to a home automation system to view survellience videos or to see who is at your front door. If you recognize the person at your front door you can communicate with them by patching the wiretess device directly into the intercom system and telling them that you are just teaving the office and will be home in 10 minutes. The video is displayed on the wiretess devices screen.
  • a URL of 20, 30 or more characters can be reduced to less than 10 by specifying the alias and appending idd.to. For most wireless devices this can be a considerable savings in input time as most cell phones require anywhere from 1 to 10 (or more) keystrokes per letter to be entered.
  • This module operates by presenting a WEB page to the end user so that they can specify the full URL and their chosen alias. This information is then stored on the Lava Server. Later when the user chooses to access a URL they can construct a message using the alias. When the request reaches the Lava Server, the full URL is then substituted for the alias.
  • This modute allows the end user to remotely administer any system by providing a wireless gateway into the system administration interface for that system.
  • This feature allows an end user to specify conditions under which an alert will be generated to their wireless device. These conditions are specified via a WEB page and allows them to select any content source(s) on which to place alert conditions. Examples include generating alerts whenever, the stock market is down more than X percent, the users bank balance has dropped to a dangerously tew level, a severe weather warning has been issued, etc.
  • the conditions are stored on the Lava Server and the Indicated content sources are checked periodically (per user specification). Whenever any condition evaluates to TRUE, an alert message is sent to the users wiretess devlce ⁇ s). .. . Mobile Gaming Module
  • the mobile gaming modute interfaces the Lava Server to multiple gaming WEB sites so that (he end user may play games, place bets, and collect winnings via their wireless device.
  • the user can use the Lava WEB site to configure the games to be played and to set up the accounts required. Then the users wireless device can be used to access these games which have been set up. A menu is presented to the user who chooses the game to be played, the amount bet, etc. The winnings are then kepi in the users account.
  • Calendar Module Provide a calendaring function that operates via the users wireless device.
  • capiid.c capiid.c
  • capiicomra capiicomm c
  • curTime->t- ⁇ year curTime->tm_mon+l, curTime->tm_mday, curTi»e->t ⁇ _hour, curTime->tm_min, cur ⁇ ime->tm_sec) ; delivery_confirmed” 0; if (REQUEST_CONFIRMATION) ( cur ⁇ ime->tm_min + ⁇ V ⁇ LIDITY_PERIOD; if (VALID(cdkReceivePdu(cdk_h, fcreqid) 1 ) ( mktime I curTime) ; result" cdkReadPdu(cdk_h, SubmitConfir , sprintf !
  • route HXE_DEFAULT_ROUTE, sizeo (route) I ; routefsiseofIroute) -1J* 0; ) else I if (delivery_confirmed) ⁇ route[0]" 0; return 1; 1 signal (SIGALRH, sigalarm_send) ; alarm(TIKEOUT.SEND) ; 1 result" cdkSendPdul cdl *.
  • SubmitRequest logjprintf(fclog_ ⁇ rr, 'ts
  • capiicomm. c capiicomm.c logjprintf (fclog-.comm , " %s
  • I include ⁇ tdlib.h> Ilnclud* ⁇ tring.h> processed In td second(s) n' •incl ⁇ d* unistd.h> count, tl-tO) l # include ⁇ aignal,n> I include *ys/vsit.h> •includ* ⁇ y ⁇ /typ*s.h> queue_close(fcq) ; ⁇ includ* ⁇ sy «/»t*t,h> return count; # includ* ⁇ errno.b> .
  • capiiext.c tendif return -1; 1 signal(SIGALRH, sigalar ) ; alarx(TIHTOUT_REV) ; fprintftpd, fprintflpd, fprintflpd, fprintflpd, fprintflpd, fflush(pd) ; pcloselpd); alarm(O) ;
  • ⁇ -DEBUG S'STDOVTt if ((testing fc 2) ( my (Seed, *args)> 8ARGV; traverse_tree( ⁇ fcdump_tag_and_text) l my ((query, (uri, Scacbe ⁇ key) ; for ( ⁇ dump put) ⁇ my ((res, (data, (data, (out) : print DEBUG "(_ ⁇ n" ⁇
  • set- odl'tltle' "1; set_iod( 'header'. ' Va '); print DEBUO (http_res->as_strlng() ⁇ set_lod('footer', • ...'); send inf((min, "(cmd: Cannot process your request at this time. set- odl'aax', 4); ⁇ Please, try again later,") ; return 0; local loptlons;
  • G*tOptlo ⁇ s ( ⁇ *raptlons, "debug
  • NAME NHL_IOD 'Boston' ⁇ > 'Bruins'
  • NAME ' NFL_IOD 'Ravens' > 'Baltimore'
  • t MODULI wgste/airadigm 'Bengals' "> 'Cincinnati'
  • t PROJECT roamonline/airadig 'Browns' "> 'Cleveland'
  • NAME MOV foreach (theater (.theaters)
  • KAROS10] m/-( ⁇ d*)(/l ( if Kldesc •• -1) ( (part* (II print "(cad: (part not found ⁇ n”; ) els* ⁇ . it KIARGS •• 01 ⁇ (old_quant » (desctOJ;
  • ⁇ DIE Picas* specify a number or a name [ ⁇ REC].'); (P - 0; exitll); while 11) ⁇ ) ⁇ y • split_fields ((lines [(PJ); •else ( if((y[l) *q "') ( last; )

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A method for enabling wireless data flow to and from an application server via an SMSC comprising the steps of: setting up a list of authorized user accounts; composing a short message; sending the short message from an end user to the SMSC; relaying the message from the SMSC to the application server; authenticating the short message relayed to the SMSC, if authentication is succesfull, parsing the short message and issuing a command from the application server, sending a command result to the application server; generating a response to the command result at the application server; breaking the response down into small segments; and sending the segmented response through the SMSC to the user.

Description

Software for enabling wireless data flow
Cross-Rgference to Related Application
This application claims priority of U.S. provisional Application No. 60/222,896, filed August 3, 2000, the disclosure of which is incorporated fully herein hy reference.
Description
Key components:
1. The Lava2140 Application Server (LAS).
2. The Lava2140 Database (LD).
3. The Target Server (TS).
4. The SMS-capable Wireless Modem (WM).
5. The Carrier SMSC.
6. The SMS-capable Wireless Device (e.g. a digital handset) (WD).
Figure imgf000002_0001
Following describes the Remote Administration Module (RAM) that is implemented in a wireless network using the Short Message Service (SMS) technology.
Assumptions:
1. The Lava2140 Application Server is deployed with an optional direct connection to the carrier's short message service center (SMSC).
2. If an optional direct connection is established, the SMSC is configured to relay the short message to the Lava2140 Application Server when the message is destined to a pre-determined numbers. This means that the carrier assigns a number (e.g. 9999) for its wireless clients to reach the Lava2140 Application Server.
3. The wireless modem (assuming MIN is 3103835313) and the wireless device are located within the carrier's SMS roaming area.
4. The wireless modem can be identified by a Mobile Identification Number (MIN)
Procedure:
1. A list of authorized user accounts is set up on the Lava2140 Application Server in the Lava2140 Database. The Lava2140 Application Server uses this information for access control. 2. The end user composes a short message, for instance "Ping TargetServer", on the wireless device and sends it to the number 9999 if an optional direct connection is established, or to the wireless modem number 310-383-5313..
3. The SMSC receives this short message and relay the message to the Lava2140 Application Server through either the direction connection or the wireless modem.
4. The Lava2140 Application Server receives the text message "Ping TargetServer" from the SMSC direction connection or the wireless modem.
5. The Lava2140 Application Server authenticates the request by checking the MIN that is embedded in the message packet according to the SMS protocol definition against its profile in the Database.
6. Upon Success, the Lava2140 Application Server parses the text message and identifies and validates the command.
7. Upon success, the Lava2140 Application Server issues a "ping TargetServer" command and wait for the result.
8. The Lava2140 Application Server generates a response based on the command result and breaks it down to multiple short messages to comply with the length limit imposed by the SMSC if necessary.
9. The Lava2140 Application Server sends the response to the SMSC through the direct connection or wireless modem.
10. The SMSC deliver the response to the end user.
Note:
1. The administrative commands are expandable, customizable, and dynamic.
2. The system can be implemented in most wireless networks.
3. The wireless modem can be replaced by a wireless handset that interfaces with the Lava2140 Application Server.
4. The request is initiated by the end users, however, is can work in conjunction with the Alert Module to create a set of monitoring functionalities.
Software for enabling wireless data flow - Alert Module
Description
Key components:
1. The Lava2140 Application Server (LAS).
2. The Lava2140 Database (LD).
3. The Target Server (TS).
4. The SMS-capable Wireless Modem (WM).
5. The Carrier SMSC.
6. The SMS-capable Wireless Device (e.g. a digital handset) (WD).
Figure imgf000004_0001
Following describes the Alert Module (AM) that is implemented in a wireless network using the Short Message Service (SMS) technology.
Assumptions:
1. The Lava2140 Application Server is deployed with an optional direct connection to the carrier's short message service center (SMSC).
2. If an optional direct connection is established, the SMSC assigns Lava2140 Application Server a number (e.g. 9999) as the identifier within its the wireless network.
3. The wireless modem (assuming MTN is 3103835313) and the wireless device are located within the carrier's SMS roaming area.
4. The wireless modem can be identified by a Mobile Identification Number (MIN)
Procedures:
1. A list of authorized user accounts is set up on the Lava2140 Application Server in the Lava2140 Database. The Lava2140 Application Server uses this information for access control.
2. The Target Server sends an alert request to the Lava2140 Application Server. The Lava2140 Application Server generates an alert message, for instance, "Host 1 disk space 90% full, require immediate attention!" according to the alert request and breaks it down to multiple messages to comply with the message length limit imposed by the SMSC if necessary.
3. The Lava2140 Application Server queries the Lava2140 Database to compute the eligible message recipients each with a wireless device identification number (e.g. digital handset MEN). The Lava2140 Application Server sends the alert message to the SMSC through an optional direct connection or the wireless modem.
4. The SMSC deliver the message to the recipients.
Note:
1. The alert requests are expandable, customizable, and dynamic.
2. The system can be implemented in most wireless networks.
3. The wireless modem can be replaced by a wireless handset that interfaces with the Lava2140 Application Server.
4. The request is initiated by the target servers, however, is can work in conjunction with the Remote Administration Module to create a set of interactive administration functions.
Remote Control Object
Using the IR port on a wireless device and the Bluetooth interface, integrate remote control capabilities into wireless devices. This Is done by remembering the remote control commands for a particular device and then retrieving them later to control the device. This requires a means of inputting/reading/retrieving the remote control command set for a device. With current technology this involves having the end user input the command set or using a learn function built into numerous devices such as TV, VCR, etc. Input methods include reading the command set from a series of bar codes, reading it from the WEB s'rte of the device manufacturer, reading command sets that have been stored on the Lava2140 WEB site, and other methods. Once the appropriate codes have been retrieved, then this object will present a menu of remote control commands to the end user and the user can choose one command to activate. Activation of the command involves sending an IR signal to the device to be controlled via the IR port on the wireless device.
Intelligent Portal
This describes an intelligent portal which provides value added services to wireless device users. These value added services include calendar functions and location based functions among others. The portal maintains context information and allows access to the database in order to provide these services. For calendar functionality, the end user's information is kept on the Lava Server and presented to ttie user through the portal As the user travels, location based services will automatically adjust the calendar information based on time zone, date, and time.
Private Base Station
This describes a product that utilizes a Private Base Station to achieve unified messaging. The base station is a mini PBX which uses the Bluetooth system to detect a wireless device being in range of the PBX While the device is in range, if the device owner has enabled it, the device will have access to any information maintained by the base station. This includes land-line access to e-mail, WEB sites, faxes, voice mail, etc. It also allows the device to receive broadcast messages from this private base station. This allows a commercial establishment to broadcast advertisements/announcements to any wireless devices within proximity of their establishment.
Voice Delivery Module
Uses Text To Speech (TTS) and Voice Recognition (VR) to eliminate readingΛyping at the wireless device. The Lava TTS feature converts any textual content into spoken words that can be played over the air for the wireless end user. This eliminates the user having to read the information on the wireless device's small screen. The Lava VR feature efiminates having to type in commands and other information on the wireless devices keyboard/keypad. This feature recognizes the words spoken by the end user and converts them into text that Is then passed into the Lava Server for processing. This module also adds an heuristic typing aid to anticipate text input
Gateway for Interactive Voice Response
This describes the interactive Voice Response (IVR) Gateway which uses IVR to receive lOD requests. Graphics/Sound Exchange Module
This module allows the creation of certain graphic images (such as icons) and sound clips (< 10 seconds), the storage of these graphics/sounds, and (he exchanging of them. This is done by downloading a program onto the phone that manages the creation and exchange of these graphics/sounds. This program is a SIM Toolkit (STK) program for GSM phones, a J2ME program for Java embedded phones, or a CHTML program for CHTML phones. The graphic sound files are stored on the Lava Server so that the end user can select any of the files that they have created or exchanged with others.
Portable Data Terminal Modute
This module allows a wireless device to be used in conjunction with a bar code scanner to read bar codes and pass them back to the Lava Server. This allows, any wireless device to be used as a Portable Data Terminal (PDT). This is accomplished by having the wireless device contact the bar code scanner via the Bluetooth interface in order to exchange the scanned information. Using this same interface the wireless device can also interface with Point Of Sates (POS) terminals to exchange information and get receipts for transactions.
Language Translation Module
This describes the Lava Server's Language Translation Module which allows the end user of a wireless device to input text or voice in one language and have it translated into another language. The languages included are English, Spanish, German, Portugeese, Mandarin, Kanjii, Tagalog and others.This is done by having the Language Translation Modute perform the translation within the Lava Server.
Interactive Survey Module
This module broadcasts a survey packet to ktenfified parties. The party receiving the packet has an option as to whether to reject the survey, respond now, respond later, or forward the packet on to someone else. The survey packet is broken into many sub-packets each of which contains a question and a list of responses. The first question is always "would you like to respond to this survey?", with answers yes, not now (they will next be asked when), not ever, and forward (they will next be asked where to send it). Following this question a new sub-packet is sent for every question in the servey. The context for this interaction, along with the answers given so far, are stored on the Lava Server by the Interactive Survey Modute. The parties to receive the survey are chosen by the conductor of the survey and could include random choice, demographic based choice, location based choice (the user just happened to be in the neighborhood where the survey was being conducted), and other methods.
. Position Location Module
This module stores location information for an end user and later uses that stored information to determine the distance and direction from the users current location to the stored location. The current location is derived from the wireless carriers triangulation and is stored in latitude, longitude, and elevation. This information can be stored on the Lava Server for future reference. Finding a previous location requires two separate actions. The first retrieves the current location and stores it and the second retrieves the current location and compares it to a stored location. Uses for this service include locating an automobile in a large parking lot such as at a concert or ball game or allowing children and adults to rendevous back at an original location like at a fair, festival, or amusement park. Camp On Module
This module allows a user to send an interactive request message to another user's wireless device. This message will remain queued to that receiving device until the user of the device responds to the message. This response could be to discard the request, to answer the request with a text message, or to accept the request. Discarding the request causes a response message to be sent to the message originator that says that their request was not accepted. Answering the message with a text message sends that message to the originator. Usually this will be a message such as "Sorry, I cannot accommodate you today, but if you contact me again on Friday, I should be able to help you". Accepting the request indicates that the respondent wishes to connect with the originator. A text message accompanying the response indicates to the originator what action to take. A possible scenario is the following: At 10 am Joe sends a Camp On message to his boss Susan which says "Susan, I need 10 minutes of your time sometime today to discuss the Johnson project". Susan receives this message while in a meeting and does not respond to 'rt for a few hours. At 3:15 pm Susan accepts the message with the text "I am free for the next half hour". Joe's mobile device rings with the acceptance message causing him to get up and go to Susans office.
WPTV Module
The Wireless Personal Television (WPTV) Module interfaces to a remote system to gain access to five video being captured by that remote system. This is used to connect to a home automation system to view survellience videos or to see who is at your front door. If you recognize the person at your front door you can communicate with them by patching the wiretess device directly into the intercom system and telling them that you are just teaving the office and will be home in 10 minutes. The video is displayed on the wiretess devices screen.
URL Alias Modute
This describes the URL Alias Module which allows a user to specify aliases for extremely long URLs. A URL of 20, 30 or more characters can be reduced to less than 10 by specifying the alias and appending idd.to. For most wireless devices this can be a considerable savings in input time as most cell phones require anywhere from 1 to 10 (or more) keystrokes per letter to be entered. This module operates by presenting a WEB page to the end user so that they can specify the full URL and their chosen alias. This information is then stored on the Lava Server. Later when the user chooses to access a URL they can construct a message using the alias. When the request reaches the Lava Server, the full URL is then substituted for the alias.
Remote
Administration
Module
This modute allows the end user to remotely administer any system by providing a wireless gateway into the system administration interface for that system.
Alert Modute
This feature allows an end user to specify conditions under which an alert will be generated to their wireless device. These conditions are specified via a WEB page and allows them to select any content source(s) on which to place alert conditions. Examples include generating alerts whenever, the stock market is down more than X percent, the users bank balance has dropped to a dangerously tew level, a severe weather warning has been issued, etc. The conditions are stored on the Lava Server and the Indicated content sources are checked periodically (per user specification). Whenever any condition evaluates to TRUE, an alert message is sent to the users wiretess devlce{s). .. . Mobile Gaming Module
The mobile gaming modute interfaces the Lava Server to multiple gaming WEB sites so that (he end user may play games, place bets, and collect winnings via their wireless device. The user can use the Lava WEB site to configure the games to be played and to set up the accounts required. Then the users wireless device can be used to access these games which have been set up. A menu is presented to the user who chooses the game to be played, the amount bet, etc. The winnings are then kepi in the users account.
Calendar Module Provide a calendaring function that operates via the users wireless device.
WAP Search Engine
This describes a WAP search engine that allows the end user to search for WAP sites on the internet
SMS Vending Object
This describes an object that interfaces to an account (bank or credit) that contains a users funds, it then allows the user to access this account from their wireless device.
Voice over IP Modute
This allows the users wiretess device to communicate with the telephone plant .
The following source code listings are exemplary of the invention.
capiid.b
•Include <«rmo.h> Ilnclud* *c*piicfg.hcf* Ilnclud* 'coα on.h"
•define APPNλHE 'capiid"
Mefin* REVISION "2.5- tdefln*
•define
Wetin*
Figure imgf000010_0001
t<WUne v*lid»te._ptr{κ> Uxl? x: fcnil) extern ch#r nil; extern ch*r proctitle[]; extern int isCliβnt; extern int tttoCleenϋp; int mln j-QC(int) ; int cCø(void) j cn*r *get Eile_n*mβ( const char*, const char*); coast char *tia*§t«-pt char*); int proc***_queuβ(void) ; Int procM«_poll(void);
CONFIDENTS
/2»/00
capiicomm.h
•includ* *cdlcapi . h*
/• wd> to* hack cdk_handle . • / tinclud* "acgdβ-.h"
Ilnclud* •cdJαJ.f.h- int CAPH_n«v(vo-d)ι
Int CλPII_d»l»t»(void) j
Int αu>II_conn»ctlv.oid) ; nt α_?II_dl»conn»ct(void) i int CAPII_cfc*cls-~'.nl(void); int CλP.I_ «nιflMa-aao;fi(conct char*, const char*, const char*}; int CλPII_r*c*iv«'κ«*>4go(char*, char*, char*);
capiid-send capiid-send
II/usr/local/bin/per Subject; [Airadigm/SSVCCOPE] $NUK; Ssynopsis From; capiid-sβnd $root_dir- $-HV(,LAVA_HOHE,l;
$SVCCODE:$SE0ID:$SRC if ($root_ ir) { r•cjUir•(•$root_,dir/include/wInail-00 ) ; recjuir*( "$root_dir/include/wmail-8end* ) , closa HAIL; r**juirβ("$root dir/include/wmail-userdb' ) , exit;
1 else ( use lib a/uar/local/vHail/include*; requirel'v-ail-OO'li require('M-ail-sβnd*) ; requirel'w-ail-userdb") ; 1 inltO; use Getopt: :Long;
Getoptt iLong: iconfig qv (bundling) ; C tOptions ( * 1 import : I ' ) ;
$sιo - -Sαp α 11 ii ifissio *q "I ( ssτo - i. 1
Sqdlr • •JβUEUEOm/capii-SSID* ;
($ UM, $XSO) • s«nd_getInfo ( > ; cncarp SUM, if <$VJM eq " ) { exit; ) if($MSO eq " ) ( exit; )
SSVCCO*- $DW('IOD_SVCCODE'Jl
$SEQH>- $Div('vα*t«_sεQiD'i;
SSSC" »D)V('WSate_SRC')l it (not defined $SRC) ( SSRO '???'; )
Figure imgf000012_0001
) f tOiViiICC
# MAX 0 for no limit; else maximum packets. t DELXMTTCRS ' * for any character; else regex string. t TITUC string prepended at each o£ continuing packets...
I after any header. Not for a single-packet message.
# HΣλBMA string prepended at multiple packets.
• 'tn' .or index, 'tm* for total number of packets. I rOOTCX string appended at multiple packets except for... t last message-completing packet. t RXVXRS**V,0(J7 true to reverse the order of output.
• KWOXV overrides the configuration setting of 'HλXLEN' . « 0 if no limit.
»0<JT- p*cketiιe(*.KSG)ι
Sa-.il- •rodatao'\91ava2140.com' ; Ssynopsis- su strlSKSO, 0 , 16) ; uriteLogCS CCOIH/capli-SSID. send" ,
Figure imgf000012_0002
capiicfg dat str DAT-_rORMAT int SW int SW_L∞ mt ID str SKSCJIOST int SKSCK∞T str KKD_HOST int Kπ>_PORT tr KXl_ID str i TϊPr str KXl PλSSWORD str κα_XSISON tr I»*JUtSISOK_OROUP str wαu»fλULT_suBJ- r int srr_»cv_τικϊ int Sa-r_P-UΑULI_ROOTE str IX«_DaTAULT_R WTE int RI0tlXST_CONrlRHATION long DOAY. CTIVI long DZIAY_QUEUE long DXLλY_K)LL int RATI_lOJX int RATI_QUXUI rootpetb H00TJ3IR
Figure imgf000013_0001
h llΛ
Figure imgf000013_0002
path QUΪUI_DIR path RXV_AOEMT path QOOIAJώEHT str wcaιτι_ιnτERrA E int HSATZ CD
Figure imgf000013_0003
capiid.c capiid.c
•include <stdio.h> •include <string.h> return 0; •include <unistd.h> ) •include "capiid.h" •include "capiicfg.ccf" int cfg(void) ( c£g_re»d_filβ(_CONI') ; static Char infod" APPNAME v* REVISION -\n" _c£g_r«Λd()l "(C) 2000 Lava2140, IncΛn" return 0; "\n"; ) static char author!}- MC) 2000 Raphael Ko"; static char _CC*_r[256]" "; char *get file_name( const char "pathname, const char "tag)
( char nil" 0; #if 1 char ext[256); int mainlint argc, char **argv, char • static char nβw_p*th[2561 ; ( char "dot; int pid, opt, server- 0, clien 0, int len; extern int optind, opterr; extern char *optarg; strncpyl πew_path, validatβ_ptr(pathname) , sizeof (newj?ath) ) ; πew_path{ sizeof (new_path) -11" 0; eutborlOl" authorlO]; initsetproctitlelargc, argv, envp) ; if (dot* strrchr( nev_path. ')) t opterr" 0; strncpyl ext, validatej>tr(dot) , sizeof(ext) ) ; dot" 0; while (lopt- getoptlargc, argv, *C:cs")) '» EOF) ( switch (opt) ( if ((len" sizeof(new^path) - strlen(new-path) ) > 0) { case 'Ct βtrncpy(_CCWr, validate_ptr(optargI , sizeof(_C0NF) ) ; if (den" sizeof(nev_path) - jαnTlsiieof(.COOTI-U" 0; strlenl stmcatl new_path, validate_ptr(teg> , len-1))) > 0) C break; case 'C: stmcat{ new-path, ext, len-1); client" 1; break; case 's'; server" 1; break; return newjpath; default; tendif client" server" 1, ) break; ) const char "timestampt char "f tl ) ( static char lastTimestamp[256] l if ((client -(. server) || (optind < argc)) ( fprintff βtderr. "Usage: %s (-c|-βl [-C <conf>]\π', if (fmtl { valid«te ptr(argv[0) ) ) ; strncpyl lastTimestamp, get.date tfmt) , sizeof destTimestαmp) ) ; exit(O); laβt7imestamplsizeof dastTimestampl -il " 0;
) else it (1client fcd Iserver) ( 1 client" 1;
) return lastTimestamp; if <_CC*iT[0J •• 0) ( ιnprintf (_CCHT. sizeof COOT) , •if 0
•/usr/locai/wHail/if-capii/'ts . conf , APP AME) ; int log_write( LOO "log, char *fmt, ...) 1 ( int ret" -1, i; printfl"»s" validate_ptr(info) ) ; /• struct flock Ik; •/ va„list ap; cfg<);
/• lk.l_start« 0; pid- fork!) I lk. l_whence» SEEKJSET; if (-1 •« pid) ( lk. l_len" 0; perror'APtttAKEI; lk.l_type- rjfluX i return -1;
1 else it (0 •" pid) ( va_start(ap, fmtl ; setsidO; va-ask( ); /• for (i"0; i<5; ++i) ( chdir(ROOr_DIR): tf (fcntK log-»fd, r_SETU , «k) < 0) (
/* start the process if (ermo » EλαλlN) ( mainproc(client) ; slee (1) ; continue;
)
Figure imgf000015_0001
capiimain.c capiimain. c
•include <stdio.h
•include <stdlib.h> sbrk(β"1024) ;
•include <string.h>
•include <unistd.h> sprintf (proctitle, "»s-*d, *s" APPNAKE, ID, module) ; •include <signal.h> setproctitlelproctitle) ; •include "capiid.h" •include "capilcomn.h' log_opaπ(4log_pid, get_file_name(PID_FILΪ, module) , "wf l ; logjprintf (ilogj>id, *%d" , getpid! ) ) ;
LOO log_trans, log_err, log_comms, logjpid, log_debug; log.-closelfclogjpidϊ ; int isClient; log_open{*log_trans, get fil«-name(LOσwFILE, module) , NULL) ; int tout • 0; log_open(&log_err, get_f il*_name (ZKR_FILZ, module) , NULL) ; int QloCleanUp" 0; log_open log_comms, get_file^ιame{CC*IK_TILE, module) , NULL) ; char proctitle lSSG] ; log_open (61og_debug, get_fiIej am*(DEBUα_FIL*", module) , NULL) ;
;
") ; ;
Figure imgf000016_0001
log printf(fclog_con-s,
Figure imgf000016_0002
timestamp(DATE_FORHAT) ) ; if (isClient) { exitlOl; queue_roset(όuεuE_DIR) ; /* queue used by client only '
1 void sigdropdnt n) ( while (1) ( cleanu (1 ; if (isClient) usleep(DELAY_λCTIVE> ; logj rintf (*log_comms, "ls |NOTE|user-l signal received. \n" f" time„check(ϊ ; timesta»p(DATl!_FORMAT) I : signal (SICUSRl, sigdrop) ; if (f fc 0x04) { logjprintf(ilog.comms, "%s|CHEC \n" timestamp(DλTK_rθRKAT) ) I int mainproc dnt bclient) ( int f, π int cf; iflf ts 0x10) ( int type^single, type_ ndouble, typβ_dθdouble; // Λ day has elapsed... long cntl, cnt2; char, "dt, *dt2 ; log_close(fclog_trans) ; static char buff (1024) ; // log„close(fclog_err) ; const char server! ] " '-rx* ; // log_cloβe(fclog„comms) ; const char clientl l " '-tx' ; dt2 > dt; const char "module; if(dt2 •• NULL) dt2 • "old"; sprintf (buff, "»». ♦»" , get_fil*_nam*(LOS_FILE_OLD, module) , dt2) ; isClient- bClient; rename!get_file_name(LOG FILI, module), buff1 ; module" (isClient? client; server) ; // sprintf(buff, "*s.%s", get_file_name(ERR_7ILE_0LD, module), dt2) ;
// rename(get_file_name(£RR_FILE, module), buff); to server 6 client // sprintf(buff, "ιs.*s", get_file_name(COHH_FIlE_OLD, module), dt2) ; /2*700
capiimain c
// rβnajsβ(gβt_file_name(COHH_riLE module), buff) , , logwop*n(--tlog_trans, get_file_jiϋτιe(LOG_FILE, module) , NULL) ;
// ios op«n (-fclog_err, aet_file_nane{ERR_FILE( module) , NULL) j
// log„open(fclog_coflims, get-file_namβ{COHM_F'ILE, module) , NULL); iftdt I- NULL) free(dt), dt* βtrdupttistββtamp{"%y π>%d") ) ,
' if(ISW) continue; cntl ♦« DOAY_ACTIVE, cnt2 ♦• DILλY_ACTIVX; if (isClient) ( if (cntl >» DELAY_OUEUE) ( cntl -• DrLAY_OUEUE; cf" process _jqueue () ;
) } else (
/• iflcntl >» DELλY_POLL) ( cntl -• DELλY_POLL,
•/ cf ■ process poll ( ) , ) if (isClient fcl, Cf <• 0 fcfc INACTIVITY_THRESHOLD > 0 <■<. cnt2 >» IMACTIVITY_THRESHOLD) (
CλJ>II_di»connect I ) ,
Cnt2" 0| ) cf- 0; ) logjprintf (tlog_trans, '»s|wUIT\n", timestamp IDATE_F0RHAT) ) ; logjprintf (fclog_comms, "ts| INFO] exiting \n", timestamp(DλTE_FORHAT) ) ; cleanup!); return 0;
/2*700
capiicomra c capiicomm c
•include <stdio h> 1 else ( •include <stdlib h> snprintf l address, sizeof (address) , "Is/W" , KEO_B0ST HED_P0RT) •include <string h> •include cunistd h> •include <ermo h log_printf (fclog_comms, "»s | INFO | binding to ts \n" , •include <signal h> timestamp(DλT"E_FORKAT) , address) ; •include <time h •include "capiid h" if (isClient) { •include "capiicoara 1 result- cdkEstablishClientSessionl fccdJ ), address, usemame, password, extern LOO log_com*s, log_debug, log_err, log_tranβ; NULL, -status); ) else ( static CDJ HAKDLZR cdk_h' NULL, result" cdkEstablishSexverSession( static int conn" 0; fccdl t, address, usemame, password, NULL, (status) ; static char usernam*{64] " " static char pa*svord[64 ) v " " ; ) static char address! 64 J - ■ ■ if (VλLID(result)) ( static char subj !KAX_TEXT_LEN+l] - " , conn" 1; static char opens [XλX_PSHA_LEN+l] " " ; logjprintf(fclog_comms, "%s|INO|session established \n', static char oc*na !KAX_PSNA_LEN+l] » ' " , timestamp(DλTiS_FORMλT) 1 ; static char text[KAX_TEXT_LEN+l] - " ; ) else ( static char expti el l " "990131000000+0000" logjprintf(fclog.err, "%s|ALRT| failed to bind \n" static char rcvtimel) " "990131000000+0000" , timestamp(DλTI_rθRKλT) ) i static char ddltime[ )> "990131000000+0000" , logjprintf(fclog_comms, "ιs|KRR|result"(%d) status-(td) cause»(%s) \n" static char dlvtimelj- '990131000000+0000 ' , timestamp(NULL) , static char route !KAX_R0UTE_LENJ » " result, status, cdkSrrorString(cdk-h) ) ; cdk_h- HULL; void sigalarm_senddnt n) ( return -1; logjprintf (fclog_err. "%s |WλRN| timed out \n' timestamp(DATE_FORKλT) ) ) 1 int CAMI_new(voidl { int CAPII_diβconnect(void) ( int result, status" CDK_XC_SUCCESS; int CAPII_delete (void) ( if <CλPII_checkLink(>) ( if (CAm.checkLinkD ) ( CAPIIj sconnect ( ) , strncpy! usemame, KXE_ID, sizeof(usemame) ) ;
1 use amelsizeof(usemame) -1J" 0; if (cdk_hl ( logjprintf(fclog_comms, "ts|IN7o|disconnecting \n", cdkDestroyHandlβ (cdk_h) timestamp(DλT- FORKAT) 1 ; cdk_b" MULL; if (isClient) ( result" cdkReleeseClientSession(cdk_h, usemame, fcatatus) ) else < result" cdkReleaseServerSessioα(cd~ *> usemame, fcβtatus) , ) int CAPII-Connect Ivoid) if (VLID(reβult)) ( int result, status- CDX_RC_SUCCESS conn" 0; logjprintf(fclog-.comαs, "%sI-NFO|closed connection \n', it (isClient) { timestamp(DλTX_FORXAT) 11 logjprintf (fclog_comms, * %s | INFO j connecting to smsc (%s) \n" , ) else I timestamp(DAT15_FORKAT) , SMSC_H0ST) , logjprintf(fclog_err, "%s|WΛRN|failed to close \n", ) else ( timestamp(DATE_FORXΛT) ) l logjprintf (fclog_comms, ' is | INFO | listening to smsc(%s) \n" , logjprintf(fclog_comms, "ls|KRR|result"(%d) status"(*td) cause*(%s) \n' timestamp(DAT-_FORKAT) , KED_H0ST] timestamp(NULL) , ) result, status, cdkErrorString(cdk-h) ) ; return -1; if ( ICAJJ>II_checkLinkO ) ( ) strncpyl usema e, KXE_ID, sizeof (usβma ue) ) usemamelsizeof (usema e) -1] « 0 strncpyl password, KXE_PASSWORD, sizeof (password) ) , ) passwordtslseof (password) -!] * 0 : int CAPII_chockLink() ( if (conn fcfc cdk_h) C it (isClient) ( CDX_CNTX *cdk_cntX" (CDK_CNTX •) cdk_b; snprintfl address, sizeof (address) , "ts/td" , ΞHSCJIOST. SHSC_P0RT) ; KCGLCNTX *mcg_cntx" (KCO.CNTX *) cdk_cntx->cdkj?_»cg
7/28/00
capiicomm. c capiicomm.c
/* closing connection does not reset cdk_i_connected, */ SUBJ, subj, return! cdk_.cntx->cdk_i_connected -fc mcg_cntx->mcg p_trp-cntx) ; HREF, 1, /* request msg reference */ ) KTYPE, msgtype,
OSEQ, return conn; OPSNλ, opsna, 1 DSEQ,
DRTE, route, int CλPII_sendKessage(const char *src, const char *dest, const char *msg) DPSNA, dpsna, ( DMPRI, 1, /" Normal message priority •/ int result, len; DEXP exptime, int reqid; DDTIH, ddltime, int tranid, status- CD _RC_SUCCESS; DNLVL, REQUZST_CONFIRKATIOH, /• Delivery Notification * / int msgref, substa; TSEQ. int msgtype, dlvnum; TTYP, 0, 1' Default Alphabet */ int delivery_confirmed; TDATA, text, len,
LAST ) struct tm "curTime; tim«_t m ime; alarm(O);
/• YYWgifi h« ss+nnn •/ if (VALID(result) ) ( myTime" time(NULL) ; curTime" gmtiκe (fcmyTime) ; logjprintf(fclog_comms, "ts|INFO|sent tranid"(td) Λn', sprintf! rcvti e, "%02d*02dι02d»02d»02d%02d+0000' , timestampIDλTE-jrORHΛT), tranid); curTime->t-ύyear, curTime->tm_mon+l, curTime->tm_mday, curTi»e->tκ_hour, curTime->tm_min, curτime->tm_sec) ; delivery_confirmed" 0; if (REQUEST_CONFIRMATION) ( curτime->tm_min +■ VλLIDITY_PERIOD; if (VALID(cdkReceivePdu(cdk_h, fcreqid) 1 ) ( mktime I curTime) ; result" cdkReadPdu(cdk_h, SubmitConfir , sprintf ! ex ime, "»02d«02d*02d»02d*02dS02d+0000" , TRλlJ, fctranld, curTime->tsύyear, curTime->tra_mon+l, curTime->tm_mday, RESULT, fcstatus, curTime->tm-hour, curτime->tm_min, curτime->tmwsec) ; SSEQ,
RESULT, fcsubsta, if USsT_RCV_TIKE) ( KREF, fcmsgref. rcvtime101" 0; /• Submit UTC Time, Assigned by He */ DLVNUM, fcdlvnum,
/* rcvtime • "980331123000+0000" ; Hessage sent 31/3-98 at 12:30:00*/ LAST); ) if (VALID(result) ) ( msgtype" 0: /* Normal message type */ if (status ■• CDK_RC_SUCCESS) ( delivery confirmed" 1; strncpy! subj , KXE_PEFλULT_SUBJECT, sizeof (subj ) ) ; logjprintf(tlog_comms, stmcpyl opsna, KXI HSISDN, sizeof (opsna) ) ; •%sIREAD|*dIdelivery confir edΛn" , strncpy! dpsna, validatejptr(dest) , sizeof (dpsna) ) ; timestamplDATI TORMAT) , sgref) ; subj [«lxeot(subj)-l]> 0; logjprintft£loø_com-u*, opsαa[siseof (op*na) -l] > 0; •%s|%d|status-(*d) tranid-(%d) dlvnum-ltd) Λn", dpsnaisiseof ldpsnai -1] " 0; timestamp(NULL), msgref, substa, tranid, dlvnum); ) else ! if ( IVALIDITY_PERIOD) I logjprintftfclog_co-su, exptlmetO] " 0; /* Expiration UTC time, Assigned by He "/ IsIREADItdIdelivery NOT confirmedΛn",
/•exptime . "980601090101+0000" Expire 1/6-98 at 09 : 01 : 01"/ timestam (DΛTEJTORKλT), msgref) i
) logjprintf(fclog_cc-*-s,
*s|%d|status"(%dl tranid"!ιd) dlvnum"(%d) Λn", ddltl elOl" 0; / UTC deferred delivery time, timestemplNULL) , msgref, substa, tranid, dlvnum) ; 0 > deliver immediately )
/•ddltime • "980501090101*0000" Deliver 1/6-98 at 09:01:01*/ ) ) else ( logjprintf(fclog_err, "*>s|WARN|cannot confirm delivery.', strncpy! text, validate_ptr(msg) , sizeo (text) ) ; timestamp(DATE_FORKAT) ) l tβxttsizeof(textl-11- 0; len" strlen(text) : 1 e)lse I // Assumes delivery succeeded. if (S«T_ErJΑULT_J»OUTEl ( delivery_confirmed" 1; strncpy! route, HXE_DEFAULT_ROUTE, sizeo (route) I ; routefsiseofIroute) -1J* 0; ) else I if (delivery_confirmed) { route[0]" 0; return 1; 1 signal (SIGALRH, sigalarm_send) ; alarm(TIKEOUT.SEND) ; 1 result" cdkSendPdul cdl *. SubmitRequest, logjprintf(fclog_βrr, 'ts|HARN|send failure, tranid- (%d) Λn' TRλN, fctranld, timestamp(DλTE_FORHΛT) , tranid) ;
DONE, YES, /• atomic Transaction •/ logjprintf(fclog-.commβ, "%s|ERR|result"td,\n", KSEQ, timestamp(NULL) , result);
capiicomm. c capiicomm.c logjprintf (fclog-.comm , " %s | ERR | caus : Is Λn " , text ?[len]» 0; timestamp (NULL) , cdkErrorstring (cdk_h) I ; ) else ( t»xtJ?!HAX_TEXT_LENJ- 0; } e)lse ! •text ?" 0; if 0 int CAPII_query(int msgid) int CAPII_caπcel (iπt msgid) int CAPIIjreplece ϋnt msgid)
Figure imgf000020_0001
len» atrlen(text ?) ; if (len > LIWT_RECV_LOG_>ISO) {
•endif (textj?) !LIMIT_RECV_L00_)-3αJ. 0; int CAPIΣ_recβiveKessage(char "src, char "dest, char *msg) )
/" logj?rintf (fclog_trans, "*s| *d| ιa | »s | *s. \n\ static int ref" 0; timestamp (DATE_FORKAT) , msgref, src, dest, text) ; char *subj_p- subj ; "/ logjprintf (fclog_comms, "ι*| %d| type" (%dl tranid" ( »d) time* (*s) Λn" , char dβst_p* dpsna; timestamp (NULL) , msgref, msgtype, tranid, rcvjp) : char *trc opsna; logjprintf lfclog_comms, "%s]%d[subj"(tsl from (ts) to (ts) Λn' , char *textj>* teκ j timestamp (NULL) , msgref, subjjp, srcjp, deβt ?) ; logjprintf (fclog_σomms, "ιs|V-|rec'd"(**J βtat"(%d) , \π" , char **xp_p* e*pti- e; timestamp (NULL) , msgref, dlvjp, dlvstat) ; char *rcv_p* rcvtime; logjprintf (fclogwcomms, "%sj%d| (%s) Λn" , char *dlv_p* dlvtime; timestamp (NULL) , msgref, sg) ; int result, len* sire status- CD _RC_SUCCESS; int reqid; result" cdkSendPdu(cd -h. SubmitConfirm, int tranid, status* C TRAN, tranid, int msgref; RESULT, status, int Ksgtype, dlvnum; SSEQ, int dlvstat, txttype; RESULT, 0, /• delivered •/
KREF, mref, len- KUC_TEXT_LEN; /* maximum number of characters to receive DLVNUM, 1, /• delivered •/ • (size of buffer) LAST); if (VALID(result)) ( ++mref; if (VALID(result- cdkReceivePdu(cdk_h, fcreqid) ) ) ( return msgtype; if (reqid •• SubmltRequest) I )/* Intentional fall-through for INVALID results. */ logjprintf(fclog_comms, '%s|INFO|received submit requestΛn' timestasp!DATE_FQRHλT) ) ; ) else {
/• INVALID RβadPdu */ if (VALID(result- cdkReadPdu(cdk_h. SubmitRequest, TRAN, fctranid, logjprintf(fclog_err, "%s|CAUT| nknown message receivedΛn', KSEQ, timestamp(DATI_70RKAT) ) :
SUBJ, fcsubj p, logjprintf(fclog_co--u, "%s|£RK|result"ld,\n*, KREF, fcmsgref, timestamp(NULL) , result) i HTYPE, fcmsgtype, logjprintf(fclog_comms, * s|ERR|cause"%sΛn" , HTIKE, fcrcv p, timestamp(NULL) , cdkErrorstring(cdk-h) ) ; OSEQ,
OPSNA, fcsrc P, status- CDK_RC_INVPDU; DSEQ, result" cdkSendPdu(cdk_h, SubmitConfirm,
DPSNA, fcdestjp, TRAN, tranid, DSTAT, fcdlvstat, RESULT, status, DTIKE, fcdlv p, LAST); TSEQ.
TTYP, fctκttype, ) TDATλ, textjp, Hen, if (INVALID(result)) ( LλSTD) ( /• INVALID SendPdu(SubmitConfirm) •/
/• logjprintf!Hog_debug, '»s|RECV|»s, %s, »s.\n', logjprintf(fclog_err, "%s|WARN|failed to confirm essageΛn', tImestamp(DATE_FORHAT), subj p, srcjp, destj?) ; timestam (DATE_FORHAT) ) ; •/ logjprintf(fclog_comms, "*s|tRR|mref»»d, result»*d.\n', timestamp(NULL),, mref, result); if (len >. 0 ) ( logjprintf{fclogjpomma, "ts|ERK|cause-tsΛn", if (len < KAX_TEXT_LEN) ( timestamp(NULL) , cdkErrorstring(cdk_h) ) ;
7/28/00
capiicomm.c
)
++mrefl /* I assume I' have to increment this even when failed to send confirm message. */
) /• if .. SubmitRequest... (for now, ignore other PDU's) */
) else (
/• INVALID ReceivePdu / if (result I" CDX_DISCONNECT) ( logjprintf (fclog_βrr, "%s JCAUT{ unknown PDU received Λn", tiaestemp(DΛTZ_FORHλT) ) ; logjprintf (fclog.co ms, "%s|ERR|result«%d.\n", timestamp (NULL), result); logjprintf (fclog_coams, " "is | ERR | cause-Is. \n', timestamp (NULL) , cdkErrorstring (cdk_h> ) ; 1 else ( logjprintf (fclog_comms, ' is | INFO] received disconnect requestΛn", timestamp(DλTE_FORKAT) ) ; CAPII_disconnect < I ; ) 1 /* if ... ReceivePdu ... •/ return -1; )
©
capiαβκt. c capiiex .c
♦include <stdio,h> I include <βtdlib.h> Ilnclud* <βtring.h> processed In td second(s) n' •inclυd* unistd.h> count, tl-tO) l # include <aignal,n>
Figure imgf000022_0001
I include *ys/vsit.h> •includ* <βyβ/typ*s.h> queue_close(fcq) ; ♦includ* <sy«/»t*t,h> return count; # includ* <errno.b> . •includ* <tim*.h ♦includ* < cntl.h> int procesβ_queue_request(QUEUE *©q) { ♦inclυd* •capiid.h* int ret* 0; ♦includ* •capiiccoβ.h* int i, result Pid; QUEUE q;.
Idefin* WJFT9TU HA- TEXT-LEN * 1 FILE «fd; char *min_src, *π n__deβt, st* ic char buffe [BUr-SIZEj ; char cod*[5] , * IP. static char invalid_chars [ J ■ * < struct β at fs; static unsigned int **sβage_id*« 1; extern LOO log_trans, log.cc-mms, iogerr, log_debu ; q * *oq; int prc«**s_J3u*uβ__rβquβst ( QUEUE ); qu»ue_lόck(fcq) ; int pzoc**s_poll_r*queβt(void) i int procβ*s_pollβr*v(const char* const char*, const char*); fd« fop*n( q.pathjiamβ, "r'ϊi if (fd "- NULL) _ return -li void sigalarmtint n) ( meusett buffer, 0, sizeof(buffer) ) ;
/* Used by rev-agent only */
•xitt-1,, tread( (char *) buffer, 1, BUFFSIZE, Cd) j ) fclose(fd) ;
%dΛn"
Figure imgf000022_0002
capiiext c
Figure imgf000023_0001
if (result) ( if( ICAPII_checkLin () ) ( logjprintf(fclog_comms, "ss|lNFOjlink dowπΛn', if (statlgUOTA^AGENT, fcfs) fcfc ( fs . stjπode fc S_IFREG) ) { timestamp(DATE_FORKλT) ) ; signal (SIOCHLD, SIG_IGNI ; /" No zombies •/ signal (SIGALRH, sigcheck) ; alarm(HEARTBEAT_INTERVAL) I pid. fork! ) ; if lCAPII_connectU) 1 if (pid < 0) ( alarm(O); logjprintt(fclog_err, '%s |WARN|cannot fork *s. \n" , logjprintf(fclog_err, "ts|ALRT|failed to reconnectΛn", timestamp (DATE_F0RHAT) , timestamp(DATE_FORHAT) ) ; QUOTA-AGENT) ; sleepdO); logjprintf (fclog^com s, '%s|ERR[td: %s . \n" , return 0; timestamp(NULL) . errno, validate ptr(strerror terrno) ) ) ; 1 1 else if (pid » 0) ( alarm(O); ) fUoCleanUp" 1; /" should not close CλPII connection. */ destlO]" src[0]» msglO]" 0; setprocticle("%s-»d. quota" , APPNAHE, ID) ; signal(SIGALRK, sigcheck); fd » popen(QUOTA-AGENT, "w") ; alarm(HEARTBEAT_INTERVAL) ; ifltd » NULL) ( if (CλPII_xβceiveHβssage(βrc, dest, sg) "" 0) ( logjprintf(fclog_err, "*s|ALRT|cannot execute QUCTA_AGENT.\n", alarm(O) ; timestamp(0ATE_FORMAT) ) ; 1 else { if (msg fcfc src fcfc strlen(msg) fcfc strlen(src) ) (
// <timestamp>|<code>|<message id |<arc>|<dβst>| meβsage> signal(SIGALRH, sigalar ) ; logjprintf(fclog_trans, •*s|R-AD|»04uj*»|»a|»s.\n", alarm(TIK-OUT_REV) ; timestamp(DλTE FORHAT), message^id**, src, dest, msg) ; fprlntf l fd, 'ts\n" , code) ; fprintf l fd, %04u\n" , message_id) ; if ( I (message_id %> 100001) aessage_id" 1; fprlntf l fd, **s\n" , validate ?tr(min_src) ) ; procesβ poll_rev(deβt, src, msg) ; fprintfl fd, '%s\n" , validate ?tr(mιn_dest) ) ; return 1; fflush(td) ; pclosef fd) ; alarm!0); alarm(O); logjprintf(fciog_debug, "»s| PIPE|executed QUOTA_AGENT.\n" return 0; timestamp(DλTE_FORHλT) ) ; ) int processjpoll_rev(const char *dest, const char 'src, const char *msg) t exit(O); FILE *pd; int pid; signal(SIOCHLD, SIG_IGN) ; /• No zombies •/ pid" forkO; if (pid < 0) ( queue wlock(fcq) ; logjprintf(fclog_err, "»s| ARN|cannot fork %s.\n", if (ret >■ 0) queue_removβ (fcq) ; timestamp(DATl_FORKAT) , REV_AGENT)l return ret; logjprintf(fclog_commβ, "ts|ERR|%d: %s.\n", timestamp(NULL), errno, validetejptrlstrerrorlerrno) ) ) ; return -1; int processjpoll (void) ( ) int i, r. 0; if (pid I" 0) return 0; ford • 0; i < RATE_POLL, i++l ( r ♦■ proceββ poll_requeet ( 1 : fNoCleanUP" 1; /* should not close CAPI connection, */ if ( Ir) break; setproctitle("ιs-V..rev", ΛPPNAKE, ID); if (r) ( pd « popen(REV-AGENT, "w")f logjprintf(fclog_comms, '*s|INFOjprocessed %d message(s) Λn" if(pd -> NULL) ( timestamp(DATE_FORHAT) , r); •if 1 ) /* No logging until locking is implemented. •/ logjprintf(fclog.debug, " s|«s\n", timestamp(DATE FORMAT) , return r; cannot execute REV-AGENT"1 ; 7/21/00 7/28/00
capiiext.c tendif return -1; 1 signal(SIGALRH, sigalar ) ; alarx(TIHTOUT_REV) ; fprintftpd, fprintflpd, fprintflpd, fprintflpd, fprintflpd,
Figure imgf000024_0001
fflush(pd) ; pcloselpd); alarm(O) ;
•if 1 /* No logging until locking is implemented. */ logjprintf(fclog_debug, "%s|REV|executed \a for tsΛn" timestam (DATE_FORHAT) , REV.ACENT, src) ; lendif exit(O);
Ul
Figure imgf000024_0002
•••••••••.•••••••••.1111*111t.llllltlll.lllllim. •••••••!•.•«•••
1 else I
• Sid: acr.v 1.62000/02/27 19:14:32 rhk Exp ( • HTTP Error.
I NAKEl ACR print DEBUO (res->as_string(); I MODULE: vgate )
• PROJECT: roamonline (rel. 2.2) ) t PURPOSE: Perlscript for retrieving acronym definitions. I USAGE: Used In conjunction with wgate I0D module of if (I(res) { • RoamOnline. ay (counter" 0;
• SYNOPSIS: ACR <acronym> my (max_xetry" 3; • while ((counter** <• (max_retry> (
• HISTORY ((err, (errstr, %0UT) " W3grab(", 'GET', (uri);
• l»»»-0«-15 fpi: Created for VoiceStream demo, if ((err •« 0) (
• 2000-02-07 rhk: Updated for λiradigm deployment. (data- (OUTCHTTP.body');
• 2000-03-26 rhk: Updated for Release 2.2. last; • ) elsif ((err — 302) ( I RELEASE, N/λ I Redirected
• LOO: Appended at the end of the file. • (data» (OU ( 'HTTP. header' ) ;
• (C) 2000 Lava2140, Inc. All rights reserved. if ((data) (
(data •- m/* (Location|URI) : ( .+) /!;
••••••••••••••••••••••••••••■••••••••••••••••••••••••••••••••• if (defined (2) ( print DEBUG "Redirecting to S-Λn'j my (uri" 'bttp;//vww,ucc.ie/cgi-bin/acronym' ; (uri" (2; my (id» 'ACE' ; next; my (min. *EKV('vGete-.PNO'): )
*et_iod('svccode' t «χ$id"ϊ; ) ) *et_iod('eol', '\W'); ) set_iod('eof, '\W'); set_iod(' itle', "); if ((err) ( set iodl 'header' , '%n/im '); print DEBUO "(err: (errstr\n"ι aet_iodl'footer', ' ...'); CONFIDENTS βend- nf($min, "(cmd: Cannot process your request at this time. set_iod( 'max' , 4); "Please, try again later."); return 0; local options; >
Ce-Options(\toptlons, "debug|d", "test|testing| t:i') ; my (debug" exists (options!'debug'); my (testing" (exists (options!* test' ])? ( $options(* test' ) 1: 0; local θdump_out; initjparserO; local "DEBUG" (debug? \"STDERR: \"DEBUG; parse_html((data) ; local •STDOUT" {testing? \-DEBUG: S'STDOVTt if ((testing fc 2) ( my (Seed, *args)> 8ARGV; traverse_tree(\fcdump_tag_and_text) l my ((query, (uri, Scacbe^key) ; for (βdump put) { my ((res, (data, (data, (out) : print DEBUG "(_\n"ι
) my (symbol" uc join( ' targs); if 11(symbol) ( local *dump-.out: f Mo acronym supplied. local (flag; seαd-.err((min, "Usage: (cmd <acronym>'); travβrse_treβ( sub ( return li return 1 unless ((_(!) fcfc ref -.(Oil; ) (content" get-.contentK-.10]);
(query- "(symbol"; (contents* join- "\n", ^(content;
(uri" uri_e*cepe( "(url?$query' ) ;
(cache_key" (id . "." . md5_base64 {(uri) ; if <(_[01->tag() eq 'dt') ( print DEBUG "URI: $uri\n"; if (not defined (flag) ( print DEBUO "CACHE: <(cache_key>\n' : (flag- I if ((contents •- /A(symbol(/im) ; ) elsif ((flag) (
(flag" 0;
((res, (data) " cechβwgβt((cache_key, 3600) unless ((testing fc 1);
)) elsif ((flag) (
"if (0) I push *dump-.out, β(content; my $ua" new LWP: :Userλgent; ) my (req" new HTTP: :Request{ 'GET' ■> $uri) ;
». (res* (ua->requβst((req) : if!(re«->is_jucces»I) ) ( (out" join βdump_out; (data - (reβ->contβn () : if ((out) (
7/28/00
printfScmd. Ssymbol . $out*) unless (Stesting) ; cache create($cache cey, $data) unless ($ testing fc 1) i
) •!*s*«nd(_.err($min, »$cmd: Cannot find 'Ssymbol'. " .
'Please, check th* spelling or try a different acronym."); return 0;
>
Ul
7/21/00
Figure imgf000027_0001
7/28/00
) else ( my (counter- Oi my $max_retry" 3; send_inf ((min, "(cmd: Cannot process your request at this time. while ((counter** <» (maχ_retry) { "Please, try again later. "); ((err, (errstr, lOUT) « w3grab(", GET', (uri); return 0; ) if ((err •» 0) ( 1 $dat<> (0UT( 'HTTP.body'); print DEBUG "CITY: <(city>\nSTATE: <(state>\nZIPι <(zip>\n"; if ( I(zip fcfc (((data •- m/xipcode«<\d(5))/)
II ((data — m/zipcode.*value»\"(\d(S))/))) ( if ((sip) ( (zip- (1 || »;
(query* *zipcode"(zipfcpartner"λCCUWEATHER" ; ) else ( (data -- a/((city_name.*)\,\s(state/ig;
(query" •partner»ACCUWEATH'_Rfcselcity"(city*2C*$state' ; (city_namβ" (I; 1
(query* "zipcode"(zipfcpartner"ACCUWEATHER";
(uri* "(url?(query " ; (uri" "Surl?(query"; (cache_key" (id . * . " . md5Jpase64 ((uri) ; print DEBUG "Redirect: (uri\n";
I print DE*UO 'URI: (uri\n* ι next; print DEBUO "CACHE: <(cachewkey>\n" ; ay tweekdays" last; (
'monday" ■> "HON" , ) elsif ((err •• 302) ( lay" »> "TUE" , • Redirected ay" "> "WED" , thursday" ■> "THU" , (data- (OUTl'HTTP.header'); friday" •> "FRI" , if ((data) { "Saturday" »> "SAT" , (data «- ml'(Location|URI): (.*)/!; sunday' ■> "SUN" if (defined (2) ( ) ι print DEBUG "Redirecting to (2.\π":
(uri. (2; sub remove-margin ( next; foreacb (βj ( ) tr/ / /s;
Is) s/*Λs*|\s+(//g; -4 ) ) if ((err) (
((res, (data) > cache_get ($cache_key, 3600) unless ((testing fc 2); print DEBUG "(err: (errstr\n"; send_inf((min, "(cmd: Cannot process your request at this time. while (I(res) ( "Please, try again later. ") ; ay (req" new HTTP: :Request{ 'GET' "> (uri); return 0; ) ay (http-jreβ" (ue->request((req) ; it((http_res->is_success()) ( local βdump_out; (data • (httpwres->content() ; initjparserO; parse_htal((data) ; require HTML: :HeadParser; ay (hp" new HTML: :HeadParser; if ((testing fc 4) I
(hp->parse((data) ; local βdump_outι it lay (refresh" (hp->header( 'Refresh' ) ) ( traverse_tree(\fcdump_tag_and text) ; if (((uri). (refresh >- /url-(.*)(/i) < for (βdump_out) (
(uriw URI::WithBase->new[ (uri, $http_reβ->baae) ; print DEBUO "(_\n"ι print DEBUG (uri->»β_string, "\n', (uri->canonlcal, "\n"; ) next;
) return 1; J
) else ( • HTTP Error. local (sentinel- '0.1.3.0.2"; undef βdump_out; print DEBUG (http_res->as_string() ; s«-a_inf((min, '(cmd: Cannot process your request at this time. if (my (branch* (tree->address((sentinel) ) ( "Please, try again later.'); treverse_tree( (branch, \bdump_text) ; return 0; J else ! ) warn "Format Error: No node found at (sentinelΛn"; send_inf( min, "(cmd: Cannot process your request at this time. last; Please, try again later,*); return 0; ) if (0) { if (0) (
Figure imgf000029_0001
ay (index" 0; for <βdump_out) ! !(out» "(_: ", (index" 0, next) if ((index); if (ay (flag" (/current\s*conditions/i ...
/note:/!)) ( next if ((flag — 1) ; last it Kflag — /E0(/1; tr/.//d; push fdata, (_ if ((_ ne " ) ;
) else I
(index- 1 if (/torecast\s*for/ll ,
I . ' ay fcu_aber_of_fields- (scalar βdata) / 3; if (scalarlβdata) » 3) ( warn "Format Error: Incorrect number of fields detectedΛn"; ) for (0 .. (number_of_fielc - 1) ( ay ((day, (condition, (temperature) ;
(index. (_ • 3;
((day (data[(index]) — s/(\w|3, ))day/substr((l,0,3)/ei;
(condition* (data! (Index * 1 ]:
((temperature" (data! (index ♦ 2 ]) ■- s/(ReslFeel|Max) .+(//ig;
(temperature — s/High/H/ig; (temperature *- s/Low/L/ig; (out .» "\U(day:\E (condition (temperature\240"; 1 if ((out) ( print!!(ENVI'wGate_SRC') eq 'WSD'? '(cmd: : ""), '(out"); cache_creetel(cacbe_key, (data) unless ((testing fc 8); ) else ( send_err((ain, "(cmd: Sorry, we could not find the city or zip you requested. ) ; 1
1;
I TR (form! 'uritext') " (secondarg;
(form! 'doit' } « 'done'; tttttttt. ttt»t»tt« . t##tt (URL « "http://babelfish.altavista.digital.com/cgi-bin/translate?'
• (Id: translate, v 1.1 1999/04/15 18 : 02 : 23 vco Exp (
• • (ID « (ENV('wGate-MSO'); w3grab_initl); t MAKE: TR ((err, (errstr, »0UT) * w3grab(", 'POST', (URL, *form) ;
• MODULE: wgate (data • (OUT! 'HTTP.body'};
• PROJECT: roamonline(roll βlines • getlineslstrip spaceslhtmlstripKdata)));
• PURPOSE: Perlscripc for translation service.
• CSAOE: »print(join("\n', βlines) ); Used in conjunction with wgate module of • RoamOnline. (matchstr » 'Use the above text'; •♦• text to be matched
• SYNOPSIS: N/A (numcn * 0;
• HISTORY: Created by rhk for '99 CTIA/Wireless demo. foreach (nameIβlines) (
• RELEASE: N/A (numcn * (numcn * 1;
• LOO: Appended at the end of the file. • (result » (name "~ /(matchstr/; if ((result I" 0) {
• (CI 1991, 1999 Lava Communications. All rights reserved. last:
•••••••••••••••••••ttllittttttttltttt«t*t«t««ttttt<ttttttttttt»»t ) )
Figure imgf000030_0001
7/28/00
Figure imgf000031_0001
s o lilt Milt. IMMIIII. limit. Illlt lilt. Hill (uri* *(url?(query" ; (cache_key» (id . . "
• (Id: sto.v 1.6 2000/03/14 04 :30 : 32 rhk Exp ( . md._base64 ((uri) ; • print DEBUO "URI : (uri\n" ; print DEBUG "CACHE: <(cache_key \n" ;
• MODULE: wgate
• PROJECT: roamonline (rel. 2.2) ((res, (data) > cache_get((cacha_key, 300) unless ((testing fc 21 ;
• PURPOSE: Perlscript for extracting stock quotes from
• Infospace.ςom. print DEBUG 'Read from cacheΛn' it (res: t USAGE: Used in conjunction with wgate I0D module of
• Roamonline. while (I(res) (
• SYNOPSIS: 1. STO <ticker symbol> • my (req" new HTTP: :Request! 'GET' •> (uri);
• HISTORY (res* (ua->request((req);
• iSS»-ll-l5 jbz: Modification
• 2000-02-31 rhk: Updated for Release 2.2. • IfI$res->is_success() ) (
• RELEASE: N/λ (data * $res->content();
• LOO: Appended at the end of the file. require HTML: :HβadParβer; my (hp* new HTML: iHeadParser;
I • (C) 3000,1999 Uva2140, Inc . All rights reserved. (hp->parse((dat*l : if (my (refresh* (hp->header( 'Refresh' ) ) (
If <((url)- (refresh — /url*(,*)(/!) {
(uri* URI::WlthBase->new( (uri, (http_res->base) ; my (uri* *bttp://rtq.infoβpace.com/info.mylava/quote2 ' ; print DEBUO (uri->a*_*tring, "\n", (uri->canonieal, "\n"; ay (id* 'STX'i next; ay (mis* (ENV('wOete_PNO')ι ) set_lod!'«ol*, '\W'l; ) else ( set_Aodl'eof, '\W'); • HTTP Error. set- odl'tltle', "1; set_iod( 'header'. ' Va '); print DEBUO (http_res->as_strlng()ι set_lod('footer', ...'); send inf((min, "(cmd: Cannot process your request at this time. set- odl'aax', 4); Please, try again later,") ; return 0; local loptlons;
G*tOptloαs (\*raptlons, "debug |d" , "test| testingl t: i" ) ; ) ay (debug" exists (options! 'debug'); last; ay (testing" (exists (options('test'))? ( (options!' est' ) II 1 ): 0; ) local 'DEBUG* (debug? \*STDERR: N'DEBUG: if (0) ( local 'STDOUT* \*DEBUG- If ((testing fc 1) : ay (counter* 0; ay (max_retry> 3; my ((cad, βargs)*. βARGV; while ((counter** <" (max-jretry) I ay ((query, (uri. (cache_key) ; ((err, (errstr, *out) »w3grabl", 'GET', (uri); ay ((res, (data, (data, (out) ; ay ((err, (errstr, %out) ; if ((err — 0) ( my (ua* new LWP: ;UβerAgent; (data. (outi'HTTP.body')ι last; ay (βqsya, (qsy ) j ) elsif ((err » 302) (
• Redirected βqsym* βargs;
Figure imgf000032_0001
7/2»/00 7/28/00
1 )
Figure imgf000033_0001
If ((out) t print DEBUG "TIHE"<(quote_tlae>, DATE"<;(quote_date>\n" print! l(ENV('wGete_SRC') eq 'WSD'? "(cmd ), "(out"); cechβ-creatβ !(cache_kβy , (data) nless ((testing fc 8): Undef (quote_date; 1 else ( ndef (data; send_err((min, my βdats;
*(cad; Please, enter a ticker symbol to receive its quote.*); return 1; if <(»hash_array >.01 ( ) my (got_one" 0; foreach (βhash_array) (
7/3»/00 7/28/00
Figure imgf000034_0001
Schange* S_->( 'change' );
Schange •-> •/"\s+|\s+$//g;
Schange* "-' unless defined Schange; if (Ssymbol fcfc Sprice) ( push βoutjiata, 'Ssymbol: Sprice (Schange)1; -
(data- join ' ' , βout_data;
(data" "STK: (data (quot*_time (quote_date*;
1 return (data;
)
Ul Ul
use Text::Soundex;
Figure imgf000035_0001
exitlO); )
7/28/00
• NHL_IOD 'Pittsburgh' •> 'Penguins', 'Chicago' .> *Blackhawks' , . llMMIII . miUlll. tllll 'Detroit* •> 'Red wings',
• 'Nashville' •» 'Predators', 'St. Louis' "> 'Blues', • • (Id: nhl.V 1.1 1999/11/20 08:39:17 veoa Exp ( 'St Louis' "> 'Blues',
• NAME: NHL_IOD 'Boston' ■> 'Bruins',
• MODULE: wgate/airadigm 'Buffalo' •> 'Sabres',
• PROJECT: roaaonllne/airadiga 'Montreal' ■> 'Canadiens',
• PURPOSE: Perlscript for extracting headline news. 'Ottawa' *> 'Senators',
• USAGE: Used in conjunction with wgate module of Toronto' *> 'Maple Leafs',
• Roamonline for Alradlgm. Calgary* *> 'Flames',
• SYNOPSIS: N/A 'Colorado' *> 'Avalanche',
• HISTORY: 1999-11-16 jbz: Created 'Edmonton' *> 'Oilers',
• RELEASE: N/A 'Vancouver' ■> 'Canucks', • • LOG: Appended at the end of the file. 'Atlanta' » 'Thrashers', 'Carolina' *> 'Hurricanes',
•• (CI 1998, 1999 Lava Communications. All rights reserved. •Florida* *> 'Panthers', 'Tampa Bay' «> 'Lightning', 'Washington' ■> 'Capitals', 'λnaheia' » 'Mighty Ducks', ay ((cad, βargs, (nhl_ ear, (nhl_month, (nhl_day, (found); 'Dallas' ■> 'Stars', 'Phoenix' ■> 'Coyotes',
((cad, βargsl * βAROV; 'San Jose' "> 'Sharks'); t Retrieve RoaaOnllne Parameters •Translate user Entry to Recognized Teaa
• ro-parems " gβt-,account((ENV('wGβtβ_PNO' ϊ ,Scmd) ; (found " 0; foreach (key (sort keys tnhlteams) (
• Check for Debug Flag (val > (nhlteamsl(key); if l(argslθ) .- m/-\-d(/i) ( if ((key— /(team/i | " (val«- /(team/t) {
(debug" X'STDERR; (team- (val; shlftβargs; (teamalt" (key; ) else ( (found " 1;
(debug" 0; last; ) ) ) • Ch*ck if Date Supplied tor historical lookup ) '-**> • Assignment of appropriate URL (ID • (ENVC'wGate-MSG'); (detail* 1; if ((args(Ol) ( • Grab Internet Content if((cad>- /-nhl/i) ( w3grab_lnit!>; if l(argsl-l) — /-(\d\d) (\d\d) (\d\d\d\d) (|- (\d+) l\/-l (\d+) 1\/-] (\d+) 5/) I •(parameters • *•; (nhl_ye*r • (3 | 56; •((res, (data) > check_cache((ID,(paramet*rs, 9001: (nhl_aonth • (1 | (4; •iftSres " 01 ( (nhljday " (2 | (5; ((err, (errstr, lOUTI «v3grab(", 'GET', (URL);
(nhl_month_day ■ (nhljaonth . (nhl_day; iflSerr «« 0) (
(URL" "http://cbs.sportsline.com/u/sports/nhl/(nhl_year/(nhl_month-.day/index.html"; (data ■ (OUT('HTTP.body' ); pop θargs; t cache_create((ID, (data); ) else (
(URL* "http://cbs.sporteline.eom/u/sports/nhl/1999/today/index.html"; ) ») ) ) els* ( getlines(strip_*paces(htmlstrlp((data) ) ) ; print "Sport does not exist!'; exit; If ((debug) ( 1 print (debug joint'*', βlines); ) else ( print (debug "Index-> (inde \n"; print 'More Information is needed.'; print (debug "λrg-> (team\n"; exit; print (debug "Arg2-> (teamaltVα*; ) print (debug "Pound-> (found\n";
• Convert User Entry to appropriate case ) (teaa • joinI' ', βargs); t Look for occurence of specified teaa In Returned content
(teaa — tr/[A-EJ/ta-rl/; • And Format Result (teaa — s/-(\D)/\U(l/g; If ((found »» I) ( (teaa •- s/\s(\DI/ \USl/g; βsportlookup - lookup_lines((team,1,βlines) :
(index " (sportlookuplO) ;
• Teams Entry Conversion Table it (l(index) ( %nhlteams* ( θsportlookup « lookup_llnes{(teamalt,i,βlinesl ;
'Los Angeles' »> 'Kings', (Index * (sportlookuplO);
'La Kings' » 'Kings',
'New Jersey' *> 'Devils', I )f ((index) (
'New York Islanders' -> 'Islanders', (sporttest" (linesl(lndex-l);
'Hew York Rangers' » 'Rangers', (sporttest"- s/\s|\|//g;
'Philadelphia' » 'Flyers', if ((sporttest— /"\w/> (
7/28/00
nhl
(Index" (index - i;
()sportteaml" (lines[(index]; βsportteal" split-.fields((sportteaml) ;
(sportteaml- (sportteaml'Ilj ;
(sportscorel" (sportteaalt21 ;
(sportteaml*- s/\fcnbsp\;//g;
(sportscorel"- s/\fcnb*p//g;
(sportt*am2" (llnes[(lndex+l] ;
•sportteaa2" »pllt„fields((sportteam2) ;
(sportteaaJ" (sportteam2[lJ;
(sportscorel" (sportteam2[21;
(sportteaml— s/\fcnbsp\;//g;
(sportscor«2— s/\fcnbsp//g; (sporttla*" (sportteaml[3]; (sporttim*"- */\|//g; if ((sportscorel"- /-/I (
(sportscorel" * (' . (sportscorel . ") "; (sportscor«2" "{" . (sportscore2 . ')'; p)rint "(cmd: (sportteaml (sportscorel - (sportteam2 (sportscore2 (sporttime'; ) else ( print "(cmd; (team Is/are not scheduled to play today."; }
) els* ( print "(cmd: Teaa not found. Please try again,"; e )xit10);
I;
Ul
7/2«/00
• NFL_IOD 'Bills' «> 'Buffalo', 'Colts' -> 'Indianapolis',
•itiiiiii.iiitiiiit.iiimitt.tiititiii.iiiiitiii.iiitiiiit.mit 'Jets' •> 'NY Jets', 'Titans' "> 'Tennessee',
• (Id: ntl.v 1.1 1999/11/20 08:39:14 vcom Exp ( • 'Jaguars' ■> 'Jacksonville', 'Steelers' "> 'Pittsburgh',
• NAME: ' NFL_IOD 'Ravens' > 'Baltimore', t MODULI: wgste/airadigm 'Bengals' "> 'Cincinnati', t PROJECT: roamonline/airadig 'Browns' "> 'Cleveland',
• PURPOSE: Perlscript for extracting headline news. 'Chiefs' •> 'Kansas City', I USAGE: Used in conjunction with vgate module of • 'Raiders' *> 'Oakland',
RoamOnline for Airdigm. 'Seahawks' -> 'Seattle',
• SYNOPSIS: N/A 'Chargers' ■> 'San Diego' , '
• HISTORY: 1999-11-15 jbz: Created 'Broncos' *> *Denver*,
• RELEASE: N/A 1Cowboys' *> 'Dallas' , I LOO: Appended at the end of the file. • 'Redskins' •> 'Washington', 'Cardinals' "> 'Arizona',
• (C) 1998, 1999 Lava Communications. All rights reserved. 'Giants' »> 'NY Giants", 'Eagles' ■> *Phlladelpha' , j •tiltlltHllfllllillltllltltttttltllltllttttltttlllittlllttttlllt 'Lions' "> 'Detroit', 'Packers' "> 'Green Bay', ay ((cad, (found, (teaa, (debug) I. 'Bucs' «> 'Tampa Bay, 'Bears' *> 'Chicago', ((cad, βargs) • βλRGV: 'Vikings' *> 'Xlnnesota', •Rams' *> 'St. Louis',
• Retrieve Roamnline Parameters *49ers' *> 'San Francisco',
• tro-pareas • get_account((ENV( *wGate_PNO' 1 ,(cmd) ; 'Saints' » 'New Orleans', 'Panthers' "> 'Carolina',
• Check for Debug Flag 'Falcons' » 'Atlanta',
If ((argslOl — a/-\-d(/i) ( 'New York' -> 'NY' ) ;
(debug" \*STDERR; shlfttargs; •Translate user Entry to Recognized Team ) else ( (found " 0;
(debug* 0; foreach (key (sort keys tnflteams) { I (val ■ (nflteams((key}; if ((key— /(team/i 11 (val— /(teem/i) (
Ui • Check If Date Supplied for historical lookup (team* (val; -4 t Assignment of appropriate URL (teamalt* (key;
(detail* I; (found " 1; it KergslOJ) ( last;
IflScad— /-nfl/1) ( if ((ergs(-l) — /-(\d\d\d\d)(/| ( )
(nfl_ye*r * (1; ) pop βargs; (ID « (ENV('wGate-MSG');
(argst-1) — /-(\d+)(/;
(ntl_week " 'week* . (1; • Grab Internet Content
(URL* "http://cbB.eportsllne.eom/u/8ports/nfl/Snfl-year/5nfl.week/lndex.html* w3grab_intt(>; pop βargs; •(parameters ■ '"; ) else ( •((res, (data) • check_cache((ID,(parameters, 9001;
(URL* "http: //cbs.sportsllne.com/u/sportstlcker/scoreboard/nflsbd.htm" : ♦If((res .. 01 { ) ((err, (errstr, »0UT) * w3grab(", 'GET', (URL);
) else ( if((err *» 0) ( print 'Sport does not existl"; (data • (OUTCHTTP.body'); exit; • cache.createlSID, (data); ) ) else ( ) print "More information is needed.*; •) exit; βlines > getlines(strlp-^paces(htalstrlp((data)))ι )
If ((debug) ( it ((debug) ( print (debug join!'", βlines); print (debug *URL-> SURL\n"; print (debug 'Index-* (Index \n "; I print (debug 'Arg-> (team'; 1
• Convert User Entry to appropriate case (team ■ joint* ', βargs); • Look for occurence of specified team in Returned Content
(teaa — tr/[A-Z)/[a-zJ/; • And Format Result (team — */-{\D) AU(l/g; If [(found » 1) ( (teaa — s/\s(\D)/ \U(l/g; βsportlookup " lookup_lines((team,I,βlines) ;
(index " (sportiookuplO);
• Teams Entry Conversion Table if (1(index) ( tnflteaas" ( βsportlookup " lookup.lines((teamalt,1,βlines) ;
'Patriots' -> 'New England*, (index » (sportiookuplO); 'Dolphins' •> 'Kiaal', )
7/2»/00 7/28/00
nfl
Figure imgf000039_0001
Ul
00
/3I/00
11 /usr/local /bin/perl
• MIDHEADLINE w grab.init() ;
• ••»»•••». ••IHIIII, Itltt III t.ttlltt I tt.Mttltt It. Ill tttttl.Httt sub removej-argin [
• my (line" shift;
• (Id: n*vsd,v 1.1 1999/12/04 10:24:44 vcom Exp 5 (line — s/-\s+//g; • (line — s/\s*(//g;
• HAKE: MIDHEADLINE return (line;
• MODULE: wgata/mldwest )
• PROJECT: roamonllne/midwest (rol- id)
• PURPOSE: Perlscript for extracting headline news from • Disable each* for now. (12??98/rhk)
• Infospace.com. •((res, (data) » cache_get((ID, 900);
• USAOEi Uaed in conjunction with wgate module of •if((res •> 0) [
• RoamOnline for Midwest Wireless Demonstration. (counter" 0; t SYNOPSIS: N/A (max-jetry* 3;
• HISTORY: while ((counter <« (max_retry) (
• RELEASE: N/λ ((err, (errstr, tOUT) * v3grsb(", 'GET', (URL . (QUERY);
• LOO: Appended at the end of the file. if((err «• 0) ( • if 1(0OT( 'HTTP.res') — a/303/1 (
• (C) 1999 Lave Communications. All rights reserved. • Redirected
(data » (OUT('HTTP.beader')i if l(data) (
(data •- a/-Loc*tion: (.+)/i; my ((ID, (URL, (QUERY, (cmd, (args, (debug_str, (res, if (defined (1) (
(data, (err, (errstr) ; if ((debug) ( print (debug 'Redirecting to (IΛn't) local (debug; (URL- (1; local (testing; (QUERY" "1
♦♦(counter;
(ID* 'MIDUXADLINf; next; ) ay t(max tms.length, (max_segments, (user, (query.type); ) (query.type"tosnwβ; (ma -sms length" 159: ()data • (OUT('HTTP.body'); (max-jsegments"' 3; • cache_create((ID, (data); ) else {
((cad, »erβ»>" βλRGV; if ((debug) ( print (debug '(err: (errstr\n':>
Ul )
(debug-*tr« *-d|— ebug"; last; ) if (Cerg«(0J — a/-((debug_str)(/i ) ( »)
(debug* \*STDERR; shift βarg i βlines • getlines(strip-*paces(btalstrip((data))); I els* {
(debug* 0; •if ((debug) ( print (debug joint"", βllnβs) ; print (debug "\n""'*' \n"; ) ) If ((lllnes —I) [ if ((t»-V(,wCate_SRC') — /"9il(/l ( print STDERR "(ID: Sorry, headline news is unavailable at the moment. ';
(testing* 1; ) else ( ) tin ( • βarticles* 0; uαd«f (testing; •categories*!); ) (index* 1; (key- "i ay βcelleaetryjφa_list- ( 404, 207, foreach (line (βlines) I 320760. chomp (line: 218 (line — s/\s+/ /g:
); (line — s/-\s*|\s*(//gι
• if ((debug fcfc (line) { print (debug "(line\n";> foreach (βcellemetry_npa_list) ( If ((line) I if ((ENV('wαate_PNO') — /-\d(_/) { If ((Index "• 1) (
(ma-r sms.length* 116; (key> (line; last; ) elsif ((Index •• 2) (
1 If ((key) { ) if (exists (cstegories<(key)l { push β((categories((key}), (line; if ((debug) I print (debug
Figure imgf000040_0001
) else ( my βarticles" (I ;
(user* shif βargs 11 " ; push βarticle, (line;
((user, (pass)" split A*/, (user, 2; (categorie*((key)" Xβarticle;
)
(URL ■ 'http://Vww.lnfospace.com/tos.lava/redir8.all.htm?*; ) (QUERY w *pgtarg"(query.typebusemame"(uaer"; ) elsif ((Index (index" 0: if ((debug) ( print (debug "(URL" "(QUERYVn";) (key« ••; 7/38/00 7/28/00
Figure imgf000041_0001
• If ((key fcfc Ktarticles >• 0)1 (
• push (((categorlesKkey)), ( βartlcles 1;
• βartlcles- (I;
• (key "";
• )
Figure imgf000041_0002
if ((data) ( if (length (data <■ (max.ams_length) { print (data; I els* ( ay ((data, (res, (oldres, (max) ;
(max" (max-ams- ength - length( "2/2 — ■ while ((data — m/\b/g) {
(oldres- (res 1 1 (max;
(res* pos l(data) | | -I; if ((res > (aax fcfc (oldres > 0) ( if ((debug) ( print (debug '(res:(oldres: " substrKdata, 0, (oldres) push βdata, substr((data, 0, (oldrβsj ; (data* substrKdata, (oldresI ; i )f ((debug) { print (debug
Figure imgf000041_0003
If (length (data) ( push βdata, '(data; 1
); ;
;
Figure imgf000042_0001
• Convert User Entry to appropriate case t added It loop by pp (teaa v joint' *,βargs); if Ktlines —1) {
(team — tr/[s-«)/(A-ZJ/; print "(ID: Sorry, NBA results are not available at the moment.';
• print '(CMD; Information Temporarily Unavailable, lease Try Again.
• Teams Entry Conversion Table exit(O); "inbateams" ( )
7/28/00
• Look for occurence of specified team in Returned Content
• And Format Result if ((found •• 1) (
•sportlookup ■ lookup.lines team, 0, βlines} ;
(index • (sportiookuplO] ; if ( Kimdex) ( βsportlookup * lookup.lines((teamalt, 0,βlines) ;
(index * (sportiookuplO]; i )f ((Index) { βsportaask* split ( ' , ' , (lines [(index] I ;
(sportteaml* (sportmas O) ; (sportscorel* (aport askU) ; (sportteam2> (sportmask[2) ; (sportscore2* (sportmask(3) ; (sporttiae- (sportmask[4] ; (sportteaml ■ lc ( (sportteaml ) ; It ((sportteaml — /-la/1) (
(sportteaml — •/ (\w. l (\s\w) / \u(l\U(2/g; ) else (
(sportteaml — s/- (\w) | (\s\w) AU(l\U«/g; )
(sportteaa2 ■ ucflrst(lc((sportteam2l 1 ; (sportteam2 — sAs(\w) / \U(l/g; (sporttlm* " (ucKsporttim*) ) ; (sporttiae — s/\| //g; If ((debug) ( print (debug joln( ' * ' , βllnes) . '\n" ; print (debug *(sportmask\n* ; print (debug *Index-> (Index \n "; print (debug "Arg-> (team'; )
» if ((sportscorel — m/[-0-9J/l ( • print "(CMD: HOD On"; exit(0|;) print "(cmd: (sportteaml (sportscorel - (<portteam2 (sportscore2 ((sporttlme) " ; ) »!*» I
• Ins«rt Schedule Checker here print "(cad; (team Is/are not scheduled to play today.*; 1 ml* )* ( print "(cd; Team not found. Please try again,*; )exit(O); 1;
"(cmd: Information is currently unavailable, please try again later, exitll);
• V *gm 1
• aov [<zlp>] <title>
(index ■ (indexlOl * 2;
• Ittltllt.tlllllilt.ltllltllt.llllttllt.lllltllll.imttllt. lllll (theaters * (lines((index] ;
• (theaters * split_fields((thestersl ;
• (Id: acv.v 1.1 1999/04/1518:02:18 vcoa Exp ( (theaters » " i •
• NAME: MOV foreach (theater (.theaters) (
• MODULE: wgate unless ((theater — m/fcnbsp| (-\s*() /) { t PROJECT: roamonline(rolϊ if (l(theaters) (
• PURPOSE: Perlscript for extracting theaters showing a film. (theater* .* '(theater';
• USAGE: Used in conjunction with wgate module of ) else ( • RoamOnline, (theaters .* ", (theater*;
• SYNOPSIS: N/A )
• HISTORY: The original script from Edge. Modified by rhk ) • for U.S. use. I
• RELEASE: M/A
• LOO: Appended at the end of the file. βindex > lookup_lin«s(*Moviesfcnbsp;Hom*<, 1, βlines); • if ((•index » 0) (
• (C) 1991, 1999 Lava Communications. All rights reserved. (index > (indexlOl + 22; • (MOVIE • (lines[(index);
(MOVIE — s/\|//g; )
((cad, βMOVIE) * β ROVl ay |(d*£*ult_lip) ; print "(cmd: \U(M0VIϊ: playing at (theaters.";
(d*t*ul -ip" '98006'; • Bellevue, WA exit(O); 1;
(problem • 0; If(fproblea) ( s*αd_inf ((ENV( ' wGate_PNO ' ) ,
'(cad: Sorry this service is currently unavailable'); exitll); )
(URL * *bttp;//aovies.yahoo.com/showtimes/showtlmes.html"; if ((tMOVIE > 0 fcfc (HOVIEIOJ •- /-\d*(/) ( (sip • Shift(βHOVTE);
1
(MOVIE • "βHOVIE-l (MOVIE — tr/ /*/; if ((•AEQV < 1) ( primt( '(cmd: Usage : (cmd [<zip>] <titlβ>" l , exit 111 i ) if ( I (zip! ( (zip • (default.zip; )
(QUERY" 7m«(M0VIEfcZ"(zip* ; •print (QUERY)
(10 > (ENV( *vO*te_HSG' ) l v3grab_init( ) ;
• ((res, (data) • cache_get KID, 900) ,
»if((r*s .. 01 ( f(*rr, Sii tt, •OUT) ■ w3grab ( " , 'GET' (URL . (QUERY) ; if K*rr *• 01 (
(data ■ (OUT('HTTP.body'); t c*che_cre*te((ID. (data); 1 βlines " getllnes(strip_spaces(htmlstrip((data) } ) ; •open TEST, *>test.aov*; •print TEST joint'-', βlines) ;
•index " lookup- lnes('More theaters', 2, βlines) ; if((tind*x » -1) ( print
7/38/00
• KLB_I0D 'New York' "^ 'Nets', 'Pirates' »> 'Pittsburgh', tiiiitiit.imiiiii.iittiitii.it iiti. mt tt.timitit. tttit 'Brewers' •> 'Milwaukee', 'Braves' "> 'Atlanta',
• (Id: mlb.v 1.1 1999/11/20 08:39:05 vco Exp ( •Expos' *> Montreal', • 'Harlins' *> 'Florida',
• KAMI; KLB-JOD 'Reds' *> 'Cincinnati',
• MODULI: wgate/alradlgm 'Astros' "> 'Houston',
• PROJECT: roaaonline/alradigm •Cardinals' •» 'St. Louis', t PURPOSE: P«rlscript for extracting headline news. 'Diamondbacks' »> 'Arizona1,
• USAGE. Used in conjunction with wgate module of 'Padres' «> 'San Diego', • RoamOnline for λiredigm. Rockies' ■> 'Colorado',
• SYNOPSIS: N/A 'New York Yank***' -> 'Yankees',
• HISTORY: 1999-11-15 jbz: Created 'Red Sox' "> 'Boston',
• RELEASE; N/A Blue Jays' "> 'Toronto*,
• LOO: Appended at the end of the file. 'Orioles' "> 'Baltimore', • 'Devil Rays' «> 'Tampa Bay',
• (C) 1991, 1999 Lava Communications. All rights reserved. 'Indians' •> 'Cleveland', 'Tigers' *> 'Detroit', tiiittiiitiiiitiiiiiiiiimiiiitimttitiimiitmtimitmmt 'Twins' «> 'Minnesota', 'Royals' -» 'Kansas City' , ay ((cmd, (found, (debug) ; Rangers' *> 'Texas', 'Athletics' "> 'Oakland', ((cmd, (args) • βARCV; 'Mariners' "> 'Seattl*', 'Angels' »> 'Anaheim'))
• Retrieve RoamOnline Parameters
• trojparams * get_account((ENV( 'wGate.PNO' ) ,(cmd) ; •Translate user Entry to Recognized Teaa
(found " 0;
• Check for Debug Flag foreach (key (sort keys %mlb earns) ( if KargslO) — m/-\-d(/i) ( (val - (mlbteams((key);
(debug* \'STDERR; if ((key— /(team/i 11 (val— /(team/i) ( shittβargsi (team* (val; ) else { (teamalt" (key;
(debug* 0; (found " 1; 1 last;
• Check if Date Supplied for historical lookup )
• Assignment of appropriate URL ) (detail* 1; (ID . (ENVCwGatβ-MSO'); if KargslOl) ( if Kcad— /-alb/i) { • Grab Internet Content if ((args[-l) — /- (\d\d) (\d\d) (\d\d\d\d) ( | - (\d+) i\/-l (\d+) [\/-] (\d+) (/) ( w3grab_init() , (alb-yeax • (3 j (6; •(parameters ■ *"; (alh aonth * (1 I (4; •((res, (data) " check-cache((ID,(parameters, (alt day * (2 | (5ι •if((res — 0) {
(alb_aonth_day ■ (alb-month . (mlb.day; ((err, (errstr, "tOUT) « v3grab(* 'GET', (URL);
(URL" "http: //cbs.sportsline,com/u/sports/mlb/(mlb_year/(mlbjaonth_day/index.html" If((err »» 0) { pop βargsi (data ■ (OUT( 'HTTP.body* ); ) else ( t cach*_create((ID, (data);
(URL* 'http://cbs.sportsline.com/u/sportsticker/scoreboard/mlbβbd.htm" ; ) ) •)
> else ( print 'Sport does not exist! "; .lines • getlines(strlp_spaces(htmlstrip((data))); exit) ) If ((debug) ( ) els* ( print (debug joinC", βlines) ) print "More information is needed,"; print (debug "Index-> (index \n *; exit; print (debug "Arg-> (team"; ) )
• Convert User Entry to appropriate case • Look for occurence of specified team in Returned Content (team * joinC «,βargs); • And Format Result
(teaa — tr/[A-ΪJ/(a-*J/; if ((found -- 1) ( (teaa — s/*(\D) AU(l/g; βsportlookup ■ lookup_lines{(teaa,l,βlines) / (team — s/\s(\D)/ \U(l/g; (lookuptest " (lines[(sportlookup[0]+l); if ((lookuptest— Ad/> { t Teams Entry Conversion Table (index * (sportiookuplO] ; "imlbteems- ( ) else (
Los Angeles' » 'Dodgers', (index * (sportlookup[l];
'Giants' ■> 'San Francisco',
'Chicago Cubs' ■> 'Chi Cubs' , i )f (I(index)
'Chicago Whit* Sox' •> 'Chi whits', βsportlookup * ( lookup Lines((teamalt,1,βlines) ;
'Phillies' ■> 'Philadelphia'. (lookuptest • (linesl(sportlookup[0]*l);
'Braves' ■> 'Atlanta', if ((lookuptest.- Ad/I (
7/31/00 7/28/00
mlb
Sindax * $βρortlookup(0] ; ) else (
Sindax * Ssportlookupfl) ; i if {(index) {
(sporttest" (lines[(index+1] ;
(sporttest— *As|\|//g; if {(sporttest— /-/) {
(sporttest" (lines[(index-4]ι
(sporttest— s/\s|\j//g) if ((sporttest) (
(index" (ind«x - 4;
)
(sportteaml" (lines[(index] ;
(sportscorel" (lines[(index+1];
(sportteaml— s/\|//g;
(sportscorel"- s/\|//g;
(sportteam2» (lines[(index+41 ;
(sportscore2" (lines[(index+5];
(sportteam2— s/\|//g;
(sportscore2— s/\|//g;
(sporttiae" (lines[(index*2] ;
(sporttime— s/\|//g;
(sportscorel" ' (' . (sportscorel . ') ';
(sportscoreS- * (" . (sportscore2 . ') '; ) else (
(sporttest- (linest(lndex-l];
(sporttest— s/\s|\|//gι
If (l(sporttest) (
(Index" (Index - 6;
( )sportteaml" (lines{(index) ;
(βportrunl" (lines[(index*l] ;
(sporthitl" (lines[(index+2];
(βporterrorl" (lines[(index+3] ;
(eportrunl— s/\l//g;
(sporthitl— s/\|//g;
(βportβrrorl— s/\|//g;
(sportscorel" '(sportrunl (sporthitl (sporterrorl*;
(sportteaml— s/\|//g;
(sportteam2* (llnes[(lndex+6] ;
(βportrun2* (lines[(lndex+7);
(sporthitl- (lines[(index*8);
(sporterror2* (lines[(index*9] ;
(sportrun2— s/\|//g;
(sporthlt3— s/\|//g;
(sporterror2.- sA}//g;
(sportscore2. "(sportrun2 (βporthit2 (sporterror2";
(sportteam2— s/\|//g;
(sporttiae" (linesI(index*4];
(sporttiae— e/\|/ /g; ) print "(cad: (sportteaml (sportscorel - (sportteam2 (sportscore2 (sporttime"; ) else { print "(cad: (teaa Is/are not scheduled to play today."; ) ) else ( print "(cmd: Team not found. Please try again.'; ) exit(O); I;
Figure imgf000046_0001
midweather
) cannot be found.";
' )) (hashref->{ *cond' ) .
Figure imgf000047_0001
7/28/00
(data" ••: foreach (βdatal (
If ((debug) { print (debug "(_Sn"ι) if (lengtbKdata) * lengthK.) <• 116) (
(data ." (_; ) else ( last; ) ) if ((data) ( s*nd_msg((ENV('wQete_PNO'), (data); it ((debug) ( print (debug lengthl(data) . '\n';l ) exi (0)1 1;
7/38/00
raidπewsf ilter midnewsfilter
•I/usr/local/bin/perl hile (<IN>) {
• KIDNEMSFILTER chomp; if (/-:\s*(.+)\s':/) ( iiiiititi.tiiiiiiii.iimiiti.iimtiit.iimtiit.tiititm.tiitt (1 — /news/i and (inSection" 1 and next;
(InSection" 0;
• (Id: aidnewsfilter.v 1.1 1999/12/04 10:24:59 vcom Exp ( ) • not (inSection and next;
• NAME: MIDNEWSFILTER s/-\s*|\s*(//ι
• MODULE: wgate/aidwest sAs*/ /;
• PROJECT: roamonline/aidwest Irol-mid) tr/λ-Z/a-z/;
• PURPOSE: Perlscript for extracting headline news from /-(/ and next;
• Infospace.com and filtering against the user's dβbug-print('((_)'):
• preference push θkeywords, (_;
• USAGE: Used in conjunction with wgate module of )
• RoamOnline for Midwest Wireless Demonstration. close IN;
• SYNOPSIS: N/λ
• HISTORY: my »pr*v_sent* () ;
• RELEASE: N/λ my (cur.time" time;
• LOG; Appended at the end of the file. t 60s * 60a • 24h > 86400 • my (one.day* \86400; t (C) 1999 Lavs communications. All rights reserved. open IN, */usr/local/wMail/filter/n,(user'; I while (<IN>) [ iiiitittiiiiiiiiiiiiiitittiiiiiiiitmitmimtimmtfmttttt chomp;
(vel* <IN>; • ay ((IS, (URL, (OUERY, (cmd, (args, (debug_str, (res, chomp (val;
(data, (err, (errstr) ; if Kcur.tlm* - (val > ((one_day) ( next;) local (debug; tr/ //d; local (teeingi tr/λ-Z/e-z/;
/-(/ and next;
(ID* 'MIDNEWSFILTER* : debug-prlnt("(."(val') ;
(prev.sent((_)" (val; ay ((max_sms.length, (max_segments, (user, (query.type) : ) close IN;
(aax_sas_length" 159; (aax_ sega*nts* 5; • per category my (root" '/usr/local/wMail/filter"; my (newsdb_file> 'newsdb.txt';
Kcmd, (args). βARGV; my (key. "; my inewβdb.() )
(debug-j tr* '-d[--debug' ; open IN, '(root/(new*db.file'; if KsrgslO] — a/-((debug_str) (/i ) ( whi * (<IH>) [
(debug- \*STSERR; chomp; shift βargβ; If l/-\D+/) { ) else { (k*y. (_)
(debug* 0; ) else ( ) ((timestamp, (headline)* split ':', (., 2;
(article* <IN>; if ((EHV{*wCate_SRC' ) »- /-91K/I ( chomp (article)
(testing* 1; (timestamp — s/-\s*|\s*(//ι ) els* ( (headline — s/-\s+|\s+(//ι undef (testing; (article — s/-\s+|\s*(//ι )
(val* (headline) ay βcelleaetry_flpe.list" ( 404, (val — tr/λ-Z /e-z/d;
207. it (I exists (prev_*ent((vsl)> (
320760.
218 foreach (βkeywords) ( ) ; debugjprin ( "Hatching (_ on ((Val)*); foreach (βcellemetry_npa_list) { if Kval — /(_/si) ( if {(ENV(*wOate_PNO*) — /-\d(_/l ( (exch" uc (.)
(asr sms-J.ength- 116; (headline — s/$_/(exch/g> lest; « (article — */(_ (excb/gι
) debugjprin ( "Pushing (headline. ') ;
1 push βdata, (headline; (prev_sent(Cval)« (cur.time) debug print('βλROV') ;
(user* shift βargs || ";
((u*«r, (pass)* split A*/, (user, 2;
•(id* shift βargs || "; close IN; ay βkeywords" () ; open IN, '/uar/local/wMall/filter/f. user- open IN, •>/usr/local/wHall/filter/n.(user"
7/28/00 7/28/00
midnewsfilter midnewsfilter while({(key, (val) ■ each *tprev.8ent) { if (β(out) ( debugjprin ( "(key:(val"() push βsegments, join! β(out) ; print IN '(k*y\n(val\n'; I
) close IN; my (size* scalar (segments; my (index- 1;
(cut" (max_>ms.length length! '1-11 foreach (θsegments) ( (index" 1; (_- "(index-(slze) (_"l if ((index < (size) ( (_ if ((testing) ( (index**;
(ENV('wG*te_PNO<) s/-\d/9/; )
)
) else ( foreach (βdata) ( push βsegments, (data;
(data" 'KEWSdndex: (_'; foreach (segment((data, (max_^ms_length,
(_ — s/\s*/ /| return (reverse βsegments) ; send_asg((EHV(<wGate.PNO'), (_) ; debugjprint! '(_.( ' . length((.11 ;
)
(index**; ) exit;
1; sub debugjprint
If ((debug) ( print (debug
Figure imgf000050_0001
sub segment ( ay (data" shift or return; ay (max" shif 11 116; ay (cut" shift (I (max; ay (total_length" 0; ay (segments- (); if fleαgthl(data) > (max) ( ay βdata- split /(\b)/, (data; ay (out" []ι while (defined((_ ' shift βdata)) ( next if /*(/)
Figure imgf000050_0002
7/2J/00
lot lot
fJi
©
Figure imgf000051_0001
my (ua> new LWP: :Userλgent; (result! 'results') .* " (val"; my (req« new HTTP: :Request( 'GET' -> (uri);
(continue.result" 0;
(res" (ua->request((reql ; ) if((res->ls_success()) ( if (!(cont.nue_result fcfc keys(".result) >- 3) I (data • (re*->content() ; push! βdump_out,
"(result! 'game* )\240((result! 'date' ))\240(result( 'results' J-);
) else I undef treeult;
• HTTP Error. ) ) print DEBUO (res->aβ.string!) ; send_lnfKmn, "(cmd: Cannot process your request at this time. sub prepare
Please, try egaln later.'); ( return 0; (.[0] — tr/ / /s; ) (.[0] — s/-\s*|\s*(//g; ) I; if 11(cache) ! ay (counter* 0; sub abbreviate ay (aax_retry> 3; I while {(counter** < (max_retry) ( • WARNING: MAY NOT WORK WITH WV.
((err, (errstr, out) " w3gr*bC', 'GET', (uri); while (my ((key, (vel) • each us_atate_table) ( if ((err •« 0) { (.[0] — s/\b(val\b/(key/ig;
(data, (out!'HTTP.body'); ) last) )
) elsif ((err •• 302) ( (out* join "; ", βdu p.out; • Redirected If ((out) ( prlnt("(cmd: (out"))
(data* (out! 'HTTP.header'); cache_create((cache_key, (out! 'HTTP.body' ]■) it ((data) ( unless ((cache || (testing fc i) i
(data — a/-(Location|URI): !.*)/i; 1 else {
If (defined (2) { s*nd_err((mln, •(cmd: Cannot find lottery information for \U(stete\E. print DEBUG "Redirecting to (2.\n"; . "Please, try again.');
(uri* (2; ) next; ) 1; ) ) ) if ((err) ( print DEBUG "HTTP Error: (err KerrstrlSn"; sen-Llnf!(aln, "(cmd: Cannot process your request at this time.
"Please, try again later."); return 0: ) ) else ( print DEBUG "READ FROM CACKE\n": βdata* split An/, (data; ay (βduap_out, lresult, (continue_result) ; for (βdsta) ( if (/-([-:)*):(.♦)(/) I ay ((key, (vail- 1(1, (21; prepar*((key) ; prepare(Sval); abbreviate((val); if ((key — /-(game|date|results)$/i) (
(reault('\L(key'). (val;
(contlnue_result. (IcKfc) eq ' results ' ) ; )
) «lsif ((continue.result) !
If l /-\*» (\S .*l /> ( ay (val. (1 ; prepare ((val) ;
7/38/00
inv inv
» INV (re" (dbh->disconn*ct or die "(cmd: ctnnot disconnect. ' ; exit(0) ; use DBI; ) elsif Kreserv — a/(arg/i> ( (quant • (ARCS [2] ;
((cmd, βλROS) » βλRGV; if ( Kquant 1 1' (quant I- a/-\d*(/) (
(quant " I; if KIARGS < 0) I ) print "Usage: INV"; (sth " (dbh->ptepare( "SELECT quantity FROM quantity WHERE partjio • \ '(part\' ; ) or die "(ca exitlO); d(5) : cannot execute, please try later,'; ) (rv * (stb->ex*cute' or die "(cmd{6) : cannot execute, please try later.";
(dbh- DBI->connect("dbi:Pg:dbname-honda") or die "(cmd: cannot connect, please try later.': if ((rv > 0) I βdesc ■ (stb->fetchrov.array or die "(cmd(3): cannot retrieve, please try later.";
If KAROS10] — m/-(\d*)(/l ( if Kldesc •• -1) ( (part* (II print "(cad: (part not foundΛn"; ) els* {. it KIARGS •• 01 { (old_quant » (desctOJ;
(sth* (dbh->prepare( "SELECT description FROM part_list WHERE part_no » VSpar Vi") or di« "(c if l(old_quant < (quant) < add): cannot execute, please try later."; print "(cmd: Not enough (part-(old_quant unit(s)';
(rv " (sth->ex*cut« or die "(cmd; cannot execute(3), please try later."; ) else ( if Krv > 0) { (new_quant * (old.quant - (quant; βdesc ■ (sth->fetchrow.array or die "(cmd(l) ; cannot retrieve, pleas* try later.'; (sth • (dbh->prepar*(»upd*t* quantity **t quantity(new_quant where part-no » \'(part\ If Kldesc *• -I) { ';) or di* *(cκd{7): cannot execute, please try later.*; print "(cad: (part not foundΛh"; (rv * (sth->ex*cut* or die '$0x1(8): cannot execute, please try later.'; ) els* ( if ((rv <* 0) { print "(cad: (part-(desc[0]\n*; print '(cad(9): cannot execute, please try later."; ) ) else ( ) else { (sth • (dbh->prepareI"SELECT quantity FROM reserved_quantity WHERE part.no • \'(part print "(cmd: (part not foundΛn"; \';") or die "(cadla); cannot execute, please try later.*; I (rv * (βth->βxecute or die "(cad(b) : cannot execute, please try later. »; if Krv > 0) (
(sth->tinlsb; βdesc • (sth->fetchrow.arrβy or die "(cmd(51 : cannot retrieve, pleas* *-" i-*--*
(re* (dbh->dlsconnect or die "(cmd: cannot disconnect,'; if ((Idesc > 0) ( exit(0); (old.quant * (desc[01; ) • (new.quant * (old.quant * (quant; (!ar*•g •( (ARGSd); (sth * (dbh->prepare("UPDATE reserved.quantity SET quantity(new.quar (quant * 'quantity' ; t_no « \'(pert\';"ϊ or die "(cmd(c) ; cannot execute, please try later."; (reserv * 'reserve': (rv ■ (sth->ex*cut* or die "(cad(d) : cannot execute, please try later (price * 'price' ; if Krv > 0) ( print "(cmd; (quant uhitts) of (part reserved.': if ((quant — m/-(arg/i) ( ) else (
(sth * (dbh->prβparβ("SELECT quantity FROM quantity WHERE part.no • \'(part\';") or die "(cm print "(cmdle) : cannot execute, please try later.'; d(3ϊ : cannot execute, please try later."; )
(rv * (sth->execute or die "(cmd(4) : cannot execute, please try later,*; ) else 1 print 'cmd(f) : cannot *x*cut*, please try later."; it Krv > 0) ! ) idesc * (sth->fβtchrow_array or die '(cmd(2): cannot retrieve, please try later.'; ) else ( It ((ld.s .. -i) ( (sth • (dbh->prepare("INSERT INTO resβrvβd_quantity (part.no, quantity) VALUES (V print "(cad; (part not foundΛn" ; (partV (quant);') or die '(cmd(F) : cannot execute, please try later.'; ) els* ( (rv » (sth->*xecut* or die '(cmd(G) : cannot execute, please try later."; print '(cmd: (part-(d*sc[01 unit(s)\n"; if Krv > 0) { ) print "(cmd: (quant unit!*) of (part reserved.") ) else ( } else ( print *(cmd: (part not foundΛn"; print '(cad!*); cannot execute, please try later.*;
()sth->finish; )
1
(re* (dbb->dlsconnect or die "(cmd: cannot disconnect.': exit(O); ) elsif ((price — m/-(arg/i) ( )
) (sth • (dbh->prepare("SELECT price FROM price WHERE part-no - \'(part\'l") or die "(cmd(3a) : ) else { cannot execute, please try later."; print "(cmd: (part not foundΛn";
(rv * (sth->execute or die "(cmd(4a) : cannot execute, please try later.';
()sth->finlsh; it Krv > 0) { (re* (dbh->dlsconnect or die "(cmd: cannot disconnect. βdesc ■ (sth->f*tchrow.array or die *(cmd(2a| : cannot retrieve, please try later.*; exitlO); if Ktdesc ". -1) { ) print "(cmd: (part not foundΛn";
) else ( ) ) else ( print "(cmd: (p*rt-(desc!01\π'; if KtARGS .. 0) {
) (desc • (ARCSIOJ ; . ) else ( (query • •\" \%\U(desc\ϊ\*\ ' "ι print "(cmd: (part not foundΛn"; •print (query . "\n"; ) (sth" (dbh->prepare( 'eelect part-flo from part_list here description like (query; ") or die "(c (sth->tinish; md(h) : cannot execute, please try later, " ;
7/28/00
inv
(rv » (sth->execute or die "(cmdϋ)* cannot execute, please try later,"; " if Krv > 0) (
(part • (*th->tetchall_arrayref or die "(cmd(6). cannot retrieve, please try later.";
•part • β(part:
Figure imgf000054_0001
Figure imgf000054_0002
(sth->flnisb;
(re* (dbh->disconnect or die '(cmd: cannot disconnect.'; exitlO); ) I
(re* (dbh->disconnect or die "(cmd' cannot disconnect.'; exit(O); 1;
Ul
• I /usr/local/bin/perl •if((res >• 0) ( (counter" 0: (maχ_retry* 3; iiitiiiii.tiiiitiit.tttitHtt.imtmi.iimittt.mmiii.mil while ((counter <» (max_retry) { . ((err, (errstr, tOHT) - w3grab( GET' , (URL . (QUERY) ;
• (Id: istonews.v 1.11999/12/04 09:14:34 vco Exp ( if((err — 0) ( • if ((OUT('HTTP.res') —a/302/) (
• NAME: INFONEWS • Redirected
• MODULE: wgste/aidwest (data - (OUT('HTTP.header');
• PROJECT: roamonline/midwest (rol-mid) if ((data) (
• PURPOSE: Perlscript for downloading news from (data — a/-Location: !.*)/l;
• Infospace.com. if (defined (1) { t USAGE: Used in conjunction with wgate module of debugjprint( 'Redirecting to (I.');
• RoamOnline for Midwest Wireless Demonstration. (URL* (1;
• SYNOPSIS; N/λ (QUERY* "":
• HISTORY: **(counter;
• RELEASE: N/λ next;
• LOO: Appended at the end of the file. •
• (C) 1999 Lava Communications. All rights reserved. • (data • (OUT { 'HTTP. body' ) ; itiiiiittiiiitiiiiiitiiimmtttiittttitmiiitimmmmmi cacbe.creete KID, (data) ; ) else ( ay ((ID, (URL, (QUERY, (cad, (args, (debug_str, (res, debugjprint! "(err: (errstr\n"l ; (data, (err, (errstr) ; ) last;
(ID" 'INFOKCWS' ; my !(max_mms_length, (max.segments , (user, (query.type) ; locel (debug: βlines" getlines (strip.spaces (htalstrip((data) 1 ) ;
(su-x-j*ms_length" 159 ; if ((dines —1) ( (maxjsegaents" 3: print STDERR "(ID: Sorry, (key is unavailable at the moment. ) else (
((cmd, βargs) * βλRGV;
(data> join ", βlines;
(decug-str* *-d| — debug* ; βdata" split A|/, (_;
Figure imgf000055_0001
w3grab_init(| ) (root" ' /usr/local/wKail/f liter' ; (newsdb.flle- 'newsdb. txt' ;
• Disable each* for now. (12??98/rhk) I ((res, (data) • cache.get ID, 900) ; If (openlNEWSDB, '(root/(newsdb_flle' l ) <
Figure imgf000056_0001
(cur.tlae" tlae; if (β(out) { (on*_d*y \>6400; push θsegments, joint ' ' β(out) ; ) it (opentKEWSDB, '>(root/_(newedb_file') ) ( my (size- scalar βsegments; while! ((key, (val)" each tnewsdb) { my (index" 1; debugjprint("(key") ; foreach (βsegments) { print NEWSDB *(key\n* : (." "(indeκ-(βise) (_"; if ((index < (sizel ( (_ while! ((headline, (article)" each t(val) ( (index**;
((tlae, (article)" split "\n\ (article, 2; ) debug print("(tlae: (headline"); if ((cur.tlae - (tlae < ((one_day) ( } else ( print NEWSDB "(tlme:(heedline\n(artlcle\n*; push βsegments, (data; debugjprint("pushe . ') ; )
Ul Ul return (reverse βsegments) ; close NEWSDB; rename("(root/_(newβdb.file' "(root/(newsdb.file*) ; exit; 1: sub debugjprint if Kdebug) I print (debug *β_\n*;) sub segment { ay (data* shift or return; ay (max. shift | I 116; ay (cut" shift 11 (max: ay (total-Λength" 0; ay βsegments" (1 ; it (lengtbKdata) > (max) ( my βdata" split /<\b)/, (data my (out" (J) while (definedK. - shift βdatal) ( Cheap; next If /*(/;
Figure imgf000056_0002
• IND
(URL * "http://www.fish.com.sg/regional.html";
(ID • 'IND*; w3grabjnitll!
((res, (data) ■ cache_get KID, 900);
IfKres — 0) (
{(err, (errstr, »0UT) « w3greb('\ 'GET', (URL); - if((*rr •* 0) (
(data * (OUT ('HTTP. body'): cacb* :re*te((ID, (data);
• )li'ne* • getllnes(strlp_sp*ces(htmlstrip((data))); •print(join(*Vn*, βlines) I i
(test? » shiftlβARGV);
(CURR-'βAROV" ;
Figure imgf000057_0001
7/28/00 1
hor ttitiiiit.iiiiitiii.ttiimii. itittim. tmimi. iiiitmt. iiii> f ((key — m/-(sign/io) ! • (sign* (key;
• (Id: hor.v 1.3 2000/02/29 00: 59 : 35 rhk Exp ( last; t )
• hor )
• MODULE: wgate ) elsif ((sign — m/- (\d(3) \d?) (/) (
• PROJECT: roamonline (rel. 2.2) my (blrthdate* (1;
• PURPOSE: Perlacript for extracting daily horoscope from while ( ((key, (val) * each tzodiac) (
• Infospace.com. my Kdate-min, (date-max) » split /•/ , (val, 2;
• USAGE: Used in conjunction with wgate IOD module of it ( ((birthdate »• (date-aln fcfc (blrthdate <* (date-max) 1 1
• RoamOnline. ( blrthdate * 1200) » (date-aln fcfc
• SYNOPSIS: N/A ((blrthdate + 1200) <" (date-max) ) (
(sign- (key;
• HISTORY last;
• 1999-07-23 rhk: Development odifications )
• 1999-15-99 jbt: M ) I 3000-02-36 rhk: Updated for Release 2.2. ) else ( I send_err( (pno, "(and: Cannot understand the argument. Please, check
• RELEASE: alpha , "it and try again.");
• LOO: Appended at the end of the file. return 1; • )
• (C) 3000, 1999 Lava3140, Inc. All rights reserved. ) else ( •titiitiiiiiiiliitiiitiiitmiitittitttmititiitttitimtitiimi ) my (use-short. i; sub get.lnfoname-by.mln I return (.[0] ; } ; my (urll" 'http://horoscopes.astrology.com'; my (url3* 'http://www.infospace.com/tos.lava/redirs_all.htm'; if Kuse-short fcfc (sign) I my (d* 'HOR'; (query* "Dally(slgn.html" ; ay (pno* (ENV('wGate_PNO' ) :
• (urll* 'http://feeds.lnfospace.com/lnfo.mylava/horoscopes* ; set_lod('svccode', "Kid"); • (query" "otmpl*/horoscop**/horo*cop**-out.htalfc" s*t_J.od('eol', *\W')ι I . •qbd-fcofmt*fcqdm-fcqzodiac*(sign') set_iod(*eof, *\W*1; s*t_iod('titl*'. "I; (uri* "(urll/(query'] set_iod(*header', *tπ/tm '1; ) else ( set_iodCfoot*r', ' ...'); ay (user* get- nfonaae_by_aln!(pnσ) ;
Ul -4 set-lodt'max', 0) i (query* "pgtarg*toshorfcusername*(user* ; (uri* "(url2?(query"; local toptlonsi (u*e_short* 0;
GetOptlons(\toptions, "dβbug|d", "testj testing| t:i") ; ) ay (debug* exists (options('debug') ; ay (tasting- (exists (options!' test' 1)7 ( (options!' est' 1 || 1 ): 0; (cache_key" (Id . md5_base64 Kurl) ; local 'DEBUG" (debug7 \-STDERR: \-DEBU0; print DEBUO 'URI (urivn' i local •STDOUT" ((testing i 1)7 \*DEBUG: N'STDOUT; print DEBUO 'CACHE: <(cache_key>\n" ; my ((cmd, βargs)- βλRGV; ((cache, (data) • c*che_get<(eache tey, 3600) unless ((testing fc 2) ; ay ((query, (uri, (cache_key) ; if (0) ( ay ((cache, (data, βdata, (out) ; my (ua" new LWP: :Userλgentι ay ((err, (errstr, tout); my (req" new HTTP: ;R*quest{ 'GET' "> (uri) ; ay ((sign, (key, (val) ;
(res- (u*->request ((req) ; t Astrological Signs. ay tsodiaC" ( if!(res->is_success()) (
"aquarius" "> "0120-0218", (data " (res->content() ;
"places" -> "0219-0320",
•sries" "> "0321-0419", ) else {
"taurus" ■> "0420-0520", » HTTP Error.
"geaini" *> "0521-0620",
•cancer' *> "0621-0722", print DEBUO (res->as_string()ι 'leo" ■» '0723-0822', *encLinfl(pπo, "(cmd: Cannot process your request at this time. ' virgo' -» "0823-0922', 'Please, try again later.'); libra' » O923-1022", return 0; "Scorpio" *> "1023-1121". "Sagittarius" *> "1122-1221-, ) ) Capricorn" ■> "1222-1319' ); if (I(cache) ( . my (counter" 0;
If (defined ((sign* shift βargs)) ( my ( ax.retry" 3; • Determine Sign while {(counter** <" (max-rβtry) ( ((err, (errstr, tout) " W3grab(", 'GET' (uri);
If {(sign *- m/-\D*(/) ( foreach (k*y (sort keys tzodiac) { if !(err *. 0) {
hor hor
(data- (out! 'HTTP.body'); push βdu p.out, (_ If ((_ I- /-\s*(/); last) ) ) elsif ((err — 302) 1 • Redirected (sign- lc shift θdump.outf (out- shift βdump.out;
(data* (out! 'HTTP. header' ) ; ) if ((date) (
(data •- a/- |Locatlon|URI) : l .*) /l; if ((out) (
It (defined (2) ( print! ucfirst! substr! (sign, 0, 3 )) . ': (out'); print DEBUG "Redirecting to (2 π' cache_create((cache cβy, (out{ 'HTTP.body* ))
(uri* (2; unless ((cache || (testing fc 4); next; ) else ( send_inf((pno, "(cmd: Unable to retrieve the horoscope. . "Please, try again later."); )
If ((err) ( print DEBUO "(err: (errstrSn"; seod- nfKpno, "(cmd: Cannot process your request et this time.
Please, try again later.*); return 0; ) els)* I print DEBUG "READ FROM CλCHESn' ; ) print DEBUO "(date\n'; local βdump.outl inlt-parserl) ; parse itml data) ; if ((testing fc 8) ( local βdυmp_out; trav*rs«_tr**f\fcdump_teκt) ; for (βdump.out) (
Ul print DEBUO "(_\n" :
00 ) return 1; undef βdump.out;
It Kus*_short) ( traverse_tree(\fcdump_text) ; ay (Index- 0; for lβdump_outl I
**(lndex; last if /-DAILY(/;
)
(out* (duap.out[(index*l] if ((index < (tdump.out) ; ) elsif l(use_dlrect) ( tr*vers*.tree( sub ( unless (ref (_[0)) (
If K_(0] — /kelll\s*fox/i) ! push βduap.out, (.!3]->address{) ; print DEBUO (_!31->addrβss() . : (.101 \n" ;
) )
1) ), 0))
(out* (tree->addrβss((dump_out[0] . " (out — tr/\04l-U76/ /cs: (out — s/-\s*|\s*(//g; > *ls* ( βdata. split Λn/, (data; tor (βdata) ( tr/\041-M76/ /cs; s/*\s*|\s*(//g;
7/28/00
hln
• ! /usr/local/bin/perl • Disable cache for now. (12??98/rhk)
• KEADLINE-JOD •(parameters ■ ":
• ((res, (data) > chβck_cachβ((ID,(parameters, 900); iiiiiiiii.iitiiiiit.ttiiitiii. tititmi. imimi. iimtitt. tmi •if((res — 0) {
(counter* 0;
• (Id: hln.v 1.1 1999/11/20 08:38:26 vcom Exp ( • •Retry up to 3 times
• NAME: HEADLINE_IOD (mex cetry 3;
• MODULE: wgate/airadiga while ((counter <- (max_retry) (
• PROJECT: roamόniine/airadigm ((err, (errstr, tOUT) » w3grab(", 'GET', (URL . (QUERY): f PURPOSE: Perlscript for extracting headline news from if((err •• 0) {
• Infospace.com. if ((OUT! 'HTTP.res*) —a/302/) {
• USAGE: Used la conjunction ith wgate module of • Redirected
• RoamOnline for λiradigm. (data » (OUTC'HTTP.header'))
• SYNOPSIS: N/λ if ((data) (
• HISTORY: 1999-11-15 jbz: Modified (data — m/-Location: (.*)/l)
• RELEASE: N/λ if (defined (1) (
• LOO: Appended at the end of the file. if ((debug) ( print (debug "Redirecting to (l.\n";l • (URL" (1;
• !C1 1999 Lava Cceenmlcations . λll rights reserved. (QUERY" "";. t **(counter> tiiiitttititiiitiitiiiiimititttiiiimimtitimiimiiiitiiit next; ay ((ID. (URL, (QUERY, (cmd, (args, (debug_str, (res,
(data, (err, (errstr) ; ) local (debug; (data * (OUT! 'HTTP,body'); local (testing; • cache_cr*ate((ID, (data); ) else (
(ID* 'HEADLINE*; if ((debug) ( print (debug '(err: (errstr\n';) ) ay ((aaxjr-u.length, (aax_segments, (user, (query.type); last; )
((cmd. βargsl" βλRCV; •)
• λ*tri*v* RoamOnline Parameters θlines * getlines(strip_spaces(htmlstrip((data))) ;
• trojparams * get_account((ENV( 'wGate_PN0' ) ,(cmd) ;
Ul (query.type"*tosnws' : if ((debug) ( print (debug joinC", βlines); print (debug *\n* *\n*
(aax_sas_length- 159; (aax_x*gaents« 3: • Format Result if ((dines —I) ! t Check for Debug Flag print STDERR *(ID; Sorry, headline news is unavailable at the moment."; (debug*tr" *-d|—debug'; ) else (
• βarticles- Oi if KargslO) — a/-(Sdebug_str)(/l ) ! tcetegories"!))
(debug" \'STDERR; (index" 1: shift θargs; (key ••; ) els* {
(debug- 0; foreach (line (βlines) { ) chomp (line; (line — s/\s+/ /g;
If KENVI'wGate_SRC') — /-9ll(/l ( (line — s/-\s+|\s*(//g;
(testing* 1; • if ((debug fcfc (line) ( print (debug *(line\n';) ) els* ( if ((line) .( und*f (testing; If ((Index »« 1) ( 1 (key* (line; ) elsif ((index » 2) (
If ((debug) ( print (debug 'βλRGVΛn'i) if ((key) { if (exists (categories{(key)) ( t Generic Headline News page at Infospace push β!(categorle*((ksy)}, (line;
(URL ■ 'http://feeds.infospaca.com/_l_4PGBTZK02UR4GF2_gxggxggx21_tos.lava/stat2tbl7otKpl-/inews/ne ) else i ws-cat.htalfcsin"kevnews/news.frt.hlfcqcat"lfclimlt"l'; my βarticles" 0; push βarticle, (line; if ((debug) { print (debug '(URL\n';l (categorlesKkey)" \θartlcle;
)
• Grab Internet Content ) w3grab_inlt<>; ) elsif ((index -• 3) ( (index" 0; sub reaove-margln ( (key- ••; ay (line" shift: )
(lln* — s/*\s*//g; din* — s/\s*(//g; (index**; return (line; ) ) )
7/28/00
(data. 'News:-; (index- 0; θkays- keys tcategories;
(nua* int(rand scalar βkeys);
(k*y "Top Stories"; print (debug "\n(key\n"; foreach (art (β((categories((key) ) ) 1
++(ind«x;
If Klndex > 3). t last;)
(line- "(art") print (debug "»»(llne««\n"; push βdats, "(line';
)
• S*nd Inforaatlon
(index* scalar βdata; foreach {reverse βdata) t
If ((index > (aax_segmants) { (index--; next; )
(data* -News: (index) (_.';
(data* substrKdata, 0, (max_sms_length) ;
(data — s/-\s*| \s*(//g;
If ((testing) (
(ENV{ *wGate_PNO* ) — s/-\d/9/; )
-send-asg((EHV('wQate_PNO'), (data); If ((debug) ( print (debug lengthl(data) . *\n*;) (lnd«x—; )
) exit(O);
.1;
ON ©
number>");
a/(alrline_code/io) (
code.*;
, tform);
; please try again later.
Figure imgf000062_0001
print "(cmd: (airline (fllβht-(status " ,
7/28/00
S -
> <-> •DIR
SID • 'DIR';
(probl m * 0; »w3grab_init()) If((problem) ( [(res, (data) > csche_get((ID, 900)) s*nd_inf(SENVt 'wG*te_PN0' 1 , ifKres •• 0) (
'DIE; Sorry this service is currently unavailable"); I ((err, (errstr, tour) " W3grab(*', •GET', (URL); exitll) ; * if ((err ■* 0) (
# (data » SOUTl'HTTP.body'); cacb*_creete((ID, (data);
•(HOST * "aovles-online.com.sg"; (SQLDIR»'/opt/pgsql/bin" ;
•βlines - getliπe«(*trip_*paces(btmlstrip((data)));
KEXE, βREC) • βλRGVl βlinea • getlines(»trlp_spac*»<(data) ) )
(person « "ΘREC"; tprint(join("\n", βlines))) lf( (person eq "I { •βx ■ lookup_lines('Select a movie", 1, βlines); s*nd_inf{(ENV{'wOat*_PNO' ) , «(P • (xlOl+ ;
DIE: Picas* specify a number or a name [βREC].'); (P - 0; exitll); while 11) { ) βy • split_fields ((lines [(PJ); •else ( if((y[l) *q "') ( last; )
• uc(ΘRXC)) (DIR . (y[l) ;
• a*od-inf((ENV(*wGate_PNO'), (DIR — sAs*/ /g; t 'DIR: number or name: {(person) .") ; pushlβDIR, (DIR);
• exitll); (P++;
• ) )
orm"
Figure imgf000064_0001
7/28/00
•(P • (Xl0]*3;
•print! -WATCH - •);
•wh ledl (
• βy > spllt_flelds((llnes[(P]);
• ifKyll] eq "I ( lest; 1
• prlntl'(rev((y[lj), •);
• (P**)
• whiieiii (
• βy ■ spllt.flelds Klines !(P] I;
• if((y(l) I- /-\s'[0-9\:J*\s'(/) I last; )
• (P**l
• )
• (P ♦- 3;
• )
cur t««l|||#| . |ll«|l««« . ll«l l *N#l . « ll#l « ll# . l»I .IUI*.# . N#**H##IV . «#I .V GKD •*> Gambia Dalasi' , ♦ GRD *> Greek Drachm ' ,
I SIdi cur,v 1.3 2000/02/29 03 : 33 : 15 rhk Exp S 'HKD Hong Kong Dollar', ♦ HR Croatian Kuna' , HAKE: CUR •HUF *> Hungarian Forin ' ,
♦ VOOtΛΛt wgate •XDR •»> Indonesian Rupiah*, I PROJECT: roamonline (rel. 2.2) *IEP Irish Punt',
♦ PURPOSE: Perlscript for converting international currencies. 'ILS Israeli Shekel',
♦ USAGE: Used in conjunction with wgate IOD module of 'INR Indian Rupee' , ♦ RoamOnline. •ISK *> Iceland Xrona' ,
♦ SYNOPSISi N/A 'ITL *» Italian Lira', ♦ 'JOD »»> Jordanian Dinar' ,
•JPY Japanese Yen' , 1999-xx-xx rhk: Created for '99 CTIA/wireless demo. 'KES •» Kenyan Shillin ' , ♦ 'KRW Korean Won' ,
I KELXASE. N/λ 'KWD Kuwaiti Dinar', I LOO: Appended at the end of the file. 'KZT *> Kazakhstan Tengβ', ♦ LBP *> Lebanese Pound' ,
■ (C) 1991, 1999 Lava Communications, λll rights reserved. *LKR Sri Lanka Rupee' , I •LSL »> Lesotho Loti' , tH!iHiiHiιιιiHHHtHtι HMHiHH ι »ι ι - **ι 'LTL «> Lithuanian Lite',
'LVL •» Latvian Let' , my Surl* 'httpi/Zquot*.yahoo.con/mS' : 'MAD Moroccan Dirham' , my $id* 'CW*/ 'KRO Mauritania Ouguiya*, my Spn* S-DtVf'wGate-.PNO' ); 'MTL •> Maltese Lira',
•KUR *> Mauritius ftupe*',
•KWK »> Malawi Kwacna' ,
'MXN *> Mexican Peso* ,
•HYR *> Malaysian Ringgif,
*MZH •> Mozambique Metϊcal',
'HAD «> Namibia Dollar',
NGN *> Nigerian Kair*',
Figure imgf000066_0001
•NLO Dutch Guilder' ,
•NOK *> Norwegian Krone', local ioptions; 'NZD New Zealand Dollar', G*tCptions(\toptions, <debug|d*, *test| testing| t:i") ; 'OMR »> Oman Rial', ' ι my $d«bug* exists Soptione{ 'debug' )j 'PEN Peruvian New Sol' ,
■y Stesting- (exists SoptionsC test' ))? ( $options( ' test' ) 11 1 ): 'PHP Philippines Peso' ,
•FLN Polish Zloty , local 'DEBUG* Sdebug? \*STDERR: N'DEBUG; »PTE *> Portuguese Escudo' , local 'STDOUτ* (Stesting fc 1)7 \«DEBUG: \'STD0UT; *PYG •> Paraguay Guarani' ,
'QλR «> Oatari Rial',
I currency lookup table •ROL Romainien Leu' , my %currency_cod*s* 'RUB •> Russian Ruble' ,
SAR Saudi Arabian Riyal' ,
'United λrab Emirates Dirham' •SEK *> Swedish Krona' ,
•Argentinian Peso', 'SCO Singapore Dollar',
'Austrian Schilling', SIT Slovenian Tolar* ,
'Australian Dollar*, 'SKX Slovakian Koruna' ,
Bangladesh Taka', 'SYP *> Syria Pound* ,
'Belgian Franc', •SZL »*> Swaziland Lilangeni*,
'Bulgarian Lev', •THB *> Thai Baht*,
'Bahrain! Dinar' , 'TND *> Tunisian Dinar' ,
' urundi Franc' , •TRL «> Turkish Lira' ,
•Brazilian Real' , 'TWO Taiwan New Dollar',
'Botswana Pula', 'TZS Tanzanian Shilling',
'Canadian Dollar', •UAH Ukraine Hryvnia' ,
'Swiss Franc' , 'UGX Uganda Schilling* ,
'Chilean Peso', 'USD US Dollar',
'Colombian Peso', •UYP Uruguay New Peso' ,
•Cypriot Pound' , 'VEB Venesualan Boliva ' ,
'Cxech Koruna', 'VND •> Vietnam Dong* ,
'German Mark' , 'XAF *> Central Africa Cfa Franc
'Danish Krone', •XAO *> Silver Ounces' ,
'Algerian Dinar', •XAU Gold Ounces' ,
'Ecuadorian Sucre', 'XPD *> Palladium Ounce' ,
'European Currency Unit', •XPT *> Platinum Ounces',
'Estonian Kroon', •ZAR South African Rand' ,
'Egyptian Pound', 'ZMK Zambia Kwacha',
'Spanish Peseta' , 'ZWD »> Zimbabwean Dollar'
•Finnish Karkka',
'French Franc' ,
'British Pound' , my ((cad, βargs) " βλROV;
'Ghanaian Cedi ' , my ((query, (uri, (cache-Jςey) ;
7/38/00
ay {(cache, (date, θdata, (out) ; • No caching since it's unlikely to have same requests ay ((err, (errstr, tout) ; » ((cache, (data) - cecbe_g*t((cache_key, 3600) unless ((testing fc 2); ay ((from, (from_lebel, (to, (to_label, (amount) ; if (0) ( if tSlargs > 0 fcfc (largs <" 2) { my (ua. new LWP: :Userλgent; (from, shift βargs; my (req. new HTTP; :Request('GET* -> (uri) ; (amount, shift βargs; (to* shift βargs; (res* (ua->request!(req) ; print DEBUO 'STAGE 1 : <(from><(amount><(to>\n" ; if!(res->is_success()) ( (data * (reβ->content() ; if t l definedl(to) fcfc (from — /- [\dV . ) +(/l { (to* (amount) ) else ( (aaount* (froa) • HTTP Error. ) print DEBUG (res->as_string{)) print DEBUG "STAGE 2 : <(from><(amountx(to>\n" ; βend_inf((pno, '(cmd: Cannot process your request at this time.
'Please, try again later.");
(from | | * 'USD' ; return 0; (to | | * 'USD' ; ) print DEBUG "STAGE 3 : <Sfrom><(amountx(to>\n" ; if (I(cache) (
If ((froa eq (to) ( my (counter* 0; send_err( (pno, "(cmd: Invalid Parameter. Please try again."); my (aax_x*try 3; return 1; while ((counter** <• ( ax-retry) {
) ((err, (errstr, tout) *w3grab(", 'GET', (uri);
)
t at this time.
Figure imgf000067_0001
) else ( If ((testing fc 8) ( local βdump.out; send_err{ (pno, "(cmd: Usage: (cmd [<from_currency>] traverse_tree(\fcdump.text) ;
. "<aaount> <to_curr*ncy>" ) ; for (βdump_out) t return 1: print DEBUG "(_\n"; ) return 1;
(query. "a.(amountfce>(fromfct.(to" ; (uri. uri_βscape ( "(url?(query" ) ; (cachejcey (Id . " . " . md5_base64 Kuril : undef βdump.out; traverse.tree(\fcdump.text) ; print DEBUO "URI: (url\n"; print DEBUG "CACHE <(cache_key>\n" ; my (index; for (θdump.out) {
last if /-aymbol(/i; if ((index < (Idump.out) (
(out* "(dump.out[(lndex*4] (from_label - (dump_out[(index+71 (to_label ---
. "t Exchang* Rate: (dump_out[(lndex*6) (to per 1 (from )*;
) if ((out) ( print('(cad: (out'l;
• Mo caching since it ' s unlikely to have same requests
• cscbe_cr*ate Kcache_key, (out{ 'HTTP. body ) ) t unless ((cache 1 1 (testing fc 4) ;
) «lse ( s*nd_err((pno, "(cmd: Cannot convert the currency. . 'Please, try again."); I
I;
ON
7/28/00
cfb
• CF8.I0D 'Louisiana-monroe' *> 'Louisiana-Honroβ' , 'Alabama-birminghaa* "> 'Alabama-Birmingham' , iiiiitiii.itmitii.mimit .tiimm.iimtm .imiim.mil 'Florida λfcm' "> 'Florida λ*M', 'Tenessee-chattanooga' ■> 'Tenessee-Chattanooga' ,
• (Id: cfb.v 1.1 1999/11/20 08:38:21 vco Exp ( 'Manama λfcm' •> 'Alabama AfcM' , • ' ouisiana-latayotte' » 'Louisiana-Lafayette',
• NAME: CFB_IOD Cal Poly-s o* "> 'Cal Poly-SLO'l;
• MODULE: wgate/airadigm
• PROJECT: roaapnllne/siradlgm •Translate user Entry to Recognized Teaa
• PURPOSE: Perlscrlpt for extracting headline news. •For college ENTRY always considered found (Too Many Teams)
• USAGE: Used In conjunction with wgate module of (found " 1; • RoamOnline for λlradlgm. foraacb (key (sort keys tncaataamsl (
• SYNOPSIS: N/λ (val • (ncaateamsKkey);
• HISTORY: 1999-11-15 jbz: Created if ((key- /(team/l |] (val— /(team/i) (
• RELEASE: N/λ (team" (val;
• LOO: λppended at the end of the file. (teamalt" (key; • • (found « l;
• (C) 1998, 1999 Lave Communications. All rights reserved. last;
) y ( cad, (found, (debug, (team) ; (ID • (ENVt'w3ate_MSG')ι ((cmd. Bergs) * βλROV; • Grab Internet Content w3grab_lnltt) ;
• Ketriw* XoamOnlin* Parameters •(parameter* « ";
• tro_params * get_eccount ((ENV( 'wGate.PNO' ) , (cmd) ; •((res, (data) • check_cache((ID,(parameters, 900); •IfKres >• 0) I
• Check for Debug Flag ((err, (erretr, tOUT) » w3grab(", 'GET', (URL);
If ((ergslOl — m/-\-d(/i) I ifKerr •• 0) {
(debug- V'STDERR; (data » (0UT( 'HTTP.body' ); shlftβargs; • cache.create((ID, (data); ) else ( )
(debug* 0; ») ) βllnes • getllnes(strlp_spaces(hta*lstrip((data)));
ON • Check If Date Supplied for historical lookup 00 t Assignment of appropriate URL if ((debug) (
(detail*' 1; print (debug join! <", βllnes); if !(args[01) ( print (debug *Index-> (index \n "; if ((cad— /-ncaa|-cfb/i) { print (debug "Arg-> (team";
(URL* "http://cbs.sportsline.com/u/sportstlcker/scoreboard/ncaafsbd.htm"; )
) else ( print 'Sport does not exist!'; • Look for occurence of specified team in Returned Content exit; • And Format Result if ((found •• 11 ( ) els )e ( βsportlookup > lookup_lines((team,1,βlines) ; print 'More information is needed. (Index ■ (sportlookup[0) ; exit) if (I(index) { ) βsportlookup " lookup_lines{(team,0,βllnes) ;
(Index " (sportlookup[0); case )
If ( Klndex) ( βsportlookup > lookup-Λines((teamalt,I,βlines) ;
(index ■ (sportiookuplO);
Figure imgf000069_0001
) if {!(index) ( ι Teams Entry Conversion Table θsportlookup " lookup- lnes((teamalt,0,(lines) ; ncaateaas* ( (index ■ (sportiookuplO);
'Ucle' «> 'UCLA', )
Use' "> 'Southern California' , if ((index) (
vai' •> 'VMI', (sporttest" (lines[(index*101;
'Texas-el Paso' ■> 'Texas-El Paso', (sporttest— sAs|\|//g;
'North Carolina λfc ' » 'North Carolina AfcT', if ((sporttest— /-\w/l {
'Mcneese State' .> 'McNeese State' , (index" (index - 14f
'Lenoir-rhyne' .> 'Lenolr-Rhyne' , )
Miaa! (oh) • -> 'Miami (OK) • , (sportteaml" (lines[(index] ;
'Bβthune-cookaan * *> 'Bethune-Cookman' , (sportscorel" (lines[(lndex+4) ; . 'Jacksonville (fl) ' -> 'Jacksonville (FD ' , (sportteaml"- s/\|//g;
' St. Francis (pa) ' » ' St. Francis IPλ) ' , (sportscorel"- s/\|//g;
'T«n**s**-aartln' ■> 'Tenessee-Martln' , (βporttβam2- (lines[(index+141 ;
'UnlV » 'UNLV , (sportscore2« (linesϊ(index*18]:
'Texas λfca' *> 'Texas AfcM', (sportteam2— s/\|//g;
'Cal State-northrldge' "> 'Cal State-Northrldge' (sportscore2— s/\|//g;
I if ( I (sportscorel) (
(sporttime" dines[(index*8] ; (sporttime— *A|//g:
' ' print *(cad: (sportteaml (sportscorel - (sportteam2 (sportscoro2 (sporttime";
) •!»• ( print "(cad: Your team is not scheduled to play today or invalid entry.";
) els* 1 print "(cad: T*aa not found. Please try again.';
) exi (01; I;
ON
-4
©
Figure imgf000071_0001
7/28/00
Figure imgf000072_0001
print *(cad; (sportteaml (sportscorel - (sportteam2 (sportβcore2 (sporttime"; ) else ( print "(cmd: Your team Is not scheduled to play today or invalid entry."; ) ) el** ( print "(cad; Teaa not found. Please try again.', -4 )
1-1 exitlO); 1)
• LOT tiiiiiiii. •tiiiiiit.ttttiiitt.ttttititi.titiiitti.tttttiitt. mil
• ' (Id; cal.v 1.1 1999/04/15 18:02:09 vcom Exp (
• NAME: LOT
• MODULE: wgate
• PROJECT; roamønline(rol)
• PURPOSE: Perlscrlpt for extracting lottery results.
• U5ACE: Used in conjunction with wgate module of t RoamOnline.
• SYNOPSIS: N/λ
• HISTORY: Created by rhk for '99 CTIA/Wireless demo.
• RELEASE: N/λ
• LOG: Appended at the end of the file. •
• (C) 1998, 1999 Lava Communications. All rights reserved. • titiiiitiiiiiiitittiiiitmiimittimmtmiiiittitmtmiitt
((cad. βargs I • βλRGV!
(argsCOI — a/-(\d*) (/; (entry* (args[0) i if ((entry eq •") ( print { 'usage : (cad mm-dd. Please try again. ' ) ; exitll) i )
•print 'entry: (entry\n* ;
~-4 opendN, 'Java -classpath /) ome/fpl/datadirθCt/sequelink/clas<)esll :home/fpi/datadlrect/sequellnk/jd Is) bctes/classesi /home/fpl/src/java: LotusCal (entry| * ) | | die; while (<IK» ( print "(_\B";
) close (IN) ; l;
wmai -00
-4
Ul
Figure imgf000074_0001
Figure imgf000075_0001
Figure imgf000076_0001
ay (pnode* shift: ) ay (pindex. shift; 1 ay (text; ) else ( push βnodes, ((cachedjparent? if (ret (node) ( (cached-parent: (_[0J ) ; if ( I (order) ( return 0;
(text* (node->endtag { ) . (Snode->implicit(i ? ' " ' : " ) ; ) ) else ( )
(text" '< . (node->tag() . •> . ((node->impliclt()? ) if Kparent_tag fcfc (_[0)->tag() eq "\L(parent_tag") ( if !(parent_content) {
(text ." ' ( * . (nodβ->addresβ ( ) ") '; foreach (β((_10]->content() )) ( ) *ls* { unless (ref (_} (
(text" HTML: : Entitles: :decode_enti ties ((node) ; it ((_ •- a/(parent_content/ ) ( (text — trA041-U76/ /cs; (cachedjparent* (.[1)7 S_[0] ; undef; (text — s/-\s»| \s*(//g; ) ) pusbfβdump_out, x (depth . (text) if ((text ne ) else (
(cachedjparent* (.111? (.10): undef; 1; )
) ) 1 sub get_content I; ( ), I); ay (nod** shift or return; ay (contents* (nod*->content { ) ; return Nβnodes; ay βdata; for (β(eontents) ! unless Iref (.1 ( sub set_iod tr/\041-\176/ /cs; s/-\s*| \s*(//g; my (key* shift or return; push! βdata, HTML: :Entities: :decode_entities((_) 1 if ((_ ne " ) ; my (val* shift) ) ) (ENVC\UIOD_(key"). (val; I; return Sβdata; )
) I; sub prun*_tr*«
( ay ((arg, (ref, (node, (tag, (content, (parent.tag, (parent.content) ;
(arg* shift; (ref* ref (arg; if ((ref eq 'HTML: :TreoBullder' | | (ref eq 'HTML: :Element' ) (
(node, (arg:
(tag. shift)
) els* (
(nod** (tree;
(tag* (arg;
)
(content* shift; (per*nt_t*g- ahift; (parenf^content* shift; und*f βdυap.out; local (cached-parent; local (nodes ;
(nod*->trav*rs*! sub 1 if (r*f .[Oil I if K_l0)->tag() eq "\LStag") { it ((content) 1 foreach lβl(_10]->contentl) 1) ( unless (ref (.) ( if ((_ — m/(content/) ( push θnodes, {(cachedjparent?
(cachedjparent: (_[0]1; return 0; )
wmail-send
-4 -4
Figure imgf000078_0001
7/28/00
78 wmail-userdb sub user_quβry ) elsif (Sr 0) (
( return 1; my (Spfx. Scmd, Spno, Smsgtype, βargl) * 9--.; return fcHuser--.query($cmd, Spno, Smsgtype, βargl) ; ϊ sub wus*r--.query sub usβr_cmd_add
( ( my ($cmd, Spno, Smsgtype, βargl) * »_; return 1; if(Scmd eq 'query') ( return fcuservcmd_query(Spno, Smsgtype); ) , if($cmd eq 'dec') { return fcusβr--.cad_dac($pno, Smsgtype) j } if($cmd eq 'list') ( return fcuser_c»d_lis (Spno) ; ) if(Scmd eq 'add') ( return fcuser_cmdwadd($pno, Smsgtype, βargl); ) if(Scmd eq 'service') { return fcuser_service„query(Spno, Smsgcyp*) / ) return; sub usβr_sβrvice_query ( sy ( no. Save) * »_ if (lc(SENV('wGate_APP')) eq 'wgsim') ( return 1;) my $r* qscH»ervice_-,is_registered{ Spno, Sav ) i return Sr;
)
Figure imgf000080_0001
sub user--.c dvquery
( my (Spno, Save) * β_; my ($m**t*r_quotaf $*jervice_quota) ; if (lc(SENVCwCate^APP' ) ) eq 'wgsim' ) ( return 1 ; )
$master-_quota* qsc_ astervquota--jreached(Spno) ; $servicewquota* qscwservice_quota--reached($pno, $svc) ; if (ldefined(Snaater---quota) 11 !defined(Sservice--.quota) ) (
♦ Unknown user. returnr
) elsif ($master_quota « 0 fcfc $*ervice_quota ** 0) (
I Both quotas not reached. return 1;
) elsif ($maater_quo a ■* 2 j j $servicβ__quota ** 2) (
• Over th* quota, return -it
) elsif ($m*βter_ 3uo a ** 1 1 1 $service_quo a »» 1) (
I Just reached th* quota. return 0;
)
I Error. return; sub user_cmd dec ( my (Spno, Sav ) ■ β„; β Sr* q«c--,d*crem*r.t^ ervice--.quota_usage ( Spno, $svc) i if (Sr < 0} ( return;
' dbgeneral dbgeneral
• I /usr/local/bin/perl my (sql. shift or return; local 'IN; use Math::Bigtnt; my (delimeter. q("-- RECORD) ; my (rec'O ;
(Prefix. •!'; my (flag.O;
(Expiry ' ' ; ay (hash-array- 0 ;
(Deao* *>11 15550000001'; opendN, qqKPsql (PsqlOpts -d (PsqlDB „-e "(sql" | } l ; ay (PsqlBin* '/usr/Λocal/pgsql/bln' ; while (<IN>) { my (Pso.1" "(PsqlBln/psql*; my ((key, (val) ; ay (PsqlDB" 'dbgenerel'; chomp; ay (PsqlOpt*. '-λ -t -x'; if lm/(dellmeter/) ( ay βhash-arrey; CONFIDENTIAL (tl*g« 1; sub cheelc-cookle if (t(r*c) { ( push βhash-arrey, (ree; ay (query shift or return; (rec" (); ay (no-redirect" shift I I 0; if Kquery->psraa(R Us*r) eq (Demo) { return (1, (Demo, undef) ; )
) if ((flag) (
((key, (val) * split '\»'\|\s*\ (_, 2; ay cid, (pno, (timestamp) . split /:/, (query- cookie( 'ROINFO' ) , 3; grep »/'\s*|\s*(//g, (key, (val; ay (cur.tlae. time; if ((key fcfc (val) ay Sdlff" 0; {
(Expiry — /(\d*)/; (rec->((key)" (vel; ay (expire*" (1 II 1440; ) unless Kcid fcfc (pno) { if ((no_redirect) ( return; if (t(rec) p)rint (query- ^redirect! 'http://airadigm.roamonline.net/lndex.shtml7op.reset' ) ; push θhesh_array, (rec; exit) undef (rec;
00
© )
((id) ;
Figure imgf000081_0001
ay ((Id. (pno, (timestamp) . split /:/, (query-»cookle( 'ROINFO' ) , 3; sub get_info.id ay (cur.tia*. tim*; ( ay Miff. 0 l •diffjalnutes ((timestamp) | | 0; my (Id* shift or return;
(Expiry — /(\d»)/ι my (ret; ay (expires. (1 I I 1440; (undef, (ret, undef)* get_info_by_id((id) ) unless {defined (ret) (return) } ay (cookie. (query->cookie (-name->*ROINFO' , -value->'(id:(pno:(cur.tlme" , -explres->*(Expiry* l return (ret) return ((id, (pno, (cookie); sub get_info_password ! my (id* shift or return; sub diff-minutes my (ret; ( (undef, undef, (ret)" get_info_by_id((id) ; my (previous.time* shift or return; unless (defined (ret) (return; ) my (elapsed" time - (previous_time; return (ret; ay (ain* int ((elapsed / 60) ; return ((ain) ; sub getjpessword ( sub exec_sql ay (id" »hift or return, my (ret;
" '(bit*
- '(Id*
- '(id1
Figure imgf000082_0001
7/28/00
dbgeneral dbgeneral
■ '(id'
Figure imgf000083_0001
7/28/00
dbgeneral dbgeneral push(!βhoro,(ret->(0]lslgn_horo)) ; unless (defined (ret) (return; ) return θboro: if Kcaller — '3' ) ( return !(ret->[0) ϊ«portjjitmask) ) ;
) sub gβt_ecct_horoscopetlme_by_id if Kret->[0] (sport_bi*-mask) -• 0) (
! return 0; ay (id" shift or return; > ay θhoro ■ I) ; . (bit • 1; ay (sql" "select tlae_horoscope from acct_horoscope_time where eccount.id " '(id' ; '; while ((bit <« (ret->[0) (sport_bitmaak) ) { ay (ret« execsql Ksql) ; • print (bit) unless (defined (ret) (return; ) If ((b t fc (ret->lO) (sport_bitmask)l ( return !(ret->[0] |time_horoscope) ) ; ay (sql* 'select sportjum* froa sport_d.se where sport_id ■ '(bit' my (ret" execsqlKsql) ; push (βsport, (ret->[01 {sport _naae)) ) ) sub get_*cet_headllnenewstime_by.ld (bit » (bit • 3;
( > ay- (id* shift or return; return βsport; ay (sql* 'select tlme_headllne from acct_headlinenews_time where account.id * '(id* ) " ay (ret* ex*c_sql((sql) ; ) unless (defined (ret) (return; ) sub get_sportid_by_desc return Sret->[0] (time_headline) ; ( my (aport_d*sc ■ shift or return; ay (sql" 'select sport_ld from *port_d*sc wh*r* sport_name like ' (sport_desc ' ay (ret" execsqlKsql) ; sub get_ cct_heedlinenews.by.id return (r*t->[0] (sport_ld) ; ay (id* shift or return; ay (caller * shift or return; ay βheadline • 11 ; sub gectoaj-ic) by_deec ay (topic » 0 ) ( ay (sql* 'select num_of_headlines, topic_bitmask from acct_headlinenews_topics where account_id ay (sport-desc ■ shift or return; Kid' ) ') ay (teaa desc " shift or return; ay (ret* execsql sql) ; ay (sport_id " get_jtportid_by.dβsc((sport_dβsc) ; unless (defined (ret) (return; ) ay (sql" "sel«et t*aat-ld from sport.team.desc where team.desc like '(team.desc' an
00 Ul push {βheadline, (ret-> [0] (num_of_heedllnes) ) ; '(sport_id* ; * ; if ((caller »* '2' ) { ay (ret" exec_sql ((sql) : return Kr*t->(0] (topicbltmask) ) ; retum->[0] (team_id) ; ) )
If Kret->[01 (toplc_bitmask) — 0) I return 0; sub get_acct_sportteam_by_id ) ( my βteamji " 0 ; ay (bit • 1; ay (Id - shift or return; while Kbit <- (ret-> lOJ !toplc_bltmaskl ) ( my (sport.desc ■ shift return;
• print (bit; my (sport.ld " get_sportld_by.desc((*port_desc) ; it Kbit fc (ret->[0]ltoplc_bltmask)) ( my (sql" "s*l*ct count (*) from ecct-Aport_teem where account.id - (id' and sport-Λd * '(sport ay (sql* "select toplc.dβsc from headlinenews.topic.desc where topic.id - (bit' ; " ; -id' ; '; ay (r*t* *x*c_*ql((sql) ι ay (count" execsql sql) ; push (βtopic, (r*t->[0] |topic_desc) l ; if !(oount->[0) (count) •» 0) ( ) return .0)
(bit (bit • 2; ) ) else ! push (βheadline, βtopic) ; ay (sql* "select access_number,+;eaa_ld froa acct_sport_team where account_id * '(id' and sport return βheadline; _id * ' $sport-J,d* order by access_nuaber; ; my (ret* *xec_sql((sql) ) unless (defined (ret) (return;) for ((1 * 0;(1 < (count->[0](count);(l++)- ( sub get.topicld-by.desc push (βteamjn,(ret»l(l]{teaι_id});
( ) ay (toplc_d*sc » shift or return; ) ay (sql* 'select toplc.id from headlinenews.toplc.desc where topic.desc like (topic.desc* ; • return βteamji; ay (r*t* execsql sql) ; return (r*t-»!01 (topicid) ;
) sub get.ecct.team_by_id sub get_acct_sport_by_ld (
( ay βsport • (! ; ay (Id- shift or return; my βtotal.team « () ; ay (caller . shift or return; my βt*aa • () ; ay (sport • (1 ; my (id " shift or return; ay (sql* 'select sport_bitmask from reg_acct.sport where account_id * ' (id' ; " ; βsport ■ gβt_acct_sport_by.ld((ld, '!'); ay (ret- exee_sql((sql) ; (total-tport • βsport)
dbgeneral dbgeneral for j * 0; (j < (totel_sport; (j++) ( my (ret" exec.sql ((aql) ; βteam • get_*cct_*portteam_by_idl(id, (sport[(j] ) ; return Kret->[01 (address_id) ) ; push (βtotal_team,(sport[(j) ) ; ) push (βtotal_team, βteam) :
) sub get_email ιotlflcatlonld_by.dese return βtotal.team; ( my (notification • shift or return; my (sql* 'select notlflcation_ d from *mall_notif-cation_desc where notification_desc Ilk* (n otlficatlon' i ": sub get_ecct_em*il_profile_by_id my (ret* ex*c_*qll sql) ; ( return !(ret->[0) (notif ieatlon_ld) ) ] ay (id « shift or return; ) ay βeajproflie • () ; ay (sql" 'select addreβs.id,notlfleatlon_ld,message_len_ld from acct_emall_proflle where accou sub get_eι-ail-paessageid-by.desc nt_ld • *(ld';'; ay (ret* ex*c_sql((sql) ; my (message * shift or return: pushlβesλjprof 11*, (r*t-> [0] (address.id) ) ; my (sql* 'select aes*sgβ.len-Ad from emall-message.len.desc where message_len_desc " (eeisage pusblβea prof lie, (ret-> !0) (notif ication_id) ) ; I pushlβea prof 11*, (ret-» 10) !message_len_id) ) ; my (ret" exec_sql!(sql) ; return βea profile; return !(ret->[0] (m*ssage_len_id)) ; ) ) sub get.acct.emall_advfllter_profiie py_id sub get_ecct_email.address_by_id ( ! my (id * shift or r«turn) ay (Id * shift or return; ay βemjprofile - 0 ; ay βem_prof lie . ( ) ; ay (sql* "select message_Λlmit,st*rttiael,endtlmβl,starttiaβ3,endtime2 from acct_email_advfilt ay (sql* 'select count!*) from aeet.email.address where account_id . ' (id' ; * ; erjprof lie where account_ld " ' (Id* ; " : my (cnt* execsqM(sql) : my (ret" exec_sql((sql) ) if (Scnt-> (01 (count) «- OK push(βeet_protlle,(ret->[0) (aessage_llmlt) 1 1 return 0; push{βee_proflle.(ret->(0] {starttiael)) (
) push(βea_profil*,(r*t->[0] (endtimel) ) ; pusb{βea_profile,(ret->[0] (starttime2)> , ay (sqll. "select access ιumber,long.email,short_email from acct.email_address where account_l pushlβea_profil*,(r*t->[0) (endtla*3)) ; d « '(Id* order by access-number; 'i return βem profll*) ay (ret- execsqlKsqlll ; ) for K1"0;(1 < (cnt->[0J (count); (1.(1+1) ! push(β«m proflle, (ret->[(i) (long_emall) ) ; sub get_acct.email_friend-by_id pu*b{βea_profile,(ret-> [(i] (short_emaill ) ; (
) ay (id " shift or return; return βemjprofile; ay βfriendj* • (1 ; ) my (sql» 'select count!*) froa •cct_eaail_friend_list where account_ld » '(Id' ; * my (count" exec_sql((sql) ; sub get_*aail.addressdesc_by_id If Kcount->[0] (count) »■ 0) { 1 return 0; ay (address - shift or return; > ay (sql- 'select address.desc from email.address.desc where address_id > ' (address1 ; * ; else ( ay (ret- execsqlKsql) : my (sql* 'select access_number, friend_list from acct_email_friend_li»t where account_id * '(id return !(ret->(0] (eddress.desc) ) ; ' order by acce*s_number; '; ) ay (ret" exec^tqK(sql); unless (defined (ret) (return;) sub ge eaall_notlflcatlondeβc_by_id for Ki • 0;(i < (count->[0) (count) ;(i+*l { ( push !βfriend_»,(ret->[(l](friend-Λist))ι my (notification - shift or return; ) ay (sql- "select notif ication_dese from email.notificBtion.desc where notification.id - ' (notl ) fication' ;'; return βfrienc n; ay (ret- execsql Ksql) : ) return !(ret-> [0) |notification.desc) ) ; ) sub get_ecct_email_header_by_id sub get_email_message_esc_by_id ( ( my (id * shift or return; ay (aessage - shift or return; my βheader jl * ( ϊ ) ay (sql" 'select aessage_len_desc from email_message_len_desc where mes8age_len_id » '(message my (sql* "select count!*) from acet_eaail_header_list where accouncid " '(id' ; * ; ';'; my (count* execsqlKsql) ; ay (ret" execsqlKsql) ; If Kcount->[0J (count) •» 0) { return {(ret->[0] (aessage_len_dese) ) ; return 0;
) else t my (sql" "select ecceβs_number,header_list from acct_ema-l_headβr_list where account_id ■ "(id sub get_email_addressid_by_desc ' order by accesβ_numbβr; •; ( my (ret" execsqlKsql) ; ay (address " shift or return; unless {defined (ret) (return; ) ay (sql* "select address_id from ema.l_address_desc where address.desc like ' (address' for Ki " 0;(i < (count->lO) lcount) ;(l**l (
dbgeneral dbgeneral push (βheader_n,(rβt->[(i] [header_ st) | ; If ((Id •- 1) { ) return ( 'roamonline' 'roamonline' , 'ro' , 'roam' , ' roam' ) ; ) ) retum βheader_n; my (sql- "select street, street2,city,statβ_code, zip, country_name from address wher* address. ac count_id > (id; " ; » and name_li*t.sceount_id " (id; '; my (ret" execsqlKsql) : sub g*t-*ect.*aail.subject_by_id unless (defined (ret) (return: ) I ay (id ■ shift or return: return Kret->[0] (street), (ret->[0J (street2) , (ret-»[0) (city) , (ret->[0] (state.code), (ret->[ ay βsubject i " ( ϊ : OJ (zip) , (ret->[0) (country_name) ) ι ay (sql" 'select count!*) from acct_email_subjeet.list where account_ld " *(ld' ; " ; ay (count- execsqlKsql) ;
If Kcount->[0] (count) >- 0) ( retum 0; sub get_name_by_id
) t
•Is* ( ay (id> shift or return) ay (sqll- "select eccess_number,subject.list from acct_emaii.subject.list where account.id > ay (sql* 'select first_name,last_name from name_list where account.id > (Id; * (id' order by accββs_number; " ; my (ret" execsqlKsql)) ay (ret- execsql Ksqll) ; unless (defined (ret) (return; ) unless (defined (ret) (retum; } return !(ret->[0) (first_n*m*) , (ret->[0) !last_name) ) ; tor {(I » Old < (count-> [01 (count) ;(i**l { push (βsubject_». (ret->[(i] {subject_list) ) ;
)
) sub get_account-hy_mln return βsubject_n; ( ) ay (id* shift or return; ay (sql* "select eccount_ d froα account where user.id like ay (r*t* execsqlKsql); sub ge*i_lnfo_by_ld unless {defined (ret) (return;) I return (r*t->[0J (account.id); ay (id* shift or return; )
If Kid ** 1) ( sub get_alnjby.acct return ( 'roamonline' 'roemonlil ' , 'roamonline' ) ; ( ) ay (Id* shift or return;
00 ay (sql* "select user_id froa account where accounted " *(id';'; Ul ay (sql* 'select info_name, info.id, infojpassword from access, name_list * ay (ret* ex*c_sql((sqll) . 'wher* eccess. *ccount_ld * (Id and name_list.account_ld * (Id; * ; unless (defined (ret) (return)) ay (ret* execsqlKsql) ; retum (ret->[0J (user_ld); unless (defined (ret) (return; ) retum Kret->[0] {lnfo_name) , (ret->[0) (info_id) , (ret->[0) (infojpassword)) ; ) sub get_birthdate_by_id sub get_lnfo_by_id2 ( ay (id* shift or return; ( my (sql* 'select birthdat*,lastsccesβ from dates where account_id " (id;* ay (id* shift or return; my (ret* execsqlKsql): unless (d*fln*d (r*t) (r*tu ;) if ((id *• 1) ( return ((ret->[0) {blrthdate) , (ret->[0) (last.access) ) ; retum ( 'roaaonline' , 'roamonlil' , 'roamonline' ) ; ) ) sub ge status py_id my (sql" 'select info-name, lnfo_id, password, ew.usβr from access, name.list "; ( (sql " (sql. "where access.account_id ■ (id and name.list.account.id " (id;"; ay (id * shift or r«tura; ay (ret" execsqlKsql) ; ay (sql * *s*l*ct n«w_us*r from access where account_id - \'(id\' unless (defined (ret) (return, ) ay (ret « execsql((sql) ; unless (defined (ret) (return;) return Kret->(0] (into_name) , (ret->10] (infcid) , (ret->[0] (password) , (ret->[0] (new.user)l ; If ((ret»[0)(new_user) — a/-[tF]/)( ) return 1;
) sub get_id else ( ( retum 0; ay (pno> shift or return; ) ay (sql* "select account_id from account where user_name ' (pno ' ; * ; 1 ay (ret" execsql{(sql) ; unless (defined (retl (re urn, 1 sub get_acct_deily_package.ld retum (rβt->[0] laccount.idϊ; ( ay (Id " shift or return; my (sql- 'select dally_package_id from acct_dally_paekage where aocount_ld ' sub go t_addrβss Jpy.id my (ret- execsql((sql): ( retum ((ret-> [0] (dally_package_ld)I ; ay (id " shift or return;
dbgeneral dbgeneral sub gβt_acct.daily.quota_id sub get_d*faultservice.quota_)py_id
( ( ay (Id * shift or retum; my (id " shift or return;
Kret,(package_id) ■ get_acct_daily_quota_by.id((id) ; my (sql* "select default.quota from servlce.desc where servιce_id * '(id' ay (def pac.quota " get_daiiy package_quota((package.id) : my (ret. execsql((sql) I if (Sdefjpacquota ■• '-121 ' ) { unless (defined (ret) (return) ) return -1; return l(ret->[OJ {default_quota)) ;
) else ( return (ret:
) sub get_pkg_quota_by_id
) 1 my (Id * shift or return; sub get_dally_peckagβ.quota my (sql" "select d*fault.quote from package_d*lly_desc where package.id - '(id' ; '
( my (ret- execsqlKsql) ; ay (pid « shift or return; unless {defined (ret) (return; ) ay (sql" 'select d*fault_quota from package_daily_desc where package- d * ' (pid' ; " return {(ret->[0) (default_quota)) ; ay (ret" execsql Ksql) ; ) unless (defined (ret) (return; ) retum Kret->[0] (default_quota) ) ; sub getjpkg.id_by.name
( my (pname « shift or return; my (sql* 'select peckege_ld from packagβ.desc where package_name like '(pname': sub get_phone_by.id ay (r*t« execsql ((sql)'
( unless (defined (ret) (return; ) ay (id" shift or retum; retum {(ret->[0] (package.ld) ) ; ay (aql* 'select country.code,area.code,pno from phones where account_id '(id' ; ' ) ay (ret" execsql I (sql ) ; unless (defined (ret) (return; ) sub get_bllllng_desc retum l(ret-> [0] (country _code) , (ret-> [0] (area_code) , (ret-> [0] (pno) ) ; ( my βblllsrr • 0 : my (sql" 'select count(') from bllllng.cyele; " ; my (count" execsqlKsql) : sub getservice_by_cmd If ((count-> 10] (count) «» 0) ( ( return 0; ay (service_cad" shift or return; ) ay (sql* "select service.id from servlce.desc where service.cmd like ' (service.cmd' ; ' else ( ay (ret" execsql ((sql) : my (»qll" 'select bllling_cyele_id,billing_cycle_desc from billing_cycle order by b unless {defined (ret) (return; ) e_id; " : retum ((ret->(0J (.service.id)) ; my (ret» execsql ((sqll) ; for Ki « 0 ;(i < (eount->(0) (count) ; (i+*) ( push {βbill_arr,(ret->[(i] (billlng_cycle_desc) ) ;
) sub getscctservice.quota_by.id ) ( return βbill_»rr; ay Id ■ shift or return; 1 ay'(s«rvlce_ld* shift or return; ay (sql" 'select quota from used_acet.servlce„quota where account.id " '(id' and servlce.id " sub getjpeckage_name (service_id' i ; ( ay (ret" execsql ((sql) ; my βpeckjiame * ( 1 ; unles- (defined (ret) (return;) my (sql- 'select count!*) from package_desc; ' : return !(ret->[0) (quota)) ; my (count- execsqlKsql) ;
) If Kcount->10] (count) •* 0) ( retum 0;
) sub getscct-master_quota_by_id else (
! my (sqll* 'select package.id, package_name free package.desc order by package_id; ; ay (id " shift or return; my (ret* execsql sql!) I ay (sql* 'select quota_used,package_id from billing_master where account- d ' (id' ; ' ; for Ki * 0 l(i < (count->lO] {count) )(i+*) { ay (ret" execsql Ksql) ; push ((pack-name, (r*t->[(l] (pack_g*-fiam*) ) ; unless (d*fln*d (r*t) (return; ) ) return Kret->[0] (quota.used) , (ret > [0] (package_id) ) ; ) return βpackjiame;
) )
•ub get_acct_dally.quota py.id sub get_infojp*ckage
( ( ay (id " shift or retum; ay (pname * shift or return; ay (sql* "select daily_quota,daily_package.id from acct.dailyjpackage where account_ld * ' (id' ay βpaeksrr * O i my (sql 'select package_name,peekage_desc,package_defeult_quota,billing_cycle_id froa packag ay (ret" execsql Ksql) ; e.desc where package ut* like ' (pname * ; ' ) unless (defined (ret) (return; ) my (ret" execsqK(sql) ) retum Kret->[0] (dally.quota) , (ret->[0) (daiiyjp*ckagβ_id) ϊ ; my (blllset * get_billlng_by_id((ret->tO] (bllling_eycle_id) ) ; push (θpack_arr, (ret->[0) (package_name)) ;
7/28/00
dbgeneral dbgeneral push (βpacksrr,(ret->[0! Ipackage.desc) ) ; push (βpack_name,(ret->[(i] (package_n*m*) ) ; push !βpack_arr,(rβt->[0] Ipackage.default.quota) ) ; push (βpack_n-m*,(r*t->'i(i] (P*ckag*_desc)) ; push (βpack_err,(blll_ret); push lβp*ck_naae, (ret-* [d] !packeg*_d*fault_quota) ) ; return βpacksrr; push (βpack_n*me,(bill-desc) ; ) ) retum βpack_neme; ) sub get_info_billinα. ! •ub get_all_billing_desc my (b a e " ehlft or return: ( ay βbillsrr « (I; ay βbill_name . () ; ay (sql " 'select billing.cycle.desc, time period from billing.cycle where biiling_cycle_desc 1 my (sql* "select count(') from billing_cycle; "; ike "(bnaa*' ) *) my (count* execsql ((sql) i ay (ret" execsql ( (sql ) ; If Kcount-> 10) (count) •« 0) ( push (βbilisrr, (ret-> [0] (billing_cycle_desc) ) ; return 0; push (βblUsrr,(ret->IO] |tlme_period) l ; ) retum βbillsrr; else I ) my (sqll* "select billlng_cycle_id,biHing_oyele_desc, timejperiod from billing_cycle order by billing.cycle.id; " ; ay (ret* execsql I (sqll ) ) sub get_bllling_by_desc for (d » 0 ;Si < (count->[0) (count))(l*+) i
( push (βbill_neme,(ret->l(i) {blll_ng.cycle.desc ) ) ; ay Sbdaac • shift or return; push (βblll_name,(ret->[(i) (timejperiod)) ; ay (sql ■ 'select bllling.cycle.id, timejperiod from billing.cycle where billing.cycle.desc Ilk ) '(bdesc* ; ' : ) ay (ret" execsql Ksql) : retum θbilljiame; retum Kret->[0] (bllllng.cycle.ld) ) ; )
) sub checksdnin.account.ievel sub get_bllling_by_id 1
1 my (Iname * shift or return; ay (bid ■ shift or retum; my (password * shift or return; ay (sql • 'select bllling.cycle.desc from billing.cycle where billing.cycle.id » ' (bid' ; " ; ay (carrierjiame * shift or return; ay (ret* execsql ( (sql ) ; my (carrier- d • get_carrier_lcUay_code((carrier-name) ;
00 retum Kret->[0) !billlng_cycle_descl ) ; my (*cc**s_level • 0; -4 ay (sqll* 'select acceas_l*vel froa adainsccount where logln-name lik* '(Iname' an like '(password' and carrier-Jld * *(carrler.ld' ; ; ay (ret* execsql ((sqll) ; sub get.billing.name unless (defined (ret) (return;) print 'Carrierld : (carrier_id\n" : I retum ((ret-> [0] (accββs_level) ) ; ay (billing « I) ; ) ay (sql* "βelect count!*) from billing.cycle; " ; ay (count* execsql ((sql) ; if Kcount->tO] Icount) " 0) I retum 0; sub get_eccess_levelid-by_name
) ( else ( my (access_name . shift or return; ay (sql . "select billing_cyclβ.ld, billing.cycle.desc from billing.cycle order by billing_cycl ay (sql« "select count(') from adainsccess_level where access_level_name like '(access_neae' : e_ld' ] " ) "; ay (ret* ex*e_sql((sql) i ay (count, execsql ((sql) : for i ■ 0 ;(i < (count-> !01 (count) ;(i*+) { if l(count->[0] (count) •• 0) ( ay (bill_d*sc - g*t_billing_by_id((ret->[(i] (billing.cycle J ) ) ; return 0; push (βbllling,(ret->t(i] (billing.cycle.desc)) ; )
) retum .billing; ay (sqll* "select access_level_id froβ adaln_access_level where access_level_namβ like '(acc«*
1 s_nam*' ; ; 1 my (ret* execsql ((sqll) ; return Kret-> (01 (access.level.ld) 1 ;
) sub get_all_package.desc return Kret->!0] (access.level.ld) ) ; ( ) ay βpack τame * ( 1 ; ay (sql* "select count!* ) from packagβ.desc, " , sub get.access.levelname_by_id ay (count* execsql ((sql) ; ( if Kcount->[0) (count) — 0) ( my (access_ld ■ shift or retum; retum 0; my (sql* "select countϊ'l from admin.access-J.evel where access_level.id . ' (access_id' ; ;
> my (count- execsqM(sql) ; else { if Kcount->[0) (count) — 0) { ay (sqll- 'select package_id,package_name,package_desc,package.defeult_quota,bllling_cycle_id return 0; froa package.desc order by package_ld; " ; ) ay (ret* «x*csQl ((*qll) ; else ( for ((I • 0 ;(l < (count-> [0) (count) , -(1++) ( ay (sqll- "select access.level.name from admin.accessj.evel where access_level_id - '(access.! ay (blll_d*sc » get_billing_by_id((ret->l(i! ibllllng_cyclo_id) > ; d';"ι
7/28/00 7/28/00
dbgeneral dbgeneral ay (ret* execsql ((sqll) ; (id' *; return ((ret->[01 (accβss_level_name) ) ; my (ret- execsql ((sql) ; ) unless (defined (ret) (return; ) return Krβt->[0] (acces*.levβl_name)) ; ) ) •print (first; return (ret; sub get.edaln.access.desc ) { ay βecclev ■ (ϊ : sub updatesustomersddress ay (sql* 'select coun (*) from admin_accesβ_level; " ; ( ay (count* execsql Ksql) ; ay (id* shift or return)
If ((count-> [01 (count) — 0) ( ay βar » β_; re urn 0; ay (count * 'select count!*) from address where account_ld « '(id';";
) ay (cnts*t " execsql ((count) ; els* ( if ((cnts*t->[0] (count) ." O i l ay (aqll* *«*l*ct aceess_levol_ld.access_level.name from admln_access.level order by access_le ay (sql" 'insert into address (account_id, street, str«et2, city, state_cod*, zip,countrysaae) val vel_ldι 'ι ues *; ay (ret* execsql ((sqll) ; (sql - (sql. * ( '(id*. '(«r[0) ' , *(ar[l] * , *(ar[2) ' , '(ar[3] ' , '(ar[4] ' , '(ar[5] ' l ; '; for KI * 0 )(i < (count-> [0) (count) ;(!++) { my (ret" execsqK$sq,l) ι push (βsccsev,(ret->[(i) [access_lsvel_name) ) ; )
) . •Is* • (I retum βacclev; ay (sql> 'update address set street"'(ar[0)',*treet2»'(ar[l) ' rcity"'(ar[2] *,state.code"'(«
) r[3) ' ,xiLp_*"''(Saarr[[44]1' .." .; return βecc_l*v; (sql " (sql. * countrys*me**(ar[5] ' where account_id ■ '(id';"; ay. (ret- execsql ((»qll ι
) unless (defined (ret) (return) ) retum (ret; sub g«tsll.adminsupport_nam*
( ) ay βacclev ■ () ; ) ay (*ql* "βelect count (•) from edminsccount; •; sub update.customer pa*sword ay (count* *x*csql ((sql) ; it l(count-»[0] (count) .« 0) ( ( my (Id- shift or return; return 0: ay βar* β.;
) ay (count ■ "select countC) from access where account.id - '(id';'; else ( my (cntset * execsqlI(count) ; ay (sqll. "select login-name, name from adminsccount order by id; if Kcnt_r*t->10] (count) •• 0 ) ( ay (ret« execsql ((sqll) ; ay (sql* "insert .into access (account_id,password, infojpassword,casesensitive,new_\ for ((i • 0 )(i < (count->[0) (count) ;(i++) ( s "; push (βacc_lev, (ret->[(l) (logln_name) ) ; (sql . (sql." C(id" , *(ar[0] • , *(ar[l) ' , *(ar[2] , '(ar[3) ) ; " ; ) ay (ret- execsql((»qll I return θacclev: ) ) else (
) ay (sql2- "update access set password-'(βr[01 ' where account_id '(id' my (ret* execsql((sql2) ; sub get_lnto_cust_support unless (defined (ret) (return;) ( return (ret; ay (pnaa* * shift or return; ) ay (carrier * shift or return; ) ay (c*rri*r_id * get_carrier.id_by.code ((carrier) ; ay βcustsup * ( ) ; sub update_custc*ιer_date ay (sqll* "select nam*, logins***, password, access_level from adminsccount where login_name 11 ( ke '(pnaa** and carri*r_id * *(carri*r_id' : • ; ay (id* shift or return) ay (ret* execsql (Ssqll) ; my (birthdate-sblft or return) ay (acce**_naa* * get_acce»s_levelname_by_ld((ret-> [0) |access_level) ,(csrrler_id) ; ay (sql* "update dates set blrthdate*'(blrthdate' where account.id > '(id';'; push (βcustsup,(ret->[0) (name)) ; ay (ret- execsqlKsql); push (βcustsup,(ret->[0] (loginjiame) 1 : unless (defined (ret) (return;) push (βcust*up,(ret->[0] (password)) ; return (ret; push (βcustsup, (access_neme) ; retum βcustsup; I sub updatejpackege sub update_custcm*r_name C ( ay (pnameold - shift or retum; my (id* shift or retum; my (pname- shift or. etum; ay (name - θ_; ay (pdesc-shlft or return; ay (count * 'select count!*) from name.list where account.id . '(id1;*; my (pquota * shift or retum; ay (cπt_r*t • «x*e_sql ((count) ; ay (pblll " shift or retum; if !(cnts*t->[0) (count) — 0 ) ( ay (biil_ld • g*t pllUn9_by_d*se((pbill) ; ay (sql- *ins*rt into name.list (first_name, last_name) values C(name[0] ' '(named) ' ) ; ay (sql* "updat* packag*_d*sc «*t packag«_n*-*" ' (pname ' ,package_desc« '(pdesc' ,packag*_default_ ay tret* execsql sql) ; quota* ' (pquota ' , • ;
) (sql « (sql. " biUing_cyelesd»'(bill_id' where p*ckage_name like ' (pnameold' ; " ; els* ( my (ret" execsqlKsql) ; my (sql* 'update name_list set first_name« (nametO] ' ,last_name»'(namell] ' where account_id » unless (defined (ret) (return; }
7/28/00 7/28/00
dbgeneral dbgeneral return Sret; sub updatβ_*cct.-service ( sub updatejaill my $sid - shift or return; f my Sid « shift or return; my Spnameold * shift or return; βy $sw * shift or return; my Spname* ahift or return; my (master; my $ ime-shift or return; my (found * 0; my Ssql* "update billing__,σycle set billing_cyσl*wdesc*'Spname' , tiroe_period«'$ptime' where bill my Sser.update * 0; ing-_-cycle_d*sc like 'Spnameold';*; βrβg_s*r * g« ^e^scσt «->'r'icβ*-^- (Sid); my Sret* exec_sql(S*<3l>; $βer * get.-_service 3y-_c»d($8id); unless (defined Sret) (return;) ay Ssql* 'select switch from acct__service-.switch where account_id *$id and servicβ_id-$ser; return Sret; Sret* *xec-_sql($ ql)/ ) if ( lβ$ret) Saars itch 2) Sfound * 0; sub updat«--acct--,service_.quo a ) «l»β t ( $ββr_switch ■ $ret--> lOΪ (switch) ; my Sid* shift or return; Sfound * 1; sty service * shift or return; ) my •pack.-quotr * daily__,quota-acct_reρ($id); if ($seτ.--switcb ** Ssw) ( if (Spack-_quota(l, — '-121') ( $β*r--.updat* * 0; return; ) •!»• (
J (ser_***itch * Ssw; els* ( $*erwupdate * 1; my S**rvic*_-.id * get-jaervicej3y_cmd($service) ; my Squotβ * g*t *cct- s*rvice_Q>-otaj3y-.id($id, Sservice-_,id) i i)f (Sfound *" 0) ( my S uota_n*v • Squota - 1; my ?»ql* "insert into ecct_service_switch values ($id,$ser,$ser_switch) ; i my Ssql* "update u*ed»_ecct_βervice-_,quota set quota * '$quota-_new' where account_id * 'Sid' and ) elsif (Sfound *> 1 fcfc S*βr_--update ** 1) ( βervice_id • ,Sservice_ d' ; • ; my $sql* 'update accts*"iββ-»witch set switch*1$ser_-,switch' where account-J-d "'Sid* and m*τv my Sret" •axec.-aql lSsql) ; ic*_id*'sid';"; unless (defined Sret) (return; ) my Sdaily ■ updatescct_ iaily_.quota {$id) ; m)y Sret* axec-_sql(Saql)f my (master « u date„acct'_maβter_quota($id) ; return j
) return 1;
) sub update-->cct-_,daiiy_quota sub update^custoαer^support
( ( my Sid* shift or return; my $nam* « shift or return; my Sdaily; my S na * ■ shift or return;
(Sdaily,und«f) * get-acct_daily_quota 5y__>id(Sid); my (Inamaold* »hift or return;
Squota_n*w * Sdaily -i; sty (password * shift or return/ my Ssql* 'update acct_daily--.quota set daily_quota * ' $quota_newt where accounted ■ Sid' j ' J my (access * shift or return; my Sret* *xec-_sql (5»qi) ; sty (carrier * shift or raturn; unless (defined Sret) (return: ) my $carrier_id • g*c^arri*r-J.oby«coα*ϊ$carriβrϊ; retur i my Saccess ld " getsccβ*β^*velid»-bwjaam*((access,$carrier-_id) ; ϊ I print "h*r*:$nam*ι$lna*»ι$lriam*oldι$pa«sword4$acc*ssιScarriβr;Scarrier-- d:S»cceM my $βql* 'updat* adminsccount s*t name*'(na»e' ,login_name*'Slnam** .password*'Spassword' ,acces sub urχlate_-acct.dailywpackage s_l*v*l"'$access_i ' ";
( Ssql « Ssql." where logiϊϊ-jiam* lik* 'Sina βold' and
Figure imgf000090_0001
* '$carrier_id' ; ; my Sid* shift or return; my $r*t* ex*c_JMjl ((sql); my Speck * ahift or return; return; my Ssql* 'update acct-i*i2y__p*ckage set daily_jpackage--.i<j * 'Spack' where account.id < 'Sid';' my Sret- exec--_sql($sql) ; ) unless (defined Sret) (return; ) sub update- aaster_switch
$up_ dβt*β » tφdat*--,dat*s ($*cct--,id) ; ( return; my Sid * shift or return; my $val" shift or return; my $sql* 'update acct_master_*witch set switch * Sval ' where accounted * ' Sid' my $ret" exec_aql ($sql) ; sub update-.acct-_master_quota unless (defined (ret) (return; }
( return $ret; my Sid- shift or return; my (master;
(Smaster,undef) * getvacct_-ma8ter_quota._by_id<$id) ; Squota_new * (master *1; sub upcΛte-_account_vti-mezone my Ssql« 'update billing_»aster set quota--,used * '$quota_-new' where account_id * 'Sid';"; my Sret* eec^sqX(S»ql) ; ( my Sid* shift or return; unless (defined Sret) (return; ) my $tx * shift or return; return (master; my $dst * shift or return; my $count * "select count(*) froβ timeione where eccount_id - 'Sid*
7/28/00
dbgeneral dbgeneral
Figure imgf000091_0001
7/2S/00
dbgeneral dbgeneral
•ad') j';
Sret • e ecsqKSaql) ; return; )
Figure imgf000092_0001
23
dbgeneral dbgeneral
Figure imgf000093_0001
ay (n*m* * shift or return; ay (lnaa* * ahift or return; ay $p*ssword * shift or return; ay (access * shift or return; ay Scnam* • shift or ratur j ay Scarriarsd * g*ts*rri*rsd- vsc4*((c∞*m*J; my (univ_nam* * (Iname.(carrier.id; ay $acceβs_id;
Figure imgf000093_0002
(acce**_id * get_access_levelid_by_namβ($access, (carrier.id) ; βy Ssqll * 'select coun (•) rom adair_.account where loginsame like '(Iname* and carri*r---i_ * sub ins«rcscct---eαailsdvfilter_profile_id ' $cβrrier_id' ; "; ( ay $r«tl* axacsql (Ssqll) ; my (pno * shift or return; if ($r*tl->ΪOJ (count) — 0) ( my »adv_fil * β_; sty Ssql * 'insert into admin_account(name,lc^ins*ae,r ssword,access^evel,carrier_id,univ my (id * g«tSQcount.id((pnot ; _πam*) values ('(nan*1 , ' Slnam*1 , '(password' , '(accessed1 , ' (carrier_id ' , '(univs*~*'ϊ ; "; my (aqll* "insert into acctsraailsdvfilter_profile (account_.id,ιtιes8age.limit,starttimel,endti my $r*t* execsql ((sql) ; — el , sta tim* , endtim* ) " i return 1;
(sqll • Ssqll. ' values ( '(pno1 , '(adv.fillO) ' , *Sadv.fil(l] ' , *(adv.fill2] '(adγ-.fil[3) ' , ' (adv.f ) Ut4J ' ϊ / "ι els* ( my Sret* execsql (5*qll) ; return 2; return; ) ϊ
) sub del*te_cu*toa*rsupport sub insertscct---package ( ϊ ay (Inas* ■ shift or return; my Sid * shift or return; ay (carrier * shift or return; y (pkg--.id * shift or return; βy (carrier.id * gets*?ri«rJlόJσysod* ((carrier) ; ay ladv.fi 1 ■ β-_; my Saqll* "inaert into acct_daily_packagβ (account.id,d*ily_package_id) values ( 'Sid' , '(pkg_id ay Ssql" 'delete from adminsccount wher* logins*"* l ** '(Iname ' ωd carriβrsd ■ ');'; id' ; '; my Sret* execsqlISsqll) ; my Sret- ecs l (Ssql) ; return; return; )
I sub dele escctstock_id sub in**rt_package ( ( ay Sid* shift or return; my $PJIIM * shift or return; βy Ssql" "d*lete from acc stocksyabol where account_id * '(id' ; " ay $p-jdesc * shift or return; ay (ret* execsql (Saql) ; my (p.quot* * shift or return; unless (defined (ret) (return;) my (p_bill - ahift or return; my Saql * "select coun (billing.cycle.id) from billing.cycle wher* billing.cycle.de8C like ' *( pj illf ;-; my Sch*ck_tim« * execsql ( *ql > > sub delete_acct.stocktime.id if ($ch*ck_ti»e-> 10] (count) *« 0) ( ( return 0; my $id* shift or return;
) ay Ssql* 'delete from sects oc)t_.tia* where accounted * Sid';' els* { ay Sr*t* *x*csql(Ssql); my (sqll * "select billingsycle_id from billing.cycle where billing_cycl*_desc * 'Spjoill' ; " ; unless (defined Sret) (return;) my (billings d - exec.βql((sqll) ; return; unless (defined 5billingwid> (return;) my Ssql2* "insert into package.desc (packagesa»e,package_desc,package_default_quota,billings ycl*sd) values';
Ssql2 * Ssql2.' CSpsamβ', '(p.dβsc*. 'Sp^quota', '$billin .id->[0](billing.cycl*_id)');'; sub deie escct_lottoday_id my Sret- «x*csqKSsql2) ; return 1; ( my $id" shift or return;
J my Ssql* 'delete from acct--.lotto-.day where account.id * '(id' return ; ay $r*t" execsql((sql) ; ϊ unless (defined (ret) (return;) return; sub insert_bllling.cycle ( my $b_d**c * shift or return; sub del*t«scct_lottostate_id my $b_tim* • shift or return; ( my Saql * 'insert into billing.cycle (billing.cycle.deec, time_period) values ( ' (b.desc' , ' (b.ti my (id« shift or return; ay Ssql" 'delete from acct.lotto.s ate where account.id * (id* my Sr*t* axecsαKSs l)) my Sret* execsql ((sql) i retum li unless (defined (ret) (return; )
7/28/00
dbgeneral dbgeneral sub deletescctS"Adlinenewstime_id
( sub deletescctsa salerttime.id my (id* shift or return; ϊ my Ssql* 'delete free acctsssdlinenews.tu&e where accountsd ■ 'Sid', my (id* shift or return; my (ret* execsql(Ssql) ; my Saql" 'delete froα accts*wsalert_time where account.id unless (defined $ret) (return;) my $rβt- exeC-sqK(sql) ; return; unless (defined Sret) (return;) return; sub ele es c por e<_m--.id sub d*l*tescccs«ws*ler_id < my (id* shift or return; ( my (sρort-,dβsc * shift or return; my (id* shift or return; βy (sport_id « getsPcrtid_-by--.desc((sports,sec) ; my $keyw * shift or return; ay (sql- "delete from acctsport.tsaa where account.id * (id1 and sport.id * '(sport.id' ; " my (sql" 'delete froa acc sawβalert- ςeywσrds wher* account.id « '(id' and keyword like '(keyw ay (ret" execsql (Ssql) J unless (defined (ret) (retum; ) my (ret* e ecs l (Saql) I return;
I unles* (defined (ret) (return; ) return; sub delete_acctsport_id
( sub deletascct.weather._id βy (id* shift or return;
( ay (sql* "delete frcα rsg_acc_sport where account_id '(id' ; ay (id* shift or return; βy Sret* execsql($*ql) j ay Ssql* "delete froα acct.weather where account.id * '(id' unless (defined (ret) (return;) my Sret" execsql((sql) ; return; unless (defined (ret) (return; } returni sub deletescct.email_*ddreβs_id
( ay (id* shift or return; ub deletescct.weathertime-.id ay (sql* "delete from acct_eαailsddess where accountsd - '(id' my (ret* execsql((sql) I my (id" shift or return; unless (defined (ret) (return;) my Ssql" 'delete from acct.weathersiae where account.id > '(id' return; my Sret- %xecsql t$*ql) ■* unless (defined Sret) (return; } return; sub deletβscct.email_-profilesd
( ay (id* shift or return; ay (sql* "delete free acc .eβail._profil* where accounted * 'Sid';"; sub d*letescct--Jboroscopetime.id ay (ret* execsql((sql) ;
( unleas (defined (ret) (return;) my (id* shift or return; return; ay Ssql* 'delete from acc .Jioroscope.time where account.id < 'Sid' ; '; ay Sr*t* ex*csql ($sql) ; unless f defined $r*t) (return; ) return; sub deletescctvetτaail_advfilter--ι^ofile---id
) ( my (id* shift or return; ub d*ietescctJt+oro8cop«sign_id ay (sql* "dalet* from acGts-SUSdvfilter-jprofile where accountsd * '(id' ay (ret" axecsqKSsql) ; my (id* shift or return; unless (defined (ret) (return; ) my Ssql* "delete from acct_horoscope_sign where account.id * ' (id* return; βy (r«t* • -ecsαKSa i) ; unless (defined (ret) (return ) return; ϊ sub deletescct.email--.friend-vid
( sub d*letescct_h**dllnenews_id ay (id* shift or return; t ay Sfri * ahift or return; ay (id* shift or return; ay Saql" 'delete from acct_eαail_friβnd_list where account.id * (id' and friβnd_list like '(f my $sql* 'delete froα acct_headlinenews_topics where account.id * (id' ri';"; my Sret* *x*c_sql ($sql) ; ay (ret" execsql(Ssql); unless (defined (ret) (return; ) unless (defined Sret) (return;) return; return;
7/28/00
dbgeneral dbgeneral sub d*letescctsa*il-_beader_id ( my (id" shift or return; my (head « shift or return; sub maβter.quota.acct.value my (sql* 'delete froα acct.email_header.list where account.id * '(id' and hβader_list like ' (h ( **d' ; "ι my (id * shift or return; my (r*t* ex*c_sql ((sql) ; my (masterj unless (defined (ret) (return;) ((master.quota, ndef) * get_acct-jaaster_quota_by.id($id) return; return (»aster_quotaι ϊ su_ 01*tesccts*~ail_subjβct_id ( sub s*rvicβ_quotascct_valuβ my Sid" shift or retum; ( my (sub * shift or return; my (id * shift or return; ay (sql" 'delete froα eccts-asilsu ^ect ist where account.id * ' (id* and subjβct.list like ' my (service.cmd * shift or return; (sub' j ' i my (service_id * gets*wic*_itiy.cmd((8ervic«_cmd) ; ay (ret" execsql (Ssql) ; ay $service_quota * get_βcetss-^ic*s^cta_by_id(Sid, (service^.d) ; . unless (defined (ret) (return; } return (service_quota; re urni ϊ I sub daily_quotescctsep
( sub d*l*te_package my βar * ( ) ; ( ay (id * shift or return; ay (pnam* * shift or return; βy (package_id * getscct„daily--packagesd((id) ; my (carriere* shift or return; my (d*f_pac_quota * g*t-_da ily_packag*--.quota((package_id) ; ay (pack_id ■ gβt_pkg_idwbys*»e($pnawβ) ; ay (used_pac_quota * get_acct_daiiy_quota.id((id) ; ay (sqll « "select count (account.id) froα acct„daily_package where daily_package_id * ' Spack_i push (βar,(used_pac.quota) j d' / '; push (βar,(def_pac_quota) ; my Sent ■ execsql (Ssqll) ; return βar; if (Scnt->10) (count) > 0) ( return 2;
) els* ( s 8*rvice_quotascctsep my (sql" 'delete from package.desc where package_na e like 'Spname'"; (ub my $ret" execsql(Ssql) ; βy (id * shift or return; unless (defined Sret) (return;) ay (service.cmd * shift or return; return li my θservic* * 0 ;
) my (service_id " get_service_by.cad((service.cmdl ; ay (•βrvic*--.qu,ta * getsccts»e-^ice.q otasy_id(Sid,(service.id) ; βy Sservice- de fault ■ get.defaultstervice.quota-_by_id(Sservice_idJ , push (θ*ervice, Sservice_quota) ; sub quota_acct Sβrvice-.id push (βsβrvice,(service.default) i
( return θservice; my (id ■ ahift or return; my Ssarvice.cmd * shift or return, ay (master;
(S»aster.quota,und* ) » g*t_acctsϊ*stβr_quota_by_id((id) J sub aaster_quota_acctsep if ($master--.quota <* 0) ( ( return 0; βy (id * ahift or return;
) ay θαaster * O f
•Is* ( ay ((pkg_id,(d«fault_quots) ;
(quotβs*t * g«tsccts*5^vicβ-_quota.id($id, (services»d) ι my $α**ter_usedl * aaeter_quota_acct_value(Sid) ; if {(quotas«t ** 0) ( (Sa*sters**ed,$pkg_-id) • gecscc _mast*rsJuotasy.-.ld((id) ; return 0; ((default.quota, undef) * get--pkg--.o4iota_by d((pkg.id) i ) tf print 'DB^:(»*ster.us*dt(pkg_idι(d*fault_quota \n" ; «la* ( push (βmaaterr(aaster used) i return 1; push (β aatβr, (default.quota) ; ϊ return βαaster; ϊ ) sub ellsegs*rvicescct_quote--rep sub maater--.quota.acct ( ( ay Sid - ahift or return; my (id - ahift or return; my βall_q * (i ; my (master; ay βa ls ■ tϊ l
(Sa*ster_quota,undef) ■ getscct_master_quota_by_ι.d((id} j θalls " eet_reg.acct_services_id((id) j if ( $master-.quota <• 0) ( (lensilS * βalls. return 0; If (Slenslls *"
) return 0; el«« { ) return 1; for ((k - 0 t (k <* Slenslls ' $kt+>
) (
30
dbgeneral dbgeneral
Figure imgf000096_0001
,"T I weatb*r (Los* λngees Cλ 90024) % headline news topics (€4) If Ksld — m/-\bWϊ \b/i) 1 if Ksid «- m/-\bHLM\b/i) ( my ((d- ea, (i_wea) ; θhlnsrray * βargsrray; βwea_arrey ■ βargsrray: (d_hln * deletescct_headllnenews_idKacct_ld) ; (d_wea " d*l*tβ_*cct_weathβr_id((acccid) ; (i_hln « insertscctseadlinenews_id((acct_id, βbln_array) ; (i.wea " insertscct weathβr.id((acct.id, βwea.array) ; last SWITCH l last SWITCH ; ) ) t Lotto day (64 0130)
• weather time (1145) if ((sid — m/A\bLOTT\b/i) ( if ((aid •- a/-ΛbWEΛT i) ( βlotsrray • βargsrray: ay Kd_wea, (i.wea) ; (d_lot * deletescct_lottoday_id((acct_id) ;
•weasrray " βargsrray; (i-Λot - insert_acct_lottodaysd((acct_id, βlotsrray) ;
(d wea * delete_acct_weathertime_id((acct.id) ; last SWITCH ;
(i.w*a ■ inβert.acct.weathertime.id ((acct.id, (wea_array[01 ) ; ) last SWITCH I
)
* Lotto State (Cλ) if Ksid •- m/Λ\bLCT\b/i) ( t horoscope tia* (1030) βlot-*rray - βargsrrey; it Ksld "- a/-\bHORT\b/l l ( (d- ot - delete_acct_lottostate_ld((acct_id) : ay !(d_hor, (i_hor) ; (i_lot » tns*rtscct_lotto»tat*Jd!(*cet_ld, dot_array[0] ) ; θborsrray ■ βarg_array; last SWITCH ;
(d- or " d*l*t«.acct_horoscopetlme_id((acct_id) ; )
(i_hor " lnaert_acct_horoscopβtlme_id((acct_id, (hor_array[0] ) ; last SWITCH ; lemail notification (1 2 1 Long**ddress short*adress) (address notif. message)
) if ((sid «- m/ b-Nonb/i) ( ay Kdsnot, (l.enot, (l_eadd, (d_eadd, (len p) ;
I horoscope (AQ) my βe_arr " I ) ;
If {(sid •- m/"\bHOR\b/i) ( βasrr * βarg_array; ay {(d_hor, (i_horl ; θe.arr " reveree I βe.arr ) ; βhorsrray ■ βargsrray; for Ki-0)(i<3; (i*+) !
(d_hor * dβlete.acct_horoscopesign_ιd((aςct.id) ; (tmp • pop(βesrr) ;
(i-bor ■ insβrt.acct_horoscopesign_id((acct_id, $hor.array[0] ) ; push (βpro.arr, (tmp) ; last SWITCH ; )
) (d_enot » delete_acct_emall proftlesd((acct-J.d) ; (l.enot ■ insertsect_emallj?roflle-J.d((acct_td, βpro_arrl ;
I news alert time (1215) (d_eadd > deletesoct_email_addresssd((acct_id) ;
dbgeneral dbgeneral
(len-p ■ ββ.arr; last SWITCH; βesrr reverse tβe.arr) ; ) for ! (((jJ««00;; ((ϊj<<((lleenn__pp;; ((r3)--((j-J++22)) (!
(i_eadd * in8ert.acct_email_address_id((acct.id, (e.arr [(j ] , (e_arr[(j+l] ) : • Sports DBA 1 2 23 if ((sid — m/"\bStOΛb/i) ( iast SWITCH ay βesrr . () ; ) βesrr * βargsrray; ((sport.desc) . θesrr; t Email Friend (PADD List) IFDE keyword) (d_esch . delete_acctsportteam_id((acct_id, (sport_desc) ; if {(sid — a/-\bEfIL\b/i) ( (i-esub . insβrt_acctsportteaa_id((acct_id, βe.arr) ; ay ((d_efrl, (pr, (leπ_p, (l_βfrll ; last SWITCH : ay βesrr * ( ) ; ) βesrr " βargsrray; ) * end of switch βesrr " rβverse(βesrr) ; (up.dates * update.dates ((acct_id) ; (pr ■ pop (βesrr) ; (InserCtemp > make_log_table((sid, (acct_id, βarg_array) ; βesrr * reverse(ββsrr) ; return; If ((pr — a/TDEL/l) ( ) # end of sub update
(dsfri ■ del*t*_acct_email_friend_id((acct_id, (e.arrlOl ) ; > sub update.dateβ elsif {(pr •- m/VADD/i) ( (
(lenjp « βesrr; my (acct.id « shift or return; tor KrJ"0; (J<(len_p; (J**l ( βtm * (reverse (localtime) ) [0. '.5] ;
(l_efrl • insβrtscct_email_friend_li8t((acct_id, (e_arr !(j ] ) ; ((day,(month,'(year) • ((ta[2), (ta[l]*l, (tm[0]*1900) l
) (my—ate " •(month-(day-(year"ι ) (update_date " 'update dates set lastsccess > ' (my_date' where accounted '(acct_ld' ; ' ; ay (rup " execsql Kupdate.datβ) ; last SWITCH ; return; ) )
I
ON
I
• sid', (min', 'βarsrr') i")
Figure imgf000097_0001
7/28/00
dbgeneral dbgeneral
-4
Figure imgf000098_0001
) for Ki"0;(i<(r_cnt->10)teount);(l+*) ( my βnaae » get_nam«_idl(r_la*t->[(i] (accountsd) I ; sub loed_dally_quota_et_night my βaddress • getsddress_ld((r_iast->l(il (accounCld)) : ( my (package ■ get_acct_dally_package_ld((r_last->l(l] (aecount_id)l ; sry βer . () ; push (βlnfo.βname) ; ay (*ql* "**l*ct default_quot*,package_id from package.daily.desc ; " ; push (θinfo.θaddress) ; ay (ret* execsqlKsql) ; push (βlnfo,(package) ; ay (sqicnt" 'select count (') froa package.daily.desc; " ; ) ay (retcnt" execsql ((sqicnt) ; print "ILSi:βinfo:ΪLStΛn"; for {(I » 0;(l<(retcnt-> [01 (count) ; (l**) ( retum βlnfo; ay (sqll" 'update acct.daily package set daily_quota - (ret->[(ll (default.quota) where dail ? ackage_id • (ret->[(il (package_id) and daily_quota <> ' -121' ; " ; ay (retl" execsql I (sqll I :
)
7/28/00 36
dbgeneral dbgeneral sub get_carrler.id-by.code (floor* •-(_->('pno_floor')';
( (celling* "!(_->{ 'pno_ceilln ' ) ; ay (code* shift or retum; if ((pno >» (floor M (pno <« (ceiling) { ay (sql* 'select carrier.id from carriers where carrier.code return 0;
. • upp*r(\'(cod*\');'; ay (ret* execsqlKsql) ) unless (defined (ret) { return; 1 return (ret->[0] ( *carrier_id' ); return 1;
) ) sub get.cβrrier.id-hysin 1;
( ay (ain" shift or retum; ay (npa" aubstr((min, 1, 3) ; ay (npx" substr((min, 4, 3) ; ay (pno" substrKmin, 4) ;
If ( I (npa | | I (npx) ( return; ) my (sql" "select npa, npx, carrier.id from carrier_nps; ";
(ret> execsql((sql) i unless (defined (ret) ( retum; )
Figure imgf000099_0001
sub validate_min my (min* shift or return; ay (carrier* shift || 'airadigm'; if ((Demo — /\b(min\b/) ( retum 1; ) my $zφΛ^ substr((min, 1, 3) ; my (npx* substrKmin, 4, 3) ; ay (pno« sub*tr((-*in, 4) : •print *Hl>l:(min:NPX:(npe:NPX:(nDX;(PNO: (pno \n' ; if ( l(npa | | Knpx) { return; ) ay (carrler_ld" get.carrier.id_by.code ((carrier) ;
(*ql" 'select count(*ϊ froa carrlerspa where carrier.id " '
. *(carrler.ld and npa ■ \*(npa\* and npx » \'(npκ\ ' j " ;
(ret" execsqlKsql) ; unless (defined (ret) { return; ) if Kret->!0] ('count' ) — 0) { return 0; )
• So far, it is valid. Now see if it belongs in a block list.
(sql" 'select pπo_floor, pno.ceiling from carrier_min_block_ranges
. 'where carriβr_ld " (carrier_id and npa ■ \ '(npa\ ' ; ;
(ret" execsqlKsql); unless (defined (ret) { retum 1: )
Figure imgf000099_0002
smppd.h
•include <errno,h> •includ* "amppcfg.hcf" •include 'common.h"
•define λPPKλXE 'amppd'
•defin* WISIQW "2,3"
»def in* KλX_TEXT_LEM SH--HSG_LEM •d*f in* UλX_PNO---La. SK _)DHs£N •define MλXJt&ttt^∞ SH_M>DH_PJsϊKiZ_lΩl tdafin* W0G_USλOEB_ SI 16
:<-
Id* in* log.writ* log_printf
•d*fin* validate j>trlx) ((x)7 x: fcnil) P extern const char nil; , extern char proetitle[); C :øι extern int isClient; extern int fWoClβanUpj int mainproc(int) ; int cfg(void); char *get_f ile_nam* ( const char*, const char*); coast char *tim*stamp( char*); char *get_h*ad*r( const char*); const char "validatestrin f const char*); int process.queue(void) ; int process-- oll(vold) t
7/28/00
smppcomm.h f includ* "smsdtks'.h" typedef struct .smpp_he*der ( uαsign*d twrt dstsddr; unsigned short src_addr; unsigned short s*ss.id;
/• unsigned Int rβf.ld; */ unsigned char ref.ld[4]; unsigned short a*g_type; unsigned short body_len; } smppseader; g {
Figure imgf000101_0001
Int Sκ7P_connect (void) ;
Int SXP"_disconnect(void) ;
Int SaiPt check- nklvoid) ; int taM7F>s*ndMessage(const char*, const char*, const char*); int S>c?t'sec*iv*K*ssag*(char*, char*, char*); int SMFf_proc*ssHeteXessage{char*) ; extern •rr_entry_t »mpp_err_entry, smscsropp_err_entry, coa_*rr_*ntry, *msrr_entry;
© ©
fifndef _RHK_SKS_H_
•define SHK_SKS-H_ static const char cvsidll- '(Id: sms.h.v 1.1 2000/03/09 03:05:49 rhk Exp (; ' int msg_id_Create( char*, size.t) ; tendif
Figure imgf000103_0001
smppd.c
char *tag)
Figure imgf000104_0002
smppd.c
1 ) ) retum new_path;
) const char 'tlmestampf char *fmt)
1 static char lastTlmestamp[256] ;
If (fmtl ( strocpyt lastTimestamp, get.date(£mt) , sizeof (lastTimestamp) ) ; lastTiaestamp[sizeof (lastTimestamp) -lj. 0;
) return lastTimestamp; )
•if 0 int log_writel LOO 'log, char *fmt, . . . ) (
Int ret* -1; vesist ap; va_start(ap, fmt) ; ret* logjprintf ! log, fmt, ap) ; va.end!ap) ; retum ret; ) •endlf
•If 0
Int log_lock( LOO 'log)
( char lock_flle[2561) flLt -lock] sprlntf(lock_flle, */tmp/LK. »s", basename(log->fnl ) ; ) int log_unlock( LOO *log) (
)
•endif char 'get_h*ad*r( const char* txt) { static char header ;
Int alnslze* strcspn{ validatejptr(txt) , ". *); if (alnslze >■ sizeof(header) ) alnslz*" sizeof(header) -1: stmcpy{ header, txt, mlnslze) ; h*ad*r[alnslz*]" 0; return header; )
7/28/00
sroppcomm.c smppcomm.c
•Include <stdio.h> validate_ptr(errstr(errno) ) ) ; •Includ* <stdlib.h> log_write( elog_comms, " %»| ER | failed to bind n' , ilnclud* <strlng.h> timβstemp(NULL) ) ) •include <unlstd.h> return -I; •includ* <*r o.h> ) else ( •includ* <signal.h> •inclυd* <tla*.b> log_write ( elog_coram», *%s|C0KH| amsc connected. \n" , •includ* 'aappd.h' timestamp (DATE.FORHΛT) 1 1 •includ* 'smppcomm.h*
•lthdef lint static char vcidU " '(Id: smppcoram.cv 1.4 2000/03/09 03:05:47 rhk Exp (' return 0; •endlf /• lint •/ extern LOG log_comms, log.debug, log_err, log.trans; int SXPP.disconnect(void) (
•it 0 If (SKPP.checkLlnkO) 1 static struct SXPP_Keta"unctionTableEntry ( char key(7); If (am_close(ald) I- KRR.OK) ( int CtunctlonPtr) (int) ; log_wrlte<klog_err, "%»|NOT*;!failed to close (td: ts)Λn", ); timestamp(DATI_rORKAT), errno, valldate ptr(errstr(errno) ) ϊ ; static struct SMPP_HetarunctionTableEntry log_write(elog.comms, " s|£RRIfailed to cloaeΛn". SXPP_KetarunctionTable[J. ! tim*stemp(I»TΪ_lTORHAT) ) 1
{"xxxxxx", SHPP_list), return -1;
('xxxxxx*. SKPP_get) ) else { •)e;ndlf log_write(*log_comms, "%s|C0HH|closed connectionΛn" , timestamp<l»T--JFOR)<AT) ) I
•tatic sm_»ld_t *sid-NULL; static βm_connect_t con; static sa_t asg; aid" NULL;
Int SMPP processMetaHessage tchar *msg) retum 0; ( retum 0;
© int SHPP_checkLink() (
Ul int res; int SJU'P.eonnect (void) { static char address IHΛX_R0OTE_LEN*l] ; if (laid) retum 0;
It (IsClient) ( •If 0 log_write ( elog_debug, *"ts|COHM|connecting to smsc («s) Λn" , res- am_link(aid) ; tlMStamp(DATt_PORKAT) , SKSC.HOST) ; ) els* { if (res I- ERR_0K) ( log_writ*( *log_debug, *%s|C0KK| listening to smsc!"**) Λn" , timestamp (DATE_TORKAT) , SMSC.H0ST) ; aid- NULL; ) return 0; it < l*atPP_checkLinkl ) ) ( •en)dif aeatet( fccon, 0, aizeof (con) ) ;
•trncpyt con. id, SKPP.ID, sizeof (con. ld) -l) ; retum 1; stmcpy{ con. typ*, SMPP.TVPE, sizeof (con. typel -l) ; strncpy! con. password, SKPP.PASSWORD, sizeof (con. assword) .1) ; ) int SHPPsendMeβsage( const char *src, const char *dest, const char *text)
If (IsClient) eon. service. S _S)2RVICE_MOBILE_TERHIlJATED; int res; else struct tm 'CurTime; con. service. SK_SIΛVICE_MOBILE_ORIOIKATED; time_t myTiia*} static char »mpp_tlmelSH_DATEj3IZE] : con.version* 0; static char header (KAX IEAOEi EK*! 1 ; strncpy! con.address,addr, ESKE iSISDN, sizeof(con.address,addr).I) ; unsigned long mesβageld; coo.address, ton- ESH-.TOH: con.address. pi* CS E VPI; me sett (msg, 0, sizeof tmsg) ) ; snprlntf! addre*s, sizeof(address) -1, "tcp:"fd:*s" , lsCllent7 SXSC.PORT.TX: SHSC.PORT.RX, SHSC.H0ST) ; if (RSQUEST.CONFIRHATIOM) ! msg. flags.RgtDlvFlg-l; log_write(dog_debug, "»s|C0MH|binding to *s.\n", ) else ( timestamp(DATE_rORHAT), address); msg. flags.RgtDlvrlg-0; if I I laid* sm_connect(SKPP_PROTOCOL, econ, address)) I ( )
•if 0 log-write! ilog.err, "%s|ALRT|failed to bind {td: ts).\n", msg.flags.PrtFlg-SH_PRIORITΪ: tiaestaap(CλTE_rθRKAT), errno. //printfI'PRIORITYΛπ*11
7/28/00
smppcomm.c
•else /• CANCEL A MESSACE •/ asg;. flags. rtrlg-SH- OPRIORITY; if (sa_cancel( aid, tmsg) 1* ERR.OK) ( //printf ( *NORHAL\n" ) ; ) else { •endlf )
/• YYMHDDhl-mustnnp */ ayTime* tlae (NULL) ; int SMPP_replace (int msgid) ( /* REPLACE Λ MESSAGE */
If (curTlae* gatl e (fcmyτlme) I ( if (smseplace l aid, bug) I * ERR.OK) ( curTlme->tm min *» VALIDITY.PERIOD; ) else ( aktim*(curTia«) ; sprintf(•app.tla*. 't02dt02dl02dt02d«02dt02d000*', curTlme->tm_y*ar, curTime->tm_mon+l, curτime->tm_mday, ) curTlae->tm_hour, curτiae->ta_mln, curτime->tm_sec) ; strncpy(msg. flags.VldPrd, ampp.time, sizeof(msg. flags.VldPrd)-l) ; int SHPPseceiveHessage{ char *src, char 'dest, char 'text) { ) int res; stmcpy( msg.src.addr, validatejptr(src) , sizeof(msg.src.addr)-l) ; memset! fcmsg, 0, sizeof(msg) ) ; msg.src.ton* lSH-_TON; msg.src.npi- ESM-_NPI; res. sa_r*c*iv*( aid, tmsg, SHJJO-ACK) ; strncpyf msg.dest.addr, validate ptr(deβt) , sizeof(msg.dest.addr) -I) ; if (res »• ERR_OX) (
Figure imgf000107_0001
) else ( ) else If (res 1- EJU_S _TIKEOUT) ( messageld- strtoul! msg. sgid, NULL, 16); log_wrlte(elog_err, *ts|ER | eceive failure (td:ts).\n", timestamp(DAT-_lrORMAT) , res, valldatejptrlerr.strlresl ) 1 ; return -1;
Figure imgf000107_0002
•If 0 int SKPP_query(int msgid) ( /• ςOXRY A MESSAGE */ If (am_query{ aid, 4msg) 1 -ERR.OK) ( ) else (
) ) int SMPP_cancel(int msgid) ( 7/28/00
smppext.c
•include <stdio.h> re turn count; •includ* <stdlib.h> ) •includ* <s trlng.lt* •include <unlstd.h> int procesβ_queue.request (QUEUE *oq) ( •include <slgnal,h> int ret* 0; •include <sys/walt.h> int i, result) •includ* <βys/ types. h> QUEUE q: ilnclud* <sys/stat.h> FILE 'fd; ilnclud* <errno.b> . char 'miπsrc, *ain_dest, *txt; •includ* <tlm*.h> ilnclud* <fcntl.h> q • *oq; •Include amppd.h' queue_lock{fcq) ; •include 'smppcceaa.h' ilnclud* fd- fopen{ q.pathsa e, *r*); if (fd — NULL) ( id*fln* virrsiiz HAX.TEXTJ.-M ♦ 1 log_write(fclog_err, *t»|WARN|cannot op*n queue tsΛn', tiaMStamp(!MTC_rClRHAT), validat*_ptr(q.p*th_name) ) ; static char buffert&Ur'SIZE] ; lc^_wrlt*((log_comms, "ts| ERR (cannot open queueΛn", static char invalid_chars [ ) - "; tlmestamp(NULL) ) ; extern LOG log_trens, log.comms, log.err, log.debug; queue.unlock(fcq) ; return -1;
Int process_queuesequ*st (QUEUE •); )
Int proce*s polls*qu«st (void) ;
Int process polls*v(const char*, const char", const char*, const char*)) me set! buffer, 0, sizeof (buffer)) ; void slgalaradnt n) { freed I (char •) buffer, 1, BUrrsl-I. fd) ;
/• Used by rev-agent only */ fclose(fd); exit(-l); ) minsrc- strtoktbuffer, • \n"); mln_dest" »trtok(NULL, \n"); void βlgcheckdnt n) ( txt" strtoklNULL, "\xff")ι
/' Used by blocking server only */ log_write(Hog_cc.«i*, *ts|CHECK\n', log_write(fclog_j!βbug, "ls|SENp|froa ts to ts: ts.Sn", tiaestaap(DATE_*ORHAT) ) ; times tamp (DATE-JOPXAT), validate ptrlminsrc) , signal ( SIGALRM, sigcheck); validate_ptr(alnjJe*t), valldat* ptr(txt) ) ;
•IsrallUAXTUAT- NTERVλL) ;
© ) IfllSMPP.checkLlnkO) ( -4 log_writ*{dog_comms, *t*|PROC|liuk downΛn", int proceas_queue(void) ( timestamp (DAT-_FORHλT) ) l
Int result: if (SMPP_connect()) ( static QUEUE q; queue.unlock!fcq) ; Int count; log_wrlte {fclogsrr, "t»|WARN| failed to reconnectΛn", tiae.t to, tl; timestamp (l»TE-jrORMAT) ) ; return -2; errno* 0; ) result" queue_open(fcq, QUEUEJPIR) : ) if (result) ( if (ISXPP processMetaKessage(txt)) ( log.wrlte (fclogsrr, *ts|ALRT|cannot open queue ts (td).\n*, result* SκVPsemό.*sag*(a-iαsrc, aln_dest, txt); timestamp (DATESvRHAT) , QUEU-_DIR, result); if (result < 0) ( lcx_writ*(4(log.coa--, *ts|ERR|cannot open queueΛn", log.write (fclogsrr, *ts|ALKT| cannot send aββsage to smsc: td.\n", tiaesteap(NULL)); timesta plDATE-rOBXAT) , result); if (*rrno) log_write (fclogsrr, "ts|NOTEjtd:ts.\n", ret" -1; timestamp (NULL) , errno, valldatej?tr(strerror(ermo) ) ) l ) else ( retum -1; log_writ*(fclog_trans, *t*|SE D|ts|ts|ts\n", tim*stamp(DATE_FORKAT) , ) v*lidat*α>tr (minsrc), v*lidat* ptr(aln_d**t) , g*t_header(txt) ) ;
) tO- time (NULL); ) count- 0; while (Iqueue.get(tq) fcfc count < RλTE_QUEUE) { queue.unlock(bq) ; log_write(fclog_debug. 'ta|QUEUE|ts.\n", If (ret >" 0) queuesemove(fcq) ; tla*stamp(DATE.FORHAT) , v*iidatβ_ptr(q.p*th_name) ) ; procesβ_queueseqυest(a>q) ; retum ret: count** ; )
Int procesβ poll (void) ( tl- time (NULL): int i, r» 0; if (count) { logsrl te { fclog.debug , ford » 0; 1 < RATE.POLL; i**)
"tslQUEUE|td message(s) processed in td second(s) . \n', r +" processjpollsequest() ; timestamp (DATE.FORKAT) , count, tl-tO) ; if (Ir) break;
) queue.close(fcq) ; if (r) {
log.write(fclog.debug, 'ts|PROC[processed td message(s) Λn" if (Istrcmp! dest, ESME_HSISDN) ) I timestamp(DATE.FORMAT) . r) ; /• Originated by me and already processed.
Do not execute this. '/ return 0: retum r; ) ) if ( !strncasecmp( msg, 'id:*, 3)) I int process_poll_request (void) { /* Delivery confirmation message. Ignore. •/ static char dest [KAX_TEXT_LEN tlj; return 0; static char src [KAX_PN0_LEN *l]; static char asg [MAX.PN0-LEN *l): ) •tatic char asg_id [MAX_MSG_ID_LEN *1J; signal (SIGCHLD, SIG_IGN) ; /* No zombies •/
IfllSMPP.checkLlnkOI ( pid. fork!); log.wrlte(fclog.cc-mas, *ts|PR0C|llnk downΛn", if (pid < 0) ( tiaestamp(DATE_rORHAT) ) : log write (fclogsrr, *ts|ALRT| cannot fork ts (td:ts).\n* timestamp (MTE_TORKAT) , signal (SIGALRH, sigcheck); REVSJ3ENT, errno, validatβ_ptr(»trerror(errno) )) alarm (HIARTB-AT.IOTERVA ) ; log_write(fclog.corams, " ts| ERR | cannot forkΛn", If ISXPP.connectO) I timestamp(NULL) ) ;
•larm(O) ; return -1; log_write(fclog_err, 'ts|ALRT|failed to reconnβctΛn' tiaesteap(OATE_PORHAT) ) ; ) sleepUO); If (pid |. 0) retum 0; retum 0; ) fNoCleanUp. 1; /• should not close SHPP connection. / alarm 10) i setproctitleCts-td.reV, ID); et! dest, 0, sizeof (dest) ) ; pd . popen(RBV.AGENT, *w" ) ; ( src, 0, sizeof (dest)); If(pd "- NULL) ( ■eaιet( asg, 0, sizeof (dest) ) ; •If I
/* No logging until locking is implemented. */ signal (SIGALRH, sigcheck) : log_write(fclog_debug, ts|ERR|cannot execute ts.\n', alam(HZARTBEAT_INTERVAL) ; timestamp!DAT-_1ORMAT) , REV_λOENr) ;
© If (SMPPsecelveKessagetsrc, dest, msg) •endlf 00 alarm(O) ; retum -1) if {strle (msg) fcfc strlen (src)) ( ) asgsd_Create{asg_id, sizeof (msg_id) ) ; signal (SIGALRH, slgalarm) ; log_write(fclog_trans, 'ts|R-AD|ts|ts|ls|ts\n\ alem(TIKEOUT_REV) ; tiaestamp(DATE.rθRHλT) , src, dest, •If 0 asg_ld, gecheadertmsg) ϊ ; fprintflpd, *ts\n*, waTE INTERJ-ACE) ; proceaβ_poll.rev(dest, src, msg, msg_ld) ; fprintflpd, *td\n*, WOATE ID) ; . return 1; •endlf ) fprintflpd, *ts\n", CLID): ) fprintflpd, *ts\n", tlmestiatplDATE-JTORHAT)) ; alara(O); fprintflpd, "ts/ts\n", valldat* ptr(>i**t), valldat*jptr(msg-j.d) ) ; return 0; fprintflpd, *ts\n*, validatejptr(asg))) ) fflush(pd); pclose(pd); int process poll rev (const char *dest, const char *src, const char *msg, const char *msg_ld) | alara(O); PILE 'pd; int pid; •if 1 char CWD[MAXJ?NOJ.EN*ll; /* No logging until locking is implemented. */ log.write(fclog_debug, *ts{REV|executed ts for ts.Nn', if (Isrc || Idest II Imsgl ( timestam (DATE_rORHAT), PJ£V_λOEOT, CLID):
/* Ill-formed request •/ •endif retum 0; ) exit(O); if (Istrcap! src, ESME.PUO) 1 (
/* Originated froa me. Convert to HSISDN so that th* a*asag* will -stop after single pass. */ strncpy! CLID, ESME_KSISDN, sizeof(CLID) ) ; ) else ( strncpy! CLID, src, sizeof(CLID) ) ; )
CLIDIsizeof ICLIDl-l). 0;
7/28/00
sms.c •include "sms.h* stetic const char cvsidll - '(Id: sms.c, v l. l 2000/03/09 03 :12:32 rhk Exp (" ; int a*g_ld_Create ( char -buffer, elze.t buffersize)
( static timβ_t prev_time» 0;
*t«tic int counter- 0; time_t cur.time" time (NULL) : If (cur_tiae «• pr«v_time) { counter**;
) else I counter. 0; ) prev.time" cur.time; snprintf (buffer, buffersize, " 03u" , counter) ; 1
©
smppmain.c smpp ain . c
•include <«tdio.h> •includ* <«tdlib.h> sbrk(8'1024); •includ* <atring.h> •includ* <uni*td.h> sprintf (proctitle, *ta-td.ts- APPNAHE, ID, module) ; •includ* <*ignal.h> setproctitle (proctitle) ; •Include '•mppd.h' •Includ* "«mppccαa.h' err_add(fcsj-pp.err_entry) ; errsdd(fcsmscsmpp.err.entry) ;
LOG iog_tr*ns, log.err, log_comms, log pld, log.debug; err.add(fccoa.βrr_entry) ; int IsClient) err_add(fc»m_err.entry) ) int fERX ' 0) log_open(fclog_pid, g*t.fiiβ_name (PID_rlLE, module) , 'wt' ) ; int fxloCleanUp- 0) log_write(fclog_pld, "td* , getpldO ) ; char proctitle12561; log.cloae!fclog_pid) ; void cleanuplvold) { log.open(fclog.trans, get.fil*_naaβlLOG_rILE, module) , NULL)
/* Called when exiting or signalled. */ log_open (fclogsrr, get.file_name(ERR_*ILX, aodule) , NULL) log^open|fclog_comαs, get.file_namelCOKH_wILK, module) , NULL)
If ( I fNoCleanUp) SHPP_disconnect ( ) ; log_open|fclog.debug, got_flle_name(DEBUG_PILE, module) , NULL)
) log_write (fclogsrr, "t» INITVn" tlautaap(DATE_"ORHAT) ) 1 void sighupdnt n) ( log_write(fclog_comms, 'ts INITvn" timestamp (NULL) ) : cfgi) ; log_write (fclog.comms, "ts I SIG| reloaded configuration. \n" , log_write(fclog_debug, *t»|CONf |HOST"{ts) PORT"(td) \n* , ti***»teaplDΛTE_PORHAT) ) ; 0* timeetemp(DATr_rθRHΛT) , SMSCJ10ST, /" To-Do ιw (isClient? SHSC.PORT.TX: SMSC-J?ORr_RX) I ) i. Close end re-open logs. log_writ* (fclog_debug, *ts|COHr|lD*(t*) TYPsXts) Λn" ,
2. Re«et queues. timestamp (NULL) , SMPPJCD, SM7P.TYPI) >
3. Reset clocks. log_write (fclog_debug, ts|C0N7|KSISCN*(ts) PNO*(ts) Λn" ,
4. flush? timestamp (NULL) XSMt^yiS SOH, ES*u"S*NQ) 1 log_writ*(fclog_debug, t lCONrlJtSME TON/NPI« (td/td) HS TCM/NPI« (td/td) Λn' times tamp (NULL) ESKE TON, ESME_NPI, XS_TON, KSJ1PI) ; cleanup!) ; log_write(fclog_dβbug, t*|TONr|REQϋEST CONTIRHATION. dd) Λn' , signal(SIGKUP, sighup) ; timestamp(NULL! REQUEST.CONT IRHATION) ; 1 signal ISIQHUP, sighup); void sigintϋnt n) ( signal (SIGINT, sigint); static int counter- 0; signal (SICUSRl, sigdrop); log_write(*log_cc«ms, *ts|SIG|interrupt signal received !td).\n", alara(O); tlMstamp(DΛTE_FORKAT), counter); signal (SIGINT, sigint) ; tiβe_lnit()ι counter**; dt. »trdup(time*tamp("tytmtd") ) ;
/* if interrupted for more than four times, clean-up must be hung up. Bypass it and exit. cntl" cnt2* 0; cf.0) if (counter > 4) fNoCleanUp- 1; atexit(cleanup) ; log.write{fclog.cocmαs, ts|lNTR\n', timestampIDATE_FORMAT)); exitlO); If (IsClient) {
) queueseset(QUEUIJPIR); /* queue used by client only */ 1 void sigdrop(int n) ( cleanupO ; - while (!) ( log_write (fclog_cocass, "ts |SIO|user_l signal receivedΛn" , . usleep<DELAY_ACTIVE); timestamp (DATE_70RHAT) ) ; f. time_check() ; signal (SICUSRl, sigdrop) : ) If (f fc 0x04) (
/* On* hour has elapsed, */ int mainprocdnt bclient) ( log.write (fclog_comms, *ts|CKECX\n* , int f, r; timestamp (DATE_IORHλT) 1 1 int cf; ) long cntl, cπc2; if (f fc 0x10) { char *dt, *dt2; // A day has elapsed... static char buff[10241; const char server!]- *-rx'; log.close(fclog.debug) ; const char client!!* '-tx': log_clos*(fclog_*rrl ; const char 'aodule; log.close(fclog.comms) ;
IsClient. bclient: dt2» dt; aodule* (IsClient? client: server) ; if (Idt2) dt2- "old";
/* Ccaeaoπ to server fc client */ /* To Do: Bound-check or assert buff */
7/28/00 7/28/00
smppmain.c sprintf! buff.'ts.ts", get_file_name(DEBUG_FILE_OLD, module), dt2) ; rename! get_file_naae!DEBUG_FILE, module), buff); aprintfl buff.'ts.ts*, get_fllesame(COHHJ"ILE_OLD, module), dt2); rename! get_fllesame(COHH_rlLE, module), buff); log_wrlte!ilog_trans, *ts|LOG|Logs rotatedΛn", tlmeatamp(DATE_FORHAT) I ; log_open(ilog_debug, g*t_fil*_name(DEBUG_riLE, module), NULL); log_open(fclog_comms, get_file_nametCOMM_FILE, module), NULL); log_cloβe(*log_trans) ; spr ntf! buff, "Is.ts", get_file_name!LOG_FILE_OLD, module), dt2); rename! get_file.nemeILOG.FILE, module), buff); log.open!fclog.trans, get.file_name(LOG_FILE, module), NULL); log_write(fclog.trans, "ts| LOG | Previous log renamed to ts.\n", timestamp (DATE.FORHAT) , validate ptr (buf f ) ) ; if (dt) free(dt); dt* strdup ( timestamp { * tyt td' ) ) ; )
If (ISW) continue; cntl ♦• DELAY_ACTIVE; entj ♦• DELAY-ACTIVE;
If (cntl >• DELAY_QUEUE) { cntl -■ DELAY_QUEUEl if (isClient) I cf* process_queue{) ;
) else ! cf« processjpoll!) ;
) ) if llsClient fcfc cf <" 0 fcfc INΛCTIVITY.THRESHOLD > 0 fcfc cnt2 >• INACTIVITY_THRESHOLDI I
SXPP.disconnect ( ) ; cnt2*.0; ) cf* 0; ) log.write lfclog_trans. 'ts|QUIT\n', tlmestamplDATE_FORHAT) I ; log_writelfclog_comms, "ts|MAIN| exiting.. Λn", times tamp (NULL) ); cleanupO; retum 0;
)
wmail.beast wraail.beast
Figure imgf000113_0001
7/28/00
wmail. beast w ail. beast
(DBOATE " (_; (header ." (_; if ((((DEBATE) || ((DATE > (DBDATE) I ( s/[\r\n]*/\n/g; close (DB) ; s/\»*(//g; openlDS, ">(CACHEDIR/(cfg.db") ; if(/-rrom /) I prlntlDB "(DATE\n"l; ( allfrom - (_; for((i • 0; (i <> (•channel; (i**) ( next; (cchan • split('\|', (channel !(i] ) ; ) (cchan[0] ■•- s/\s+//g; if(/"\»"(/) t (echanϋl »-.s/\s*//g; last; lf((cchan[0] eq (CHANNEL) ( ) lf((cchan[2J < 1) ( ((key, (val) - split!' ', (_. 2);
.error! "(PROVIDER! (CHANNE | quota reachedl'l ; (header{(key) - (val; ) )
(echan[21 — ; ) (_ « <STDIN>; prlntlDB "(cchan[0) |(cchan[2]\n") ; »/\»*S//g; ) (PROVIDER - (_; ) (_ - <STDIN>: else ( »Λ»*(//g; (j • 0; (CHANNEL » (_l whil*((_ • <D8 ) ( (_ » <STDIN>; •Λs*(//gι »/\s+(//g;
KechanKj], (equota[(jJ) . split('\|', (.1 ; (VBDATE ■ (_; (cchanKi! •- s/\s*//g; (_ » <STDIN>; (c uotalCJ) »- s/\s*//g; s/\s+(//g; lf((cchan[(j] eq (CHANNEL) ! (HASHCODI « (_; lf((cquota[«) < 1) i (TEXT - " ;
_error("(PROVIDER|(CKANNEL|quota reachedl •) ; while(<STDIN>> ! (TEXT .. (_; )
(TEXT — s/\s*/ /g;
(cquotaKJl — ;
) ((BDATE, (BTIHE) * splitlΛs*/, (VBDATE);
(J**: 8BDATE - spli !/\//, (BDATE);
1 βBTIME - split! ' : ' , (BTIHE) 1 close (DB) ; (BDATE - sprintf Cl04dt02dt02d*. reverselβBDATE) ) open(DB, ">(CACHEDIR/(cfg.db") ; (BTIHE - sprintf Ct02dt02d", 8BTIKE) ; prlntlDB "(DATE\n'): torld • 0: (i <- (tcchan; (I**) ( θmfrom " split !/\s+/, (mallfrom) ; printlDB "(cchanld] |(cquota!(i]\n'); (SRC « $mfrom[l];
) (D • Smfrom[4]; ) (H - (month((mfrom[3]); close(DB); (Y - (mfrom[6]: flocklLOCX, (LOCK.UN) ; (RDATE ■ sprintf Ct04dt02dt02d", (Y, (M, (D) ;~ close (LOCK); sub mail.info sub msgsubmi I (inf ch*ck_limlt(); (inf ,- "DATE-(DATE/(TIHE\n" ; (inf .- "SRC/RDATE-SSRC/SRUATENn";
(TEXT ' •(chan(l): (TEXT'; ( nf .- "PROVlDER/CHANNEL-(P!jlOVIDER/(∞λNNEL\n'; (TEXT ' substrKTEXT, 0, (cfgl' axlen'J) : (inf .- BDATE/BTIHE-(BDATE/(BTIHE\n"l •(inf .- "HASHCODE-(HASHCODE\n" ; ifKcfgCagenf) eq " ) I (inf .« ; srror("(PROVIDER|(CKANNEL|agent not defined! 'li return (inf; ) ) openlXHIT, *| SRO0TDIR/(cfg('agent' ) (chan[3)'l
|| _error(*(PROVIDER|(CKANNEL|cannot execute agentl"); sub cfg parse ( print (XXIT (TEXT); open (CFG, "(CFGDIR/bcast/(PROVIDER,conf") close (XHIT)ι || _error("??7|???|PR0VIDER-(PR0VIDER not registered! "); debugjprlntf Cls\n', | , (i - 0; while{(_ - <CFO>) ( if(/"»/) ( next; ) s/\s*(//g; sub msg_queue f if((_ eq •— ) ( last; ) (tm « tiael); ((key, (val) - split! •', (_, 2); openlQUEUC, *>(QUEUEDIR/b-(tm-SBDATE-(BTIME') ; if ((key ne " ) ( (cfg{(kβy) « (val; ) rint (QUEUE *(PROVIDER\n*) ( ) prlntlQUEUI "(CHANNEL\n"): whlle{(_ " <CFG>> { printlQUIUE "(TEXT\n"l; ((key, (val) - split(Λ|/, (_, 2); close (QUEUE); (chan((key) " (val; ) ) sub msil parse { if(l(cfg{'src')> ( (header - ' * ; .error ("(PROVIDE 177? I src not speclfledl "I ; while ((_ • <STDIN>) (
7/28/00
wmail.beast
1 sub hash_check {
(THPFILI • "/tmp/wail.beast.((•:
(DECRYPT • "(ROOTDIR/crypt/decrypt.(PROVIDER'; open{XTKP, "j (DECRYPT > (THPFILE'l; printlXTHP (HASHCODE); clos*{XTHP); open(XTHP, (THPFILE);
(XDATA • XTHP>;
(XDATΛ •- s/\s*(//g; close(XTHP); unlinkKTHPriLE) ;
It((XDATA ne (RDATE) {
.erro ('(PROVIDERI(CHANNELIHashcode field incorrectl ") i ) ) sub aail_cbeck ( (f • 0)
•SJtC * split('\|', (cfg('src')); for((i • 0; (i <» (•SRC; (l*+) ( If SRC *q SSRCKi]) { (f ■ 1; last) ) ) tf(Kf) (
_*rror("(PROVIDER|(CHANNEL|SRC.(SRC not registered!'); ) channel_get() : ifKh*ader{-Subject') n* *NEWS/SPROVIDER/(CKANNEL') ( _error("(PROVIDER|(CHANN_L|Subjβct field incorrectI ) ; if(length!*(chan[l): (TEXT*) > (cfg( ' axlen')) ( .error!*(PROVIDER|(CHANNEL|Kessage too longl'); ) ifKVBDATE ne 'IKMEDIATE'I ( if((BDATE < (DATE) (
.error("(PROVIDER|(CHANNELIBackdated messageI ) ; ) lfldate_v!(BDATE)-date_vl(Dλτε> > 31"3) (
_error("(PROVIDER|(CKANNEL|Hessage dated more than 3 months in the futurel'); ) )
1 sub chennel_get ! βchan - ((CHANNEL. aplit ( Λ | / . (chan ( (CHANNEL) ) ) ;
If Ktchan < 1) {
_error( "(PROVIDER| ?7? |CHANNEL.(CHAlJNEL not registered! 1 ;
1 ) sub dates { ay ((date, (Y, (H , (D, (vl ;
((date) • (8_) ;
(Y - substrKdate, 0, 4) ; '
(K * substrKdate, 4, 2)
(D » substrKdate, 6, 2) ; (V • KY*372) *( ((M-l) '3l) * [(D-l) ; retum (v; )
SRCS. sappd.c smppmain.c s ppext.c smppcomm.c OBJS- ((SRCS:.c.o)
HAKEDEPENDaaakedepend cc»gcc
CFLAGS.
CCWCLUDES—K (ROOTDIR) /include
CCLIBS"-L( (ROOTDIR) /lib
KXCONP*( (ROOTDIR) /bin/mkconf all : ( (OBJS) debug: ( (OBJS)
.c.o:
(ICC) ((CFLAGS) (ICCINCLUDES) -c (< sappd.c: sappcfg.ccf smppd.h; smppcfg.hcf conf: sappcfg.ccf smppcfg.hcf •mppcfg.ccf: smppcfg.hcf smppcfg.hcf: smppcfg.dat ((WCCOKF) (< depend:
(IHAXIDEPEND) -Y -o.c — ((CFLAGS) ( ICCINCLUDES) — ((SRCS) t DO NOT DELETE
•mppd.c: smppd.h smppcfg.hcf .. include/common.h smppcfg.ccf eappaaln.c; sappd.h smppcfg.hcf ../include/common.h smppcomm.h sappaaln.c; ../lnclud*/sasdtk_a.h ../lnclude/smsdtk.t.h . ,/lnclude/smsdtk.e.h h- smppext.c: smppd.h smppcfg.hcf ../ nclude/common.h smppcomm.h h- sappext.ci ,./lnclud*/ssLsdtk_a.h ../lnclude/smsdtk_t.h ../lnclude/smsdtk.e.h Ul •appcoma.c: smppd.h smppcfg.hcf ../Include/common.h smppcomm.h sappcoma.c: .. lnclude/smsdtks.h ../include/*msdtk_t.h . ,/lnclude/smsdtk_e.h
wmail,wgate wmail.wgate
• ! /usr/loca /bin/perl if ((rev.ag nt) { us* Socket; • Old R -style use IMP: :UserAgent; eval ( requireC(R0OTDIR/(rev_agent") ; ); us* HTML: iTreeBuilder; exlt(2)lt ((8); . us* HTKL::Entiti*s qw( deeode.entitles tentlty2char ); us* URI::Escap* qw{ uri.sscape ); us* Dig**t: :HD5 qw( ad5Jpase64 }; us* G*topt: :Long; . loc»l (DlVCPOSIXLY.CORRECT')- 1;
BEGIN I
(rootdlr- (ENV('LAVA_HOME' ) || /usr/local/wMail' ) us* lib "(roocdir/include"; require "waail-OO*;
Figure imgf000117_0001
requir* *wmail-userdb*; (APPNAHE — s/\s+(//g; require 'dbgeneral' t (ID — s/\s*(//g; r*qϋlr* 'qsc'; (PNO — »/\s*(//g; (THSTAHP — s/\s+(//g; f This cod* recursively calls itself with x' to execute an IOD script. (MSG — s/\s*(//g; local top ions- toptions if (toptions) ; GetOptionsl\toptions, *debug:s*, "testing:!*, 'x'); ((SRC, (SEQID) • split / : /, (ID, 2; local 'DEBUG* \"DEBUG if ('DEBUG); if (substr((PNO, 0, 1) eq. '*' ) ( if ((options! 'debug')) ( if (substrKPNO, 0, 3) eq **65 ' ) ( open DEBUG, ">(optionβ{ 'debug' )*; (PNO - substrKPNO, 3) : ) elsif (exists (options('debug' )) { )
DEBUG- X'STDERR; ) ) wgate_main ( ) ;
InltO; wgate_inlt(); I — wgαte —
^ di* *R*quir*s RO release 2.3 or higherΛn' if ((ENV( 'RO.VERSION' ) < 2.02); •ub wgate.lnlt { my ((1, βx, βpl, βpo) ;
°^ ifKoptions('x')) (
(EXE - (ARGV[0J; (WGATE . "(ROOTDIR/wmall.wgate";
' (PID - (ARGVll);
(THPFILE • '7tmp/wgate.tmp.(PID'; opentCFG, "(CFGDIR/wgatβ.conf"ϊ ; openlTKP, (THPFILE); while (<CFG>) ( (ARG * <THP>; If (/-\s'(/l ( next; (ARG — s/\s*(//g; If (/ \i/1 { next; ) close(THP); s/\s*(//g;
8x - spllt{/\|/, (_)ι local (tree- new HTML: :TreeBuilder; for l • 0; (1 <« (»x; (!♦♦) locel ttree.ignore.tags; (x[(i) s/\s*(//g;
(tree->handler( 'start' » \fcstart_handler, 'self, tagname, attr", )
'end' ■> \fcend_handler, 'self, tagname, text', (svc * () ;
'text' »> \fctext_handler, 'self, text, is_cdata, dtext", IfKxlOJ eq " I next; )
'comment' -> *, ((svc ( 'cmd' } (x[0J ;
'declaration' ■> ", ((svc( 'exe' ) (x[l) ;
'process' -> "'): ((svc( 'quota' ) int((x[21 ) (tree->unbroken_text(1) ; ((svc( 'In' ) I) ; ((svc{ 'out' ) (1 ;
•ARGV • eplit(/\s*/, (ARG) ; βpi • split! ' . (x[31 ) ; ay (res- eval ( require C(ROOTDIR/wgate/(EXE" I ; ) ; βpo • split! (x[4] l ; for((i • 0; (1 <* Sipii (i*+) (
(tree->delete ( ) ; (pi Id] • int((pi[(i] ) ;
) it <!(») ( forKi • 0; (i <• («po; (i+*l I while ( ((key, (val) • each IENV I ( (po[(i) • int pol(i)) !
If ((key — /-IOD_(\w*l(/) ( ) print "\n\t\t(l-(val\n'; push(β(((svc( 'in' ) ) , βpi) ;
) push(β(((svc( 'out' } > , βpo) ; 1 (x!0] »- tr/a-z/A-Z/; ) (WGATE((x[0] ) ■ (svc;
) exltKβ); ) close (CFG) ;
(revsgent- shift; opentCFG, *(CFGDIR/wgate.msg*) ;
wmail wgate wmall,wgate while (<CFG>) { (MSGE - sprintf((HSGT, βλRG) ; if(/-\s'(/) ( next; ) wrlteLog("(LOGDIR/wgate.err", '(DATE (TIME|NAK|(ERRT|(PNO|SMSG\n'l ; if(/-\t/l { next; ) »end_err((PNO, (HSGE): s/\s*(//g; exitlO): βx . split (Λ|/, (_>; for((l • 0; (i <• (»x; (.♦♦) (
(x!(i) — s/\s*(//g; sub wgate_notice ) 1 (WGATE_HSGI(x!0]) " (x(U; my ((ERRT, (PNO, (HSG, βλRG, (HSGT, (HSGE) ;
) ((PNO, (HSG, (ERRT, βλRG) ■ β_; close(CFG) ;
(HSGT - (WGATE_KSO((ERRT); openlCFG, '(CFGDIR/wgate.nυm') ; (HSGE - sprintf((HSGT, βλRG) ; while«CFC>) I writeLo fSLOGDIR/wgate.err", '(DATE (TIME|NAX|(ERRT|SPNO|(MSG\n'l, if(/-\s'(/) ( next; ) sβnd_inf((PNO, (HSGE); if(/-\«/) ( next; ) exitlO); s/\s*(//g; βx • split(/\|/. (_): ) for((l - 0: (1 <- («x: (i**l ( sub wgate.quota.check {
(x[(i] — s/\s*(//g; my ((PNO, (SVC, (QUOTA) » »_; ) my (ri
(WGATE_NUM((x!01) . (xll)ι ) (r* user.query("wgate/quota", "query", (PNO, (SVC); close (CFG); if (0) { openfSVC, "(CFGDIR/wgate.svc*) ; user.queryCwgate/quots", "add", (PNO, "WGATE-SSVC, (QUOTA); whileUSVCM ! ' return (QUOTA; lf(/-\s*(/l I next; ) ) if(/-\t/) I next; ) s/\s*(//g; retum (r; βx . spllt('\|', (_); torld • 0: (I <• (Ix; (i**l !
(x[(i) .- s/\s*(//g; sub wgate.quota.dec ( ) my ((PNO, (SVC) - β_:
(WGATE_HELP((x[0] ) . Sx[l] ; pushlβWGATEJUXP, (x!0]l; if ( lwgate_quota_is_excluded((PNO) ) ( ) user.queryCwgate/quota', "dec", (PNO, (SVC); close (SVC) ; sub wgate_get_svc { ) my (Sid, (inp, (outp, (svc, (r) ; Kid, (inp) - β_; sub wgate_quota.is_excluded I my (PNO- shift;
(svc • (WGAT ((id); if l((svcl 'cmd' ) ne (id) { retum (undef, (inp, 1); } (wgatesxclude - "(CFGDIR/wgate. exclude.1st" open! EXCLUDE, (wgate.exclude) ;
(r* user.queryl"wgatβ/eubscription" , "service', (PNO, (id); while («EXCLUDE») ( s/\s+(//g; if (I defined (r) { ifKPNO eq (_) ( i not a subscriber close (EXCLUDE); undef (svc; retum If (outp* 3; ) ) elsif (Sr < 0) (
• error ) undef (svc; (outp- 2; )
) elsif Kr " 0) (
• no service for this user sub vgate-main ( (svc* 0; (KTA ■ (APPNAHE;
(outp.3; (hHTA " (MTAif HTA); ) else ! (AGENT.EXE » "(APPNAHE/send" i okay (AGENT.TST - *(λGENT_lXE -i0"l (outp- 1; (AGENT_ERR » '(AOENT EXE -i3"; ) (AGENT_INF - '(AGENT.EXE -i2"; (λGEOT.OUT " '(AGENT_EXE -il"; return Ksvc, (inp, (outp) ; ) • NBS support
(REGEX » '»".quotemeta('//SCK'l: sub wgete.error t lf((HSG — /(REGEX/1 ( my KERRT, (PNO, (HSG. βλRG, (HSGT, (HSGE) ; send_nbs((PNO, (KSG) ; KPHO, (HSG, (ERRT, βλRG) > β_; exitlO);
)
(KSOT • SWGλTE_HSG!(ERRT); 7/28/00
wmail. gate wmail.wgate
Figure imgf000119_0001
;
ACK|(PNO|(HSG|(dt|(res\n") ; ACK|(PNO|(HSG|(out\n'l ;
Figure imgf000119_0002
t execute wGate script (tl > timed; ) else I print(STDERR '(TYPE/SPNO: (HSG\n*);
(THPFILE - "/tmp/wgate.tmp.SS'; ) open(TMP, *>(THPFILE-) ; printlTHP *(HSG\n"l; close(THPI; sub send_msg ( my ((PNO, (HSG); ay (out; KPNO, (HSG) » β_l open! EXE, '(WGATE -X (EXE (( I'); while (<EXIM ( _send('AGEOT_OOT', (PNO, (HSG); chomp;
wmail. gate wmail. gate sub aend_inf ( sub spllt.flelds ( my ((PNO. (HSG) ; return split! '\|\ (_[0J); KPNO, (HSG) - β_; )
Figure imgf000120_0001
wmail. wgate wmail.wgate
(DλTλ- <_CλCHE>; sub url.split { Close (.CACHE) ; my ((URL, (prot, (hostport, (path, (host, (port) ;
((URL) » β_; return (I, (DλTλ) ; Kprot, (hostport, (path) " splitlA/*/, (URL, 3) ;
((host, (port) • split ! ' : ' , (hostport, 2) ; if ( Kport) I (port » 80; )
(path " "/(path* ; retum {(prot, (host, (port, (path) ;
) 1
• w3grab sub cgi.encode ( my ((REGEX, (data) ; sub w3grab { ((data) < β_; return wlgrab.vl (β_l ; (REGEX » ' ( I * .quotemeta ( ' fc" ( ) β, ; Λ></ [ ) ?f ) . ' ] ] ' , ) (data — s/ \xff/g;
(data ■- s/ Λ+/g; sub w3grab_vl ( (data »- s/(REG_X/cgi_encodes ((l) /ge; ay {(MODE, (HETHOD, (URL, tFORM) ; (data ■- s/\xff/cgi_encode„s( '+' ) /ge; ay ((HEADER, (DλTλ, βform. βkey, (i); retum (data; ((MODE, (HETHOD, (URL, tFORH) > β_; ) if((FORM("»*DATλ"*') ne ' ( sub cgisncodes { pushlβform, (FORK("**DATA* )); my Kc) ■ β.; delete((FORH( ""DλTλ"* ' ) 1 ; (c - substrKc 0, 1) ; return ' t ' . sprintf ( • t02X* ordKc) 1 ; β )key - sort(keysdFORH)); ) forKi • 0; (1 <• (»key; (i**) ( pushtθform, cgi.encode((key[(i] 1. "".cgi_encode((FORM((key[(-])]) ; sub strip_html | my tinside;
( )DATA » -JolnCfc*, βform);. my (ret;
(HEADER * 'Conten -Type: appllcation/x-www-forro-urlencoded\r\n*
.•Content-Length: • .lengthl(DATλ) .'\r\n'; (tag* sub { myKtag, (numϊ " β.;
W3grab_v2 ((HETHOD, (URL, SHEADER, (DATλl ; (inside{(tag) *" (num;
) (ret . » " I ' ; # not for all tags
^ sub w3grab_v2 ( ); my ((METHOD, (URL, (HEADER, SDλTλ, tOUT, (OUTfile) : (text" sub( ((KITHOD, (URL, (HEADER, (DλTλ) > β_; return if (inβide(script) [| (inside(style) ;
(ret .> deeode.entitles((.toll ;
(OUTfile » "/tmp/ .wmail.wgate.(C; )l open(EXE, "I (R00TDIR/bin/w3grab -dPλRHS_EXTENDED > (OUTfile"); printlEXE "URL: (URL\r\n"l; HTML: :Parser->new(api.version » 3, prlnt(tXI "Method: SKETH0D\r\n" ) ; handlers «> [start "> [ (tag, 'tagname, '*!" 1, prlntllXI "Define: HTTP10\r\n") ; end "> [ (tag, 'tagname, '-1'" 1, printlEXE "Define: PλRHS_HEλDER\r\n') ; text »> [ (text, 'dtext" ] , printlEXE "Define: PARHS_DλTλ\r\n'l ; 1, printlEXE "\r\n"l; markedsections " 1, printlEXE "(HEADER"); )->parse(shift) ; printlEXE "\r\n"); printlEXE '(DATA*); return (ret: closeIEXE); openlDAT, (OUTfile);
(OOTCKTTP.header') . "
(OUT{'HTTP.body') . "
(0UT{ 'HTTP.res') • <DAT> whlle«DλT» ( if(/*\s*(/l ( last; )
(OUT('HTTP.header') .. (_;
) whileKOAT>) (
(OUT('HTTP.body') .. (_;
} clos (DAT); unllnkKOUTflie) ; cheap (OUTCHTTP.res' ): ay βres- split " ', (OUT( 'HTTP.res') , 3;
(res[11- 0 it Kresll] " 200); return Kresll). (res [2], tOUT) ;
7/28/00 7/28/00
e;
Figure imgf000122_0001
) ) ,
Figure imgf000122_0002
logjprint "\n—(cur_date—\n', if ((bound) { print DUHP *\n—(cur.date—\n*. If (/-Content-(\w*)/i) ( debugjprint "DEBUG"<(debug>, TEST.LEVEL-<(testrng>', debugjprint 'Caught (.": ay (pno" shift or quit, my (tag" (1; (pno "- m/~(\d*)(/ or quit, (pno- (1; If ((tag — /Λtype/l) { — logjprint "PNO* <(pno>", (text- ((_ — /text\//l); debugjprint "Set text mode" if (text, if Kpno ■- S/-0/1/) ( ) elsif ((_ — /filename\s'»\s'\"(!-\']*)\'/-l ( 7/28/00
if (defined (1) ( logjprint •ENOTFY-<(enotfy( , switch' ]>, EFILTR-<(eflltr( 'switch' )>' ; debugjprint "Pushing (1"; (logjprint ( 'No notification. ') , quit) unless (enotfyC switch' ) «« 1; push βfiles, (length (1 > 161? substrKl, 0, 161 . '...': (I: my (βfriends, βsubjects) ; )
) If ((efiltr! 'switch') « 1) (
) elsif (/*(/) ( (rv- (dbh->selectcol_arrayref
(bound- 0; I 'select friend_list from acct_email_friend_list " debugjprint "Out of bound." . 'where account_id * (Id*
) ); βfriends* β(rv; next; ) (rv* (dbh->selectcol_arrayref ) { 'select subject_list froa ecct.email.subject_list *
. "where account_id " (id* if ( Kmime | | (text) ( ); (_ ■ strip-aarglnK., 1) ; βsubjects* θ(rv; pusblβbody, (_) if ((_ ne " ) ; ) (rv* (dbh->selectcolsrrayrβf
1 ( 'select header_list from scct_emall_heeder.list *
. "where account_ld * (Id" my ((subject, (sender, (sendersame, βfrom, βreply, βdate, (date) ; ) ; βbody* β(rvι
(subject" (he*der->get('subject'); βreply" Hail: :λddress->parse( scalar (header->get( 'mail-froa' ) ); βrv* (dbh->selectrow_srray βfrcfs* aallι:λddress->parse( scalar (header->get{ ' from' ) ); I "select aessage_liait, starttlmel, endtimel, starttlme2, endtime2, *
(s*nd*r_naa*« (froa[0)->nam*() if r*f (from[0}; . "counter, counters***"^ '
(sendar- (froa[0)->address() if ref (from[0) ; . "from acct.email.advfilter_profll«, dates ' chomp (s*nd*r; . 'where dates, account_ld * acct_email_advfilter ?rofile. accountsd
(send*r* (reply[0)-»address() ; • if ((sender eq ' ' fcfc ref (replylOl); . "and acct_ematlsdvfilter_profile.*ccount_id * (id"
) ; chompKsubjsct, (sender, (sendersame); βefiltr! qwllimit wdstart wd_end westart wβ_end counter date) ) ■ (subject* '777' if (subject eq " ; . βrv[0 .. 6] ) (sender* '777' if (sender eq "; while (ay ((key, (val) - each tβfiltr) ( debug_print 'address: ((sender), ((sendersame)'; debugjprint 'FILTER: <(kβy>«<(val>" ;
Is) Is) )
(body. substrljoinC ', βbody) , 0, 160 • 4); my ((start, (end) ; debugjprint *TIKE.<(cur.timestamp>'; dabugjprlnt "FROH"<(**nder>*; if Kcur_time[6) «* 0 1 1 (cur_time[6J »* 6) { debugjprint 'SUBJECT.<(subject>"; • Weekend debugjprint "BODYx", substrlSbody, 0, 32), > ", lengthI(body) ; (start- (efiltrCwestsrt'J: (end- (efiltr( 'we.end' ) ; my ((src, (filtered, (matched, (over.iimit) ; my ((id, tenotfy, teflltr, talias) ; ) else (
• Weekday
(dbh* DBI->connect( *dbi : Pg:dbname.dbgeneral' , *vcom") ; (start- (βflltr('wdstart');
(log print( 'Cannot connect to database: (DBI: : errstr. ' ) , quit) unless (dbh; (end- (efiltr('wd_end')l )
(rv* (dbh->do( 'set etestyle to *lso") ; d*bug_prlnt "S*t datestyle to ISO <(rv>. ' ; debugjprint "STλRT-<(start>, NOW-<(cur_time>, END-<(end>';
(Id" (dbh->aelectrow.array if ((start < (end) {
( 'select accountsd from account where user_name . '(pno' *) ; if ((cur.time < (start | | (cur.time > (end) ( debugjprin (*P»0.<(pno>, ID*<(ld>'l ; debugjprint "<(cur.timβ> not between <(start> and <(end>. "; logjprint Outside the notification hours. " ;
(logjprint ('No ID. ") , quit) unless (id; quit; )
(enotfyl 'switch' ). (dbh->selectrow.array ) elsif ((start > (end) ( { 'select switch from * if ((cur.time < (start it (cur.time > (end) ( . *accts*rvice_switch, service_desc ' debugjprint "<(cur.tlme> not between <(start> and <(end>."; . 'where acct_service.switch. account.id « (Id ' logjprint "Outside the notification hours. ": . "and βervlce.desc . service.cmd - 'ENOT' * quit;
. "end service_desc.service.id « acct_serviceswitch.service_id' ) ) ; )
(efiltrCswltch' )■ (dbh->selβctrow_array my (last_datestamp> (efiltr( 'date' };
( "select switch from acct_service.switch, service.desc (last_datestamp — tr/-//d; , ' here acct_serviceswitch. accountsd ■ (id " (βfiltr{ 'counter* )■ 0 if ((laβt.datestamp < (cur.datestamp); . "and service.desc . service.cmd - 'EFIL' " debugjprlntf "WRONG LλST DATE I") if Klast_datestamp > (cur.datestamp);
. 'and service desc . ervicβ.id > acctservice_switch.service_id' I ; if ((efiltrC limit') > 0 fcfc (efiltrCcounter' ) >- (efiltrl 'limit' ) ) ( log_print "Reached the message limit.*;
7/28/00
Figure imgf000124_0001
ss (body eq
Figure imgf000124_0002
βrvw (dbh->selectrow_erray debugjprint 'MSG: (msg';
( "select sddress.id, notification_id, essage_len_id
. "froa ecctsmail profile where aceount_ld > (Id* quit if (msg eq ' ' ;
); βenotfy( qw liss format length) ) > θrv!0..2]; sub set_iod ( while (my {(key, (vel) « each tenotfy) ! my (key- shift or return; debugjprint ("SETTING: <(key>-<(val>") ; my (val- shift;
(ENV("\UIOD_(key")« (val; if ( (enotfyC alias') — 2) ( ) • Aliasing sβt_iodCevccode', 'REHA');
(rv- (dbh.>selectall.arrayref s*t_iod('eol', *\W')ι
( 'select long.emsil, short.email from acct.email.address" set_iod('eof '. '\W'l; . where account_id - (id' sβt_iodC title', ");
7/28/00
βet.iodl 'header' , *%n/Va '); i (SMAXLEN > 0 fcfc length(SMSG) > SHλXLE ) ( s*t_iod( ' footer' , ' ...'); my Sappeπdstring* SFOOTER; s*t.iodCm*x'. (S*notfy( 'length' ) « 2)? 4: 1) ; my Sprependstring;
»et.iod( 'revβrse.out' , 0) ; my βparagraphs; set.iod(*maxlen', 159); my (Scur_pos, $prev---pos) ;
# t{ot really accurate, but good enough. my Smargin* length(STITLE) + length($HEADERJ + lengt (SFOOTER) ;
Figure imgf000125_0001
tl-

Claims

WHAT IS CLAIMED IS:
1. A method for enabling wireless data flow to and from a application server via an SMSC comprising the steps of: setting up a list of authorized user accounts; composing a short message; sending the short message from an end user to the SMSC; relaying the message from the SMSC to the application server; authenticating the short message relayed to the SMSC; if authentication is successful, parsing the short message and issuing a command from the application server; sending a command result to the application server; generating a response to the command result at the application server; breaking the response down into small segments; and sending the segmented response through the SMSC to the user.
AMB PAS368373.1-*-8/l/01 5:35 PM
PCT/US2001/024386 2000-08-03 2001-08-03 Software for enabling wireless data flow WO2002013500A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
AU2001284707A AU2001284707A1 (en) 2000-08-03 2001-08-03 Software for enabling wireless data flow

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US22289600P 2000-08-03 2000-08-03
US60/222,896 2000-08-03

Publications (1)

Publication Number Publication Date
WO2002013500A1 true WO2002013500A1 (en) 2002-02-14

Family

ID=22834177

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2001/024386 WO2002013500A1 (en) 2000-08-03 2001-08-03 Software for enabling wireless data flow

Country Status (2)

Country Link
AU (1) AU2001284707A1 (en)
WO (1) WO2002013500A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5734831A (en) * 1996-04-26 1998-03-31 Sun Microsystems, Inc. System for configuring and remotely administering a unix computer over a network
US6115384A (en) * 1996-06-20 2000-09-05 Fourelle Systems, Inc Gateway architecture for data communication bandwidth-constrained and charge-by-use networks
US6119155A (en) * 1995-12-11 2000-09-12 Phone.Com, Inc. Method and apparatus for accelerating navigation of hypertext pages using compound requests
US6230004B1 (en) * 1997-12-01 2001-05-08 Telefonaktiebolaget Lm Ericsson Remote procedure calls using short message service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6119155A (en) * 1995-12-11 2000-09-12 Phone.Com, Inc. Method and apparatus for accelerating navigation of hypertext pages using compound requests
US5734831A (en) * 1996-04-26 1998-03-31 Sun Microsystems, Inc. System for configuring and remotely administering a unix computer over a network
US6115384A (en) * 1996-06-20 2000-09-05 Fourelle Systems, Inc Gateway architecture for data communication bandwidth-constrained and charge-by-use networks
US6230004B1 (en) * 1997-12-01 2001-05-08 Telefonaktiebolaget Lm Ericsson Remote procedure calls using short message service

Also Published As

Publication number Publication date
AU2001284707A1 (en) 2002-02-18

Similar Documents

Publication Publication Date Title
US6668043B2 (en) Systems and methods for transmitting and receiving text data via a communication device
US6725256B1 (en) System and method for creating an e-mail usage record
US6751299B1 (en) Voice messaging system
US6603838B1 (en) Voice messaging system with selected messages not left by a caller
US7221951B2 (en) Method and system for short message service exchange and teleconferencing
US6233318B1 (en) System for accessing multimedia mailboxes and messages over the internet and via telephone
CN1897619B (en) Communication assistance system and method
US6493673B1 (en) Markup language for interactive services and methods thereof
US7287009B1 (en) System and a method for carrying out personal and business transactions
US6385583B1 (en) Markup language for interactive services and methods thereof
US6421425B1 (en) Automated communications assistant for the sound-impaired
US20020035607A1 (en) E-mail gateway system
US20030147518A1 (en) Methods and apparatus to deliver caller identification information
CN101601272A (en) Call center with resilient context
WO1998003005A1 (en) Method in telecommunication operating service
US6449343B1 (en) System and method for creation and conversion of electronic mail messages for delivery to telephone recipients
US20050152518A1 (en) System and method for communicating with an out of service telephone number
US6570969B1 (en) System and method for creating a call usage record
US8615071B2 (en) Message identification, correlation, recipient authentication, and reception confirmation in multi-event and multi-media environments
US6700962B1 (en) System and method for creating a call detail record
US20080242327A1 (en) System and method for sending sms and text messages
WO2002013500A1 (en) Software for enabling wireless data flow
FI115816B (en) A method and system for distributing bulletins and services over a computer network
ES2257874T3 (en) PROCEDURE AND SYSTEM TO PRODUCE A SERVICE IN A TELECOMMUNICATIONS SYSTEM.
ES2382608T3 (en) Method for automatic conversion of text or similar messages to voice

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ PL PT RO RU SD SE SG SI SK SL TJ TM TR TT TZ UA UG US UZ VN YU ZA ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
REG Reference to national code

Ref country code: DE

Ref legal event code: 8642

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 69(1) EPC (EPOFORM 1205A) DATED: 17.07.03

122 Ep: pct application non-entry in european phase
NENP Non-entry into the national phase

Ref country code: JP