tropo / tropo-webapi-php

A set of PHP classes for working with the Voxeo Tropo WebAPI
MIT License
94 stars 50 forks source link

Cast timeout to integer #39

Open undsoft opened 11 years ago

undsoft commented 11 years ago

Hi,

I have recently had an issue with Tropo API.

This fails:

[{"call":{"to":"tel:+13233204009","from":"13233299421","timeout":"40"}} 

While this works:

[{"call":{"to":"tel:+13233204009","from":"13233299421","timeout":45}} 

It took me a while to track this down. It's easy to miss this kind of issues in a language such as PHP.

So I suggest you typecast this in Tropo.

tropo.class.php line 845

 $this->_timeout = $timeout;

to

 $this->_timeout = (float)$timeout;