public void SendSmsMessage(HeContext context, SmsNode node, string largeAccount, string msisdn)
        {
            string origLA     = context.MOMsg.LargeAccount;
            string origMSISDN = context.MOMsg.MSISDN;

            context.MOMsg.LargeAccount = largeAccount;
            context.MOMsg.MSISDN       = msisdn;
            context.Session["MSISDN"]  = context.MOMsg.MSISDN;
            try {
                node.Execute(context);
            } finally {
                context.MOMsg.LargeAccount = origLA;
                context.MOMsg.MSISDN       = origMSISDN;
                context.Session["MSISDN"]  = context.MOMsg.MSISDN;
            }
        }
 public int SendSms(SmsNode node, string largeAccount, string msisdn)
 {
     OutSystems.ObjectKeys.ObjectKey nodeKey = OutSystems.ObjectKeys.ObjectKey.Parse(node.Key);
     if (HttpContext.Current == null)
     {
         GeneralLog log = new GeneralLog();
         log.Write(DateTime.Now, "", 0, 0, 0, "SendSms Called (Context is null)", GeneralLogType.WARNING.ToString(), "", "");
     }
     else if (HttpContext.Current.Session == null)
     {
         GeneralLog log = new GeneralLog();
         log.Write(DateTime.Now, "", 0, 0, 0, "SendSms Called (Session is null)", GeneralLogType.WARNING.ToString(), "", "");
     }
     else
     {
         HeContext context = Global.App.OsContext;
         if (!NetworkInterfaceUtils.IsLoopbackAddress(HttpContext.Current.Request.UserHostAddress))
         {
             ErrorLog.LogApplicationError("Access to iSmsHandler with invalid IP: " + HttpContext.Current.Request.UserHostAddress,
                                          "The iSmsHandler can only be accessed by the 127.0.0.1 IP", context, "ExecuteTimer");
             return(0);
         }
         GeneralLog log = new GeneralLog();
         log.Write(DateTime.Now, context.Session.SessionID, context.AppInfo.eSpaceId,
                   context.AppInfo.Tenant.Id, context.Session.UserId,
                   "SendSms Called, The node received has type " + node.GetType().ToString() + ", Large Account: " + largeAccount + " MSISDN: " + msisdn,
                   GeneralLogType.INFO.ToString(), "", "");
         node.MTMsg.LargeAccount   = largeAccount;
         node.MTMsg.MSISDN         = msisdn;
         context.Session["MSISDN"] = node.MTMsg.MSISDN;
         bool ok = false;
         try {
             node.Execute(context);
             ok = true;
         } finally {
             DatabaseAccess.FreeupResources(ok);
         }
     }
     return(1);
 }