Last post Jul 27, 2013 11:05 AM by wavemaster
Jul 25, 2013 11:01 PM|wavemaster|LINK
Found this piece of code and I am trying to make this work in WebMatrix.
Compiler is complaing about response, say, record
How does one go about figuring out who this doesn't work?
Response.ContentType = "text/xml";
var to = Request["To"];
var from = Request["From"];
var callSid = Request["CallSid"]; // unique call ID common across requests for this call
<Say>Thank you for calling, please leave a message.</Say>
<Record action="HandleRecording" maxLength="30" />
Jul 26, 2013 12:22 AM|Mikesdotnetting|LINK
First, you pay attention to the specific complaint from the compiler. Note, "Unknown element 'x' cannot be placed here" is not a "compiler conplaint" in WebMatrix, and will not prevent the page from compiling. What's your error message?
Jul 26, 2013 10:35 AM|wavemaster|LINK
unknown element 'say' cannot be placed here
same for record and response
Jul 26, 2013 02:19 PM|Mikesdotnetting|LINK
Ignore those "errors". WebMatrix doesn't understand what you are trying to do and thinks you are wrong. As I said before, they are not compiler errors.
Jul 26, 2013 05:08 PM|wavemaster|LINK
Correct, ignoring it did the trick.
I see that the response is xml.
Would it be possible to send replies with code that I already know (html, Razor C#)?
Like in my Twilio SMS application I am sending messages like this:
Twilio.SendSms("+15XXXXXXXXX", userfrom, "Message rejected: invalid Chat Id. Try again!", "");
Is the Twilio WebMatrix helper translating this into xml?
Also, in Visual Studio I can see that the Twilio Api is loaded. Would that allow me to send replies with what I already know?
Jul 26, 2013 05:29 PM|Mikesdotnetting|LINK
I can't really answer your new questions. I am not familiar with Twilio or what you are doing.
Jul 27, 2013 11:05 AM|wavemaster|LINK
Come on Mike, you are supposed to know stuff, before we even know that we need to know it!
Twilio bridges telephony with the internet.
<say>"thanks for calling us"</say> is basically a reply to a phone call.