public System.IAsyncResult BeginSendSms(SmsNode node, string largeAccount, string msisdn, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("SendSms", new object[] {
         node,
         largeAccount,
         msisdn
     }, callback, asyncState));
 }
        public int SendInteractiveSms(SmsNode node, string largeAccount, string msisdn)
        {
            SmsHandler.setState(node);
            iSmsNotificationHandlerClient handler = new iSmsNotificationHandlerClient();

            handler.SetupInteractiveSmsHandling(largeAccount, msisdn, Global.App.Tenant.Id, node.ExpectedPatterns, Global.App.eSpaceId, Global.App.eSpaceName);
            return(SendSms(node, largeAccount, msisdn));
        }
 public int SendSms(SmsNode node, string largeAccount, string msisdn)
 {
     object[] results = this.Invoke("SendSms", new object[] {
         node,
         largeAccount,
         msisdn
     });
     return((int)(results[0]));
 }
Example #4
0
        public static SmsNode GetSmsEntry(HeContext heContext)
        {
            string  largeaccount = heContext.MOMsg.LargeAccount;
            SmsNode wNode        = null;

            foreach (ObjectKey nodeName in AppInfo.GetAppInfo().Tenant.GetPhoneNodes(largeaccount, Global.eSpaceId))
            {
                return(null);
            }
            return(wNode);
        }
        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 void SendInteractiveSmsMessage(SmsNode node, string largeAccount, string msisdn)
        {
            string sessionId = SmsUtils.BuildSession(largeAccount, msisdn);

            _msisdn = msisdn;

            this.Url = "http://127.0.0.1/" + Global.App.eSpaceName + "/" + sessionId + "/ismshandler.asmx";


            if ((HttpContext.Current.Session != null) && (sessionId == RuntimePlatformUtils.SessionPrefix + HttpContext.Current.Session.SessionID + RuntimePlatformUtils.SessionSuffix))
            {
                // To make sure the session is not blocked, make an assynchronous request
                BeginSendInteractiveSms(node, largeAccount, msisdn, new AsyncCallback(SendInteractiveSmsResult), null);
            }
            else
            {
                SendInteractiveSms(node, largeAccount, 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);
 }
Example #8
0
 public static void setState(SmsNode newState)
 {
     HttpContext.Current.Session["state"] = newState;
 }