/// <summary> /// Captures DLR request /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { if (context == null) { throw new ArgumentNullException("context"); } var report = DeliveryReport.CreateFrom(context.Request); ProcessReport(context, report); }
/// <summary> /// Messente will call back to this handler once message is delivered (or when failed to deliver). /// </summary> /// <param name="context"></param> /// <param name="report"></param> protected override void ProcessReport(HttpContext context, DeliveryReport report) { var writer = context.Response.Output; writer.WriteLine("Reporting on SMS: " + report.SmsUniqueId); switch (report.SmsStatus) { case DeliveryReportStatus.Sent: writer.WriteLine("wait.."); break; case DeliveryReportStatus.Delivered: writer.WriteLine("Yay, delivered!!"); break; case DeliveryReportStatus.Failed: writer.WriteLine("Damn: " + report.Error); break; } }
protected abstract void ProcessReport(HttpContext context, DeliveryReport report);