Last active
December 22, 2015 03:09
-
-
Save caruizdiaz/6408251 to your computer and use it in GitHub Desktop.
implementation of events handlers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void HandleGatewayUSSDReceived (string gatewayIP, int port, dwg_ussd_result_code status, string message) | |
{ | |
Console.WriteLine("USSD response {0} at port {1}, status {2}", gatewayIP,port, Enum.GetName(typeof(dwg_ussd_result_code), status)); | |
Console.WriteLine(message); | |
} | |
static void HandleGatewaySMSReceived (string gatewayIP, string number, string text, int port, string timestamp) | |
{ | |
if (text == null) | |
text = string.Empty; | |
Debug.Info("IP:", gatewayIP, " | SMS from:", number, ", text:", text); | |
Database.Database.RegisterIncomingSMS(gatewayIP, Database.Database.FixMobileNumber(number), text, port); | |
} | |
static void HandleGatewaySentSMSStatus (string gatewayIP, string number, int port, dwg_sms_result_code status) | |
{ | |
Debug.Info("IP:", gatewayIP, " | Number:", number, ", port:", port.ToString(), ", status:", Enum.GetName(typeof(dwg_sms_result_code), status)); | |
Database.Database.RegisterSentSMS(number, gatewayIP, port, (int) status); | |
} | |
static void HandleGatewayStatusChanged (string gatewayIP, dwg_port_status_value[] portsStatus) | |
{ | |
int i = 0; | |
foreach(dwg_port_status_value port in portsStatus) | |
Debug.Info(string.Format("Status changed on port {0}: {1}", i++, Enum.GetName(typeof(dwg_port_status_value), port))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment