Skip to content

Instantly share code, notes, and snippets.

@onyxfish
Created April 24, 2010 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onyxfish/377453 to your computer and use it in GitHub Desktop.
Save onyxfish/377453 to your computer and use it in GitHub Desktop.
Learning exercies for http://www.tropo.com
import inspect
# dir()
# >>> ['RuntimeException', 'String', 'TropoApp', 'TropoCall', 'TropoChoice', 'TropoEvent', '__name__', '_handleCallBack', '_parseTime', 'a', 'action', 'answer', 'appInstance', 'ask', 'call', 'callFactory', 'conference', 'conferenceFactory', 'context', 'createConference', 'currentApp', 'currentCall', 'destroyConference', 'engine', 'hangup', 'incomingCall', 'log', 'prompt', 'record', 'redirect', 'reject', 'say', 'startCallRecording', 'stopCallRecording', 'token', 'transcribe', 'transcription', 'transfer', 'wait']
if (currentCall):
log("READ HERE: Incoming")
# log(currentCall) # object instance
# log(action) # undefined
# log(incomingCall) # Call instance
# log(context) # java context object
# dir(currentCall)
# >>> ['__doc__', '__init__', '__module__', '_call', 'answer', 'ask', 'calledID', 'calledName', 'callerID', 'callerName', 'channel', 'conference', 'getHeader', 'hangup', 'initialText', 'isActive', 'log', 'network', 'prompt', 'record', 'redirect', 'reject', 'say', 'startCallRecording', 'state', 'stopCallRecording', 'transfer', 'wait']
# log(currentCall.calledID) # 17738000911
# log(currentCall.calledName) # unknown
# log(currentCall.callerID) # 18057143797
# log(currentCall.callerName) # unknown
# log(currentCall.channel) # TEXT
# log(inspect.getargspec(currentCall.getHeader)) # accepts [self, header_name]
# log(currentCall.initialText) # Test
# log(currentCall.network) # SMS
# log(currentCall.state()) # RINGING
else:
log("READ HERE: Outgoing")
# log(currentCall) # None
# log(action) # create
# log(incomingCall) # nullCall
# log(context) # java context object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment