twilio / OpenVBX

OpenVBX is a web-based open source phone system for business.
http://openvbx.org
Other
701 stars 341 forks source link

I keep getting "ERROR 12100: Document parse failure" Message #185

Closed tonypearl closed 12 years ago

tonypearl commented 12 years ago

Hello!

So every time I access this flow, I get this stinkin' "ERROR 12100: Document parse failure" message.

Upon further investigation (going to the Twilio Debubber), I get this message regarding that issue: "Error on line 2 of document : The markup in the document following the root element must be well-formed. Please ensure that the response body is a valid XML document."

So I took at look at the line of the file it mentioned, and here's what the first 2 lines of that file are: <?php require "Services/Twilio.php";

This file is in the same folder as the required files & folders needed for this operation, namely the twilio-php files that I got from here: https://github.com/twilio/twilio-php ...And nothing was changed in any of those 'helper' files!

I hope I've provided enough info so that this makes sense and you're able to help me out. Of course, if you need any clarification, please just ask!

Thanks!

--Tony

tonypearl commented 12 years ago

NEVER MIND about this issue!!

I found out what the problem was & corrected it.

(I had slightly changed the code to be more 'grammatically correct.' By changing/shortening the words FROM "they are" TO "they're", I had inadvertently added a ' character, and that screwed it all up!!)

Thanks, and please close of delete this issue, as it's no longer relevant.

Gipetto commented 12 years ago

You shouldn't be limited in the grammar that you can use. Where did you try to use the contraction?

tonypearl commented 12 years ago

No--I had changed some php code in a custom script that contained a text message. When I added the apostrophe, it screwed everything up.

So as it turns out, it wasn't a function nor a problem that has anything to do w/ OpenVBX or Twilio - it was MY fault for not recognizing how important the apostrophe character ' is when it comes to php code.

But if you must know, I had edited THIS line of code:

mail($email, 'SMS from '.$callerID, 'They are calling you now '.$sms.' xxxxxxxx' );

TO: mail($email, 'SMS from '.$callerID, 'They're calling you now '.$sms.' xxxxxxxx' );

...And just by adding that apostrophe, it gave me the error message I got.

So it was my stupid fault! lol

Thanks, and please close this thread.

Gipetto commented 12 years ago

Ah, if you want to keep the apostrophe then just put a slash in front of it, like this:

mail($email, 'SMS from '.$callerID, 'They\'re calling you now '.$sms.' xxxxxxxx' );
tonypearl commented 12 years ago

Cool! I actually never would have thought of that! Sweet. Thank you.

Ok - since you're so smart, let's see how you handle this one...

I have this nice lil' script that calls a designated number & READS out some dynamically generated info. It's great for lead generation, to let the client know that someone is looking at something specific.

But here's the problem: When it calls & reads off the text in the robot voice, I WANT it to read off the numbers/characters ONE at a time, NOT as a whole number. (Ex. I want 1234 to be read as 1-2-3-4, NOT "twelve thirty four."

...And I was able to figure that out...BUT then it also spells out the word immediately following it as well.

ahhhhhh... Lemme just shut up & show you the line of code I mean:

echo ' they are looking at property '.$_REQUEST['sms'].'right now';

So, as it stands right now, that will read out the number perfectly, BUT then spell out the word 'right'

I've tried putting a SPACE right before the word 'right,' but that makes it read out the number as a whole (ex. "twelve thirty four"). I've tried putting an "x" or "xj" to throw it off... but I get the same result ("twelve thirty-four xj").

So the question is: HOW can I get it to read out the character/numbers within the .$_REQUEST['sms']. part of that code WITHOUT spelling the word out in the 'right now'; part of that code????

AGain: Goal = have it read out the characters within the 'sms' part, but carry on as normal for the 'right now' (or whatever other text I want to put in there) part?

Hope that makes sense!

Thanks, Mr. Genius!!! :)

-Tony

Gipetto commented 12 years ago

The reason its working for you when you crash the number in to the word "right" is that the system is recovering from something that it can't decipher. What you need to do is break out the number so that it doesn't look like a number.

Try this

$number_expanded = implode('-', str_split($_REQUEST['sms']));
echo '<Say loop="2"> they are looking at property '.$number_expanded.' right now</Say>';
tonypearl commented 12 years ago

Holy crap! What planet are you from??

That was (just about) perfect!!

The only thing (and this is minor) that wasn't perfect was that when the robot talks, it put the word "dash" in between the numbers... Like this: "one dash two dash three dash four" But I was able to fix that by simply substituting a SPACE in place of the - in your kick-ass code, and then it worked perfectly how I wanted it!!

So, without further ado, here's the new, perfect code you gave me, with the slightly-modified touch:

$number_expanded = implode(' ', str_split($_REQUEST['sms'])); echo ' they are looking at property '.$number_expanded.' right now';

Thank you so much, Shawn! You're phenomenal...and fast!!

--Tony