ConsoleUser
Copyright (c) 2010-2023 Skaion Corporarion, www.skaion.com
This project was developed in part by numerous sponsorships from the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints of Governmental purposes notwithstanding any copyright notation thereon.
All content reflects those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the U.S. Government or Skaion Corporation.
- class PhoneCallImpl.PhoneCallImpl(system, config)¶
This class is the abstract parent that provides the interface to be an implementor in the Bridge pattern with the <no title> class.
Subclassess should provide paths to load proper images and should also provide access to appropriate implementations of methods commonly provided under <no title>
Parameters:
system: a <no title> object which lets us control the remote system
config: a <no title> object defining the current user
- call(dest)¶
Make a call to the given destination. For many phones the destination could be a phone number, but for some it might be a SIP address or whatever makes sense for the phone being used.
- converse(dest, phrases)¶
Have a full conversation, as given by the list of things to say in the phrases list.
If a phrase starts with DTMF the rest of that phrase is treated as DTMF characters to send.
- hangup()¶
Hang up the phone, ending any call that was in progress.
- play(path)¶
Play a sound file that exists on the controlled system.
- say(text)¶
Send the given text through the current call.
- wait(length=3)¶
Wait until there is a strech of silence at least length seconds long
- PhoneCallImpl.get_phone_call(system, config, phone_type=None)¶
Find the correct class to provide the given type of phone call and return an instance of it.
Parameters:
system: a <no title> object which lets us control the remote system
config: a <no title> object defining the current user
- phone_type: optionally, a string matching the TYPE field of the
module we want, values from config will be used if this is omitted
- Return: An instance matching the desired type, or None if no
suitable module is found