Closed JustinDupree closed 13 years ago
Same applies for transfer:
from itty import * from tropo import Tropo
@post('/index.json')
def index(request):
t = Tropo()
t.say("Transferring you now, please wait.")
t.transfer("+14075550100", fromaddress = "4071234569")
return t.RenderJson()
run_itty(server='wsgiref', host='0.0.0.0', port=8888)
As with other issues, closed but no answer?
Again sorry. This issue is addressed in tropo.py, by accepting a _from parameter to the "transfer" function. The sample that illustrates its use is at https://github.com/tropo/tropo-webapi-python/blob/master/samples/gh-14.test_transfer.py.
The same convention is used for the _as parameter for the "say" function.
The generalization is that for parameter conflicts with reserved Python words, we prepend with "_".
Confirmed as working for both transfer and call, nice one.
from is reserver and fromaddress is not an available alternate. App I tried, alternated between from and fromaddress (from fails Python validation):
from itty import * from tropo import Tropo
@post('/index.json') def index(request):
run_itty(server='wsgiref', host='0.0.0.0', port=8888)