sp_On_Sms_Status

sp_On_Sms_Status

sp_On_Sms_Status is triggered when a status of an outbound SMS job has been changed.

Remarks

This procedure should not be called directly by developer, it is automatically called by Boomerang services each time it receives notifications from fax server upon a job progress. This handler is invoked by Boomerang services both in event of success and failure.

Default body of this procedure is blank, thus you may provide their own code implementation for follow-up purposes.

Any changes to handler parameter list cannot be made. New parameters may add with future Boomerang releases upon which a notice will be sent separately.

Syntax

exec sp_On_Sms_Status @jKey=..., @status=... , @msg=...

Parameters

Column Name Data type Direction Description Default Status
@jKey uniqueidentifier in Job key jKey found in OUT_SMS table Required
@status int in Status (0 = success, 1 = failure) Required
@msg varchar(500) in Message from SMS service provider Required

Return Code Values

0 (success) or non-zero (failure)

Examples

Forward failure events from fax jobs by e-mail.

ALTER procedure [dbo].[sp_On_Sms_Status]
(
  @jKey uniqueidentifier,
  @status int,
  @msg varchar(500)
)
as begin
 
--- Demo Code Automatic Output SMS Status Chages to Email -----
declare @gKey uniqueidentifier, @jKeyOut uniqueidentifier
 
--- Send a reply SMS message -------
set @gKey = NEWID()
set @jKeyOut = NEWID()
 
insert EVENT_MASTER(gKey, Str1) values (@gKey, 'Email SMS Status Changes')
insert OUT_EMAIL(gKey, jKey, [Subject], Body, IncludeKey) values (@gKey, @jKeyOut, 'SMS Status Changes for jKey: ' + cast(@jKey as varchar(50)) , @msg, 0) 
insert OUT_EMAIL_RECIPIENT (jKey, Email) values (@jKeyOut, 'info@fuel9.com')
update EVENT_MASTER set Status = 0 where gKey = @gKey
 
end

Result:
sp_On_Sms_Status | Boomerang Notification Services

See also

OUT_SMS
IN_SMS
sp_After_SMS_Job
sp_On_SMS_In
sp_Resubmit_Sms
Configuring SMS Services – Twilio