def send_sms(self, to_addr, content, message_id, linkid=None): """ Send an SMS. """ def _extractRequestIdentifier((body, header)): return gettext(body, './/' + str(SEND_NS.result), default='') body = SEND_NS.sendSms( SEND_NS.addresses(format_address(to_addr)), SEND_NS.message(content), SEND_NS.receiptRequest( L.endpoint(self.endpoint), L.interfaceName(u'SmsNotification'), L.correlator(message_id))) header = self._make_header( service_subscription_address=to_addr, linkid=linkid) d = self.perform_soap_request( uri=self.send_uri, action='', body=body, header=header, expected_faults=[PolicyException, ServiceException]) d.addCallback(_extractRequestIdentifier) return d
def stop_sms_notification(self): """ Deregister notification delivery with the remote ParlayX service. """ body = NOTIFICATION_MANAGER_NS.stopSmsNotification( L.correlator(self._service_correlator)) header = self._make_header() return self.perform_soap_request(uri=self.notification_uri, action='', body=body, header=header, expected_faults=[ServiceException])
def stop_sms_notification(self): """ Deregister notification delivery with the remote ParlayX service. """ body = NOTIFICATION_MANAGER_NS.stopSmsNotification( L.correlator(self._service_correlator)) header = self._make_header() return self.perform_soap_request( uri=self.notification_uri, action='', body=body, header=header, expected_faults=[ServiceException])
def start_sms_notification(self): """ Register a notification delivery endpoint with the remote ParlayX service. """ body = NOTIFICATION_MANAGER_NS.startSmsNotification( NOTIFICATION_MANAGER_NS.reference( L.endpoint(self.endpoint), L.interfaceName('notifySmsReception'), L.correlator(self._service_correlator)), NOTIFICATION_MANAGER_NS.smsServiceActivationNumber( self.short_code)) header = self._make_header() return self.perform_soap_request(uri=self.notification_uri, action='', body=body, header=header, expected_faults=[ServiceException])
def start_sms_notification(self): """ Register a notification delivery endpoint with the remote ParlayX service. """ body = NOTIFICATION_MANAGER_NS.startSmsNotification( NOTIFICATION_MANAGER_NS.reference( L.endpoint(self.endpoint), L.interfaceName('notifySmsReception'), L.correlator(self._service_correlator)), NOTIFICATION_MANAGER_NS.smsServiceActivationNumber( self.short_code)) header = self._make_header() return self.perform_soap_request( uri=self.notification_uri, action='', body=body, header=header, expected_faults=[ServiceException])
def send_sms(self, to_addr, content, message_id, linkid=None): """ Send an SMS. """ def _extractRequestIdentifier((body, header)): return gettext(body, './/' + str(SEND_NS.result), default='') body = SEND_NS.sendSms( SEND_NS.addresses(format_address(to_addr)), SEND_NS.message(content), SEND_NS.receiptRequest(L.endpoint(self.endpoint), L.interfaceName(u'SmsNotification'), L.correlator(message_id))) header = self._make_header(service_subscription_address=to_addr, linkid=linkid) d = self.perform_soap_request( uri=self.send_uri, action='', body=body, header=header, expected_faults=[PolicyException, ServiceException]) d.addCallback(_extractRequestIdentifier) return d