0

Post Transfer Action

I would like to send a push notification (with call properties like callerID and duration) after a Transferred call is complete.  I have tried several "on" events, but I am not getting any calls to my WebAPI python script.

Python code:

from itty import *
from tropo import Tropo

@post('/index.json')
def index(request):
    t = Tropo()
    t.transfer("18005551212")
    t.on(event="hangup", next="/callcomplete.json")
    return t.RenderJson()

# this is never called
@post('/callcomplete.json')
def callcomplete(result):
    print 'call complete'
    # send push notification

run_itty(server='wsgiref', host='0.0.0.0', port=8888)

6 comments

Please sign in to leave a comment.