Hi there A recommended using of say statement by tropo is as below: { "tropo":[ { "say":[ { "value":"Guess what?" }, { "value":"http://www.phono.com/audio/troporocks.mp3" } ] } ] } but seems current php library does not support this grammar. I tried to use an array as the 'value' parameter, but the json output is different and not working. Is there a workaround for this case? Chao
5 comments
-
Tropo Import Bot Hello, I will attempt to reiterate the problem you're reporting just so that I can assure myself that we are on the same page as to how we can assist you. It seems you are executing the code you posted above and you're getting back some kind of error related to not supporting a grammar. Since I do not see any usage of grammar in your code I'm thinking you may be referring to one of the elements in the code or maybe the grammar you're having trouble with was not copied over. Can you attach a full log output from when you execute your code and let us know what is happening with your app and what should be happening. In the meanwhile I will place this ticket in a pending status awaiting your response. Regards, Tony Taveras Customer Engineer Voxeo Support
-
chao.jr.hd Tony Thank you for reply. Here is what I mean. If you use php library to say something, you will use $tropo->say("something"); $tropo->renderJson(); And this will generate a json response: { "tropo":[ { "say":[ { "value":"something" } ] } ] } Everything is fine with the code above. But I'm having a problem with using array as a parameter to $tropo->say() in stead of using single string. $tropo->say(array("something1","something2")); $tropo->renderJson(); This will generate the json response: { "tropo":[ { "say":[ { "value":["something1","something2"] } ] } ] } but the supported json grammer from tropo documentation is : { "tropo":[ { "say":[ { "value":"Guess what?" }, { "value":"http://www.phono.com/audio/troporocks.mp3" } ] } ] } You can see the difference. So I think the php library does not support using array as parameter very well. Does it make sense to you? Chao
-
Justin Dupree Looks like the pure JSON example listed for say is incorrect. This JSON worked fine: { "tropo":[ { "call":{ "to":"+14075551212" } }, { "say":[ { "value":"Guess what? http://www.phono.com/audio/troporocks.mp3" } ] } ] } which I generated using this code in the PHP Lib: $tropo->say("Guess what? http://www.phono.com/audio/troporocks.mp3"); I'll update the documentation accordingly, apologies for the confusion. Let us know if you have any additional questions. Justin Dupree Voxeo Labs
-
chao.jr.hd Forgot about this thread. This works. Thanks for the help
-
Adam handoff sent to Justin via email.