Groups | Blog | Home
all groups > sql server notification services > december 2005 >

sql server notification services : how hard to set up cellphone delivery channel


billdebug
12/23/2005 8:13:14 AM
I've been cruising the information on NS and I cannot figure this out. I
guess it's a custom deliverychannel because MS only supports smtp and file
as built in delivery channels.
What resources are necessary in order to set up a channel like this to
deliver, say, text messages to mobiles?
Do we need special services or service providers to coordinate this with?
TIA

Mana
12/26/2005 6:18:54 AM
I have used an external service for this. There is a site called
Clickatell.com. They have 10-messages free trial. Subscribe for it and
then u can download a dll using which u can send SMS.

Following is the sample code

//click on button to send sms
private void button1_Click(object sender, EventArgs e)
{
HttpWebRequest webRequest = null;
HttpWebResponse webResponse = null;
string uri;

try
{
uri = "http://api.clickatell.com/http/sendmsg?";
uri += "api_id=" + "123456";//given when u subscribe
uri += "&user=" + "testuser";
uri += "&password=" + "passtest";
uri += "&to=" + "912345678905";//cell no with country code
uri += "&text=" + "Merry Christmas";
uri += "&from=" + "Santa";

webRequest = (HttpWebRequest)WebRequest.Create(new Uri(uri));
webRequest.ContentLength = uri.Length;
webRequest.KeepAlive = false;
webRequest.Method = "POST";
webResponse = (HttpWebResponse)webRequest.GetResponse();
Stream responseStream = webResponse.GetResponseStream();
StreamReader responseStreamReader = new
StreamReader(responseStream);
string response = responseStreamReader.ReadToEnd();
responseStreamReader.Close();
responseStream.Close();
webResponse.Close();
}
catch (Exception exception)
{
MessageBox.Show(exception.ToString());
return;
}
finally
{
if (webRequest != null)
webRequest.Abort();
webRequest = null;
webResponse = null;
}
}
Joe Webb
12/29/2005 8:16:33 AM
Here are a list of partners for NS.

http://www.microsoft.com/sql/technologies/notification/partners.mspx


HTH..




--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Fri, 23 Dec 2005 08:13:14 -0600, "billdebug"
[quoted text, click to view]
kate
1/2/2006 3:04:36 PM
You can use any web based sms gateway and post your message from your
custom http delivery protocol to them.

Kate Patterson MBCS
Andy Wilbourn
1/4/2006 6:23:28 AM
Do you need real SMS or just sending text to phone? Our solution is using
SMTP addresses to send to cell phones. We did define two different
DeviceTypeName for subscriber devices so we can get a different stylesheet
template applied, we don't send as must in the message to cell phones.

This was we use the built in SMTP feature to handle the work for us. You can
write your own DeliveryChannel if need be with out a lot of difficultly. We
have a component that writes to MSMQ, mostly taken from the example in
Shyam's book on NS. BOL has an example of writing one to call a stored proc.

Data in our <InstanceName>NSMain.dbo.NSSubscriberDevices table would like
the following:
SubscriberID DeviceName DeviceTypeName DeviceAddress
DeliveryChannel
test1 SMTP1 SMTP
email@here.com SMTPChannel (as per ICF below)
test1 Mobile1 MobileEmail
mobile@here.com SMTPChannel

ICF settings:
<DeliveryChannel>
<DeliveryChannelName>SMTPChannel</DeliveryChannelName>
<ProtocolName>SMTP</ProtocolName>
<Arguments>
<Argument>
<Name>SmtpServer</Name>
<Value>localhost</Value>
</Argument>
<Argument>
<Name>BodyEncoding</Name>
<Value>utf-8</Value>
</Argument>
</Arguments>
</DeliveryChannel>

ADF settings:
<Protocol>
<ProtocolName>SMTP</ProtocolName>
<Fields>
<Field>
<FieldName>Subject</FieldName>
<SqlExpression>
<!-- Subject here -->
</SqlExpression>
</Field>
<Field>
<FieldName>From</FieldName>
<SqlExpression>
<!-- email address here -->
</SqlExpression>
</Field>
<Field>
<FieldName>To</FieldName>
<SqlExpression>
DeviceAddress
</SqlExpression>
</Field>
<Field>
<FieldName>Priority</FieldName>
<SqlExpression>
N&apos;Normal&apos;
</SqlExpression>
</Field>
<Field>
<FieldName>BodyFormat</FieldName>
<SqlExpression>
N&apos;text&apos;
</SqlExpression>
</Field>
</Fields>
</Protocol>

In the path where our stylesheet's are stored we have a folder for each
DeviceTypeName (SMTP, MobileEmail) with the appropriate stylesheet templates
in them.

Hopefully this helps you, or others.

[quoted text, click to view]

Andy Wilbourn
1/4/2006 6:26:34 AM
Sorry about the formatting, but I also forgot we are using SQL 2005 NS.

[quoted text, click to view]

kate
1/5/2006 2:47:02 AM
nice solution, Andy

Kate Patterson MBCS
Andy Wilbourn
1/9/2006 1:00:02 PM
Thanks Kate. We were not sure if this would be a bad design for a NS
solution, but the best we could come up with. I think we submitted to MS for
feedback and they said it was a good way to go, so we went with it.



[quoted text, click to view]

Joe Webb
1/10/2006 5:58:22 AM
I like it!



--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Mon, 9 Jan 2006 13:00:02 -0500, "Andy Wilbourn"
[quoted text, click to view]
AddThis Social Bookmark Button