Subversion Repositories SmartDukaan

Rev

Rev 18961 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18961 Rev 22758
Line 18... Line 18...
18
import logging
18
import logging
19
from dtr.utils.utils import num_encode
19
from dtr.utils.utils import num_encode
20
 
20
 
21
PUSH_NOTIFICATIONS_DETAILS_URL="http://localhost:3001/getPushNotificationDetailsByType/?type=%s&notification_campaign_id=%d&status=%s"
21
PUSH_NOTIFICATIONS_DETAILS_URL="http://localhost:3001/getPushNotificationDetailsByType/?type=%s&notification_campaign_id=%d&status=%s"
22
PROMOTIONAL_SMS_SEND_URL = "http://103.15.179.45:8085/MessagingGateway/SendTransSMS?"
22
PROMOTIONAL_SMS_SEND_URL = "http://103.15.179.45:8085/MessagingGateway/SendTransSMS?"
23
TRANSACTIONAL_SMS_SEND_URL = "http://103.15.179.45:8085/SMSGateway/sendingSMS?"
23
TRANSACTIONAL_SMS_SEND_URL = "http://103.15.179.45:8085/MessagingGateway/SendTransSMS?"
24
#ID is: PRO02135496 Mobile Number is: 918512809859 PRO02135496#SMS Sent successfully to : 918512809859
24
#ID is: PRO02135496 Mobile Number is: 918512809859 PRO02135496#SMS Sent successfully to : 918512809859
25
#http://103.15.179.45:8085/MessagingGateway/http/querymsg?user=srlsaholicP&password=srp8oct&apimsgid=PRO02257518
25
#http://103.15.179.45:8085/MessagingGateway/http/querymsg?user=srlsaholicP&password=srp8oct&apimsgid=PRO02257518
26
#MessageID: PRO02135496 STATUS: DELIVRD ErrorCode: 0 DR Time: 2015-10-20 18:05:11 
26
#MessageID: PRO02135496 STATUS: DELIVRD ErrorCode: 0 DR Time: 2015-10-20 18:05:11 
27
 
27
 
28
DataService.initialize(db_hostname="192.168.158.89")
28
DataService.initialize(db_hostname="192.168.158.89")
Line 76... Line 76...
76
                smsUrl='http://pm1.in/A/' + num_encode(notificationCampaign.id) + '/' + num_encode(user.id)
76
                smsUrl='http://pm1.in/A/' + num_encode(notificationCampaign.id) + '/' + num_encode(user.id)
77
                smstext = str(notificationCampaign.messagetext) + ' ' + smsUrl
77
                smstext = str(notificationCampaign.messagetext) + ' ' + smsUrl
78
                #url_params = { 'Mobile' : '91'+user.mobile_number,  'Username' : 'srlsaholicP', 'Password' : 'srp8oct' , 'MessageType' : 'txt', 'SenderID' : '090000', 'Message' : notificationCampaign.messagetext }
78
                #url_params = { 'Mobile' : '91'+user.mobile_number,  'Username' : 'srlsaholicP', 'Password' : 'srp8oct' , 'MessageType' : 'txt', 'SenderID' : '090000', 'Message' : notificationCampaign.messagetext }
79
                url_params = ''
79
                url_params = ''
80
                if "TRAN_SMS" in smstext:
80
                if "TRAN_SMS" in smstext:
81
                    url_params = { 'ani' : '91'+user.mobile_number,  'uname' : 'srlsaholic', 'passwd' : 'sr18mar' , 'cli' : 'PROFTM', 'message' : smstext.replace("TRAN_SMS", "").strip() }
81
                    #url_params = { 'ani' : '91'+user.mobile_number,  'uname' : 'srlsaholic', 'passwd' : 'sr18mar' , 'cli' : 'PROFTM', 'message' : smstext.replace("TRAN_SMS", "").strip() }
-
 
82
                    url_params = { 'Mobile' : '91'+user.mobile_number,  'Username' : 'srlsaholic', 'Password' : 'sr18mar' , 'MessageType' : 'txt', 'SenderID' : 'PROFTM', 'Message' : smstext }
82
                else:
83
                else:
83
                    url_params = { 'Mobile' : '91'+user.mobile_number,  'Username' : 'srlsaholicP', 'Password' : 'srp8oct' , 'MessageType' : 'txt', 'SenderID' : '090000', 'Message' : smstext }
84
                    url_params = { 'Mobile' : '91'+user.mobile_number,  'Username' : 'srlsaholicP', 'Password' : 'srp8oct' , 'MessageType' : 'txt', 'SenderID' : '090000', 'Message' : smstext }
84
                encoded_url_params = urllib.urlencode(url_params)
85
                encoded_url_params = urllib.urlencode(url_params)
85
                logging.debug('User Id:- '+str(user.id)+' Notification_Campaign_Id:- '+ str(notificationCampaign.id)+' Url Params:- '+str(encoded_url_params))
86
                logging.debug('User Id:- '+str(user.id)+' Notification_Campaign_Id:- '+ str(notificationCampaign.id)+' Url Params:- '+str(encoded_url_params))
86
                url = ''
87
                url = ''