tropo / tropo-webapi-python

A set of Python classes for working with the Tropo WebAPI
MIT License
85 stars 33 forks source link

Unable to set callerID on call #18

Closed JustinDupree closed 13 years ago

JustinDupree commented 13 years ago

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):

t = Tropo()

t.call("+14075550100", fromaddress = "4071234569")
t.say("Tag, you're it!")

return t.RenderJson()

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

JustinDupree commented 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)

JustinDupree commented 13 years ago

As with other issues, closed but no answer?

egilchri commented 13 years ago

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 "_".

JustinDupree commented 13 years ago

Confirmed as working for both transfer and call, nice one.