C# SMS API delivery failed
SMS delivery reports for failed SMS messages are handled the same way in the C# SMS API as SMS delivery reports for successful SMS delivery. The only difference is that the Ozeki SMS gateway raises the OnMessageDeliveryFailed event, and it attaches an error message to the report if the mobile network returns a delivery report with a failed status.
The C#/.Net SMS api sms delivery failed event
The sms delivery failed event in the C# SMS api arrives when the mobile network considers an SMS message undeliverable. This can happen if the destination mobile phone is never switched on or is roaming in an inaccessible network. Some SMS service providers do not send SMS delivery reports with failed status codes.
To handle the SMS delivery failed report in your C# SMS API follow these steps:
- Subscribe for the OnMessageDeliveryFailed event in your C# SMS API class
- Write the C# code to process the SMS delivery failed report
- Send an SMS, and save the sms message ID.
- Process the incoming SMS delivery failed report in your C# sms api class
C# sms api sms delivery failed report example:
Client.OnMessageDeliveryFailed += Client_OnMessageDeliveryFailed; static void Client_OnMessageDeliveryFailed(object sender, OzxArgs<string, DateTime, string> e) { Console.WriteLine("Message delivery failed. ID: " + e.Item1 + " Date: " + e.Item2 + " Reason: " + e.Item3); }
The C#/.NET sms api receives the date of failure and the error code in addition to the SMS messages ID of the originally sent SMS message.
For Android SMS Gateway setups, you receive this event, when the android phone receives the delivery failed report. If your SMS Server runs on a PC, this SMS delivery failed event will be triggered when the delivery failed report is received on the configure mobile network connection.
More information
- Hoe SMS te verzenden vanuit C#
- SMS ontvangen in C#
- C# SMS API verbinden om SMS te versturen
- C# SMS API - verbreken van SMS gateway
- C# SMS API - keepalive SMS-verbinding actief
- C# SMS API - een tekstbericht versturen
- C# SMS API - SMS geaccepteerd voor levering
- C# SMS API - SMS niet geaccepteerd voor levering
- C# SMS API - ingediend
- C# SMS API - indienen mislukt
- C# SMS API - leveringsrapport succesvol
- C# SMS API - levering mislukt rapport
- C# SMS API - alfanumerieke afzender-ID
- C# SMS API hoe korte code als afzender-ID te gebruiken
- C# SMS API tekstberichtklasse