How to send MMS with C# - c#

I need to send MMS thought a C# application. I have already found 2 interesting components:
http://www.winwap.com
http://www.nowsms.com
Does anyone have experience with other third party components?
Could someone explain what kind of server I need to send those MMS? Is it a classic SMTP Server?

Typically I have always done this using a 3rd party aggregator. The messages are compiled into SMIL, which is the description language for the MMS messages. These are then sent on to the aggregator who will then send them through the MMS gateway of the Network Operator. They are typically charged on a per message basis and the aggregators will buy the messages in a block from the operators.
If you are trying to send an MMS message without getting charged then I am not sure how to do this, or if it is possible.

You could do it yourself. Some MMS companies just have a SOAP API that you can call. All you need to do is construct the XML and send it off via a URL. I have done this once before, but can't remember the name of the company I used.

This post earlier discussed different approaches for SMS and might be helpful for you.

You could use Twilio to accomplish this. You can dive into the docs for specific implementation details but using the C# helper library the code to send an MMS would look like this:
// Send a new outgoing MMS by POSTing to the Messages resource */
client.SendMessage(
"YYY-YYY-YYYY", // From number, must be an SMS-enabled Twilio number
person.Key, // To number, if using Sandbox see note above
// message content
string.Format("Hey {0}, Monkey Party at 6PM. Bring Bananas!", person.Value),
// media url of the image
new string[] {"https://demo.twilio.com/owl.png" }
);
Disclaimer: I work for Twilio.

Related

Receiving SMS in C# with RingCentral

I am able to send SMS using C#. But my problem is I don't know to receive those SMS.
I looked into following documentation with WebHook and C# here:
https://developers.ringcentral.com/guide/notifications/quick-start/webhook/c-sharp
But not sure how to do it exactly.
Can I get any help to know how I can receive the SMS. Any sample will be great.
There are 3 ways to receive SMS:
PubNub Subscription
WebHook Subscription
API Request
Here are some details:
Using PubNub, you can receive SMS.
Check it out here: https://github.com/ringcentral/ringcentral-csharp-client/blob/master/RingCentral.Test/SubscripotionTest.cs#L31
Since this is used by PubNub, so you don't need ngrok
If you want WebHook, you need to subscribe for push notification check the reference demo: https://github.com/ringcentral/ringcentral-csharp-client/blob/master/RingCentral.Test/WebHookTest.cs
The direct API of RingCentral APIs to receive SMS content in your C#, by calling this API inside your SDK is: /restapi/v1.0/account/~/extension/~/message-store/{messageId}/content/{attachmentId}. Here you need to put the message id and the attachment id to retrieve message content from message-store
Hope this help.

Making an custom content outbound voice call from console client

I am trying to make an outgoing call using Twilio and C#.
I gave the (fromnumber, tonumber, twiliodemourl) as 3 parameters for initiate
outbound call.Then it is working with default twilio demo voice content.
Now i need to customize the voice content attribute and some other attributes
every time i trigger the initiate outbound call method
I have gone through Twilio docs i did not find any good option for customize the
content dynamically from the code using C# every time i send the request.
My client application running periodically to verify for any new messages and then
trigger initiateoutboundcall.
I don't have any custom URL to post any new XML which voice is looking for in 3rd
parameter of initiateOutBoundCall.
So is it required a external domain URL to customize the voice content dynamically from code?
If no please provide the options/sample i have to do it from C# console application.
I tried to use the twimlets.com to echo the custom text to speak in the call.
For text change it is working fine with custom text. But i am not sure whether twimlets.com/echo can be used for production use? Please confirm. Twimlets is not supporting some of the features which i am looking for like Gather input
like IVR message for outbound call.
Using Twilio Voice and C# client:
Voice Request using Twilio C# client?
Dial the number with custom voice content(). If user not responds leave a
voice mail with the custom voice content().
Dial the number with custom voice content (). If user responds, after reading
the message need to provide options like:
press 1 for repeat the same voice message.
press 2 to confirm the action on the message.
press 3 to send SMS for the voice message.
Need to get the response for each voice call / message?
For the sms it send i am getting response as "queued" instead of message sent.
Based on the SMS sent successfully or not i need to update some flag.
So how i can get the SMS reponse as "sent".
SMSMessage sms = twilio.SendSmsMessage(sFromNumber, sToNumber, sMessage);
Console.WriteLine("SMS Status::::::" + sms.Status);
Similarly I need the reponse for voice call once the call is ring id done.
But it is giving "queued".
var call = twilio.InitiateOutboundCall(sFromNumber,sToNumber, url);
Console.WriteLine("Call Status" + call.Status);
So please provide me options for doing it using Twilio.
It would be great if you provide any sample example using C#.
Twilio evangelist here.
You do need some kind of public URL that Twilio can make an HTTP request to once the outbound call is answered. This is how Twilio gets the instructions it needs in order to proceed with the live, in-progress call.
As you noted there are a number of free options for hosting static TwiML content. Twimlets is one. Twimlbin.com is another. Both services are free and great places to at least get started prototyping or setting up a simple MVP of your application, but bear in mind that if you expect a large amount of traffic or you need to build something with your own custom logic in it you'll probably want to move to something else.
That something else could be your own website hosted as as Azure Website (which you can also get for free). Moving to your own website also means that you can scale it as needed and you can start serving up dynamically generated TwiML instead of just being limited to dynamic TwiML as you basically are with Twimlets or Twimlbin.
If you want to process input from <Gather> and none of the Twimlets meet your needs, then you will likely need to look at the Azure option (or some kind of hosted website, doesn't have to be Azure). This will let you build your own custom logic in order to process the callers input and dynamically generate a TwiML response based on that logic.
Twilio provides helper libraries for TwiML generation and for building Twilio apps using ASP.NET MVC, which you can get from NuGet.
Lets say you want to go down the road of building you own custom Twilio app using ASP.NET MVC and hosting it using an Azure Website. In that scenario, using our helper libraries you could build an action method in your controller that returns the TwiML with the <Say> and <Gather> verbs. Something like:
var response = new TwilioResponse();
response.Say("Hello World");
response.BeginGather(new { action="http://example.azurewebsites.com/gather/" } );
response.EndGather();
You would provide the URL that executes that action method as the third parameter in the initiaizeOutboundCall method eg:
client.IntializeOutboundCall(FROM, TO, "http://example.azurewebsites.net");
Once the user enters their input, Twilio will request the URL you specified in the <Gather> verbs action parameter passing you an extra HTTP parameter named Digits, which you can grab in your action method and use in your app logic:
public void Gather(string Digits) {
var response = new TwilioResponse();
response.Say("You pressed " + Digits);
return TwiML(response);
}
To get the status of a phone call or an SMS, you can include use the statuscallback parameter:
SMS: var result = client.SendMessage(FROM, TO, BODY, "http://example.azurewebsites.net/status");
Voice: var result = client.InitiateOutboundCall(FROM, TO, VOICEURL, "http://example.azurewebsites.net/status");
Twilio will make HTTP request to the statusCallback URL's once the final status of the message or call is reached.
Hope that helps.
As of version 5.32 of the C# SDK, you can pass a dynamic twiml string into the CallResource.Update() method like so:
CallResource.Update(
twiml: "<Response><Say>Custom Message Here</Say></Response>"
pathSid: call.Sid);
Or even:
string customMessage = "<Response><Say>Custom Message Here</Say></Response>"
CallResource.Update(
twiml: customMessage,
pathSid: call.Sid);

Cellular/Network SMS integration for Quiz application

I tried with google but no success, what i want to do is to make sms poll/quiz type of thing where user can send sms to "7766" and get response like "Welcome to ABC. reply with 1 to get you new question, 2 with help, and 3 to view your result " . this will be a a two way communication and on sending any sms will cost $10 .
Here are my question:
How can i do that?
Do i need to ask sim [provider for tht Number (7766)
This should work from some specific country only.
I need to charge amount on entering the QUIZ.
Well as new to this, i dont see any starting point from wher i can start. I need reference or some one already did that or like this thn kindly share that.
Perhaps you can have an ecommerce solution on your website (Paypal for example) and then once your user has paid, they have access to a portion of your site that uses an HTTP SMS API. An example of a provider of such a service would be http://www.bulksms.co.uk/w/eapi-sms-gateway.htm
These APIs allow you to send messages, receive delivery reports and receive replies (amongst other things).
It's quite a wide-ranging question though.

Twilio SMS sandbox using C#

How do you use the Twilio sandbox mode with C#? I have a ashx.cs file that I am using to write my code. Would I put it there? If so, what does that look like?
There is no real great examples on their website on how to do this except for CURL and Ruby.
We are using TwiML to general an XML file tha t parses our data to send back and forth to the Twilio service. We don't want to be charged every time we send a test text message.
How would we set the Sandbox up so we could do some testing.
I found the Test auth Token and account Sid, but how do I use those?
We don't have them in our current application and we are specifying our .ashx page in Twilio to process our code.
Thanks in advance.
Twilio evangelist here.
So if you just want to test that your ASHX handler is generating the right results the easiest way to do this is to just fake a POST or a GET request to that handler. This lets you simulate the GET or POST request that Twilio will make to your app when it gets a text message.
You can see the parameters that Twilio will pass to your app when it receives a text message here:
http://www.twilio.com/docs/api/twiml/sms/twilio_request#synchronous
There are a whole bunch of ways to simulate these requests. cURL is one of them. If your ASHX is expecting query string values, you can also just load the ASHX directly in the browser and append those values in the URL. If the handler is expecting a POST request, I used a chrome plugin called Simple REST Client to make these.
Of course you can also Fiddler to make just about any HTTP request.
The Test Credentials really are more for simulating the use of the REST API (programatically sending SMS messages). I just wrote a blog post that shows how to use the test credentials to create integration tests:
http://www.twilio.com/blog/2013/05/automating-twilio-integration-tests-with-test-credentials.html
Hope that helps.
Devin

Sendgrid Emails - Result handling and tracking

I am looking at the c# .Net libraries from sendgrid to send emails from my applications. I can only see a DeliverAsync method within Web and I don't see any Deliver method as shown in some examples..
1) if I want to know the result of that email(success/Failed/smtp status codes), How and where do I get that information? Is there any result object?
2) if I want to track the status of the email later like whether it sent to spam or user opened it How can I do that. DO they have any tracking number/id for the email which I can get from the result object and use it later to get status through their API?
I am new to using Sendgrid libraries. So any help is appreciated.
Thanks
There's no result object in the sending of the message, since that can take some time.
The best way is to leverage the Event Webhook, so that you can receive POSTs with JSON data about your messages. you can even leverage unique_args to positively relate events to a particular message.
Depending on what you want to do, you might want to try a templating API, like sendwithus. They'll integrate with SendGrid events for you and give a UI showing events and status of every email.

Categories

Resources