Block Certain Prefix

Block Certain Prefix SearchSearch
Author Message
Blair
New member
Username: Bcotnam

Post Number: 15
Registered: 07-2011
Posted on Thursday, January 19, 2012 - 02:57 pm:   

Hello Support,

Quick question, is there anyway in nowsms to block certian prefix's from sending out through any connection?

What we want to do is filter certain prefix's to not send out.

I can see you can filter certain prefix's through a connection and either allow any outgoing traffic thorugh a modem or filter a modem to only send certain prefix. Can we block or filter out a prefix from sending out through any modem connection?

Also, if the prefix we want to block is already in the queue, will it still block the message?

Thanks,
Blair
ZIM Corporation
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3725
Registered: 08-2008
Posted on Thursday, January 19, 2012 - 06:39 pm:   

Hi Blair,

I'm assuming the prefix is a sender.

Handling it on the recipient side is easy, but on the sender side you would need to implement an accounting callback.

This accounting callback would only support new messages, however, not already queued messages.

I've got an idea, however, based on this:


quote:

I can see you can filter certain prefix's through a connection and either allow any outgoing traffic thorugh a modem or filter a modem to only send certain prefix. Can we block or filter out a prefix from sending out through any modem connection?




Define a dummy HTTP SMSC connection. Put in any web site address. Set the server type to NowSMS to preload the templates.

UNcheck "Support any outbound message traffic" so that it will not try to process messages that it should not.

In the sender address field, put:

prefix,prefix*

Once this setting is applied, any messages from a sender that matches this prefix should get routed via this dummy account.

The dummy account will send an HTTP request to the web server specified, but as long as the web server doesn't return an error, NowSMS will consider it a success.

--
Des
NowSMS Support
Blair
New member
Username: Bcotnam

Post Number: 16
Registered: 07-2011
Posted on Thursday, January 19, 2012 - 07:51 pm:   

Thanks for the information.

It's good to know how to block a sender. What we want to do is block a certain prefix for a recipient so, it gets blocked from sending out thorugh any of our modems.

How do you block say all recipients that start with '+90' from going out through any of our modem connections? If that prefix for the recipient is in the queue we also don't want to send that message. Is that possible?

So, essentially we don't want to send to a recipient with a specific prefix, for new messages coming in or if the message with that prefix is also in the queue.

Will have a bunch of messages in the queue which we don't want to send to, we just want to block them. Then going forwared we want to block that recipient prefix for sending out thorugh any of our connections.

THanks,
Blair
Blair
New member
Username: Bcotnam

Post Number: 17
Registered: 07-2011
Posted on Thursday, January 19, 2012 - 07:58 pm:   

Also,

WHere is the source of the message queue that nowsms uses? Does nowsms just read the log file for the message queue? We submit all the messages that are outgoing into a mysql database, so would it use the mysql for the message queue or does nowsms use a certain log file to get messages from the queue or not?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3731
Registered: 08-2008
Posted on Thursday, January 19, 2012 - 10:09 pm:   

Hi Blair,

To block recipients, define a dummy SMSC connection.

UNcheck "Support any outbound message traffic" so that it will not try to process messages that it should not.

In the "Preferred Connection for" list, define the blocked recipient masks (such as +90*).

If you want to hold the messages, not toss them away, that is a little more difficult, because the NowSMS UI does not like to define an SMSC connection unless you can connect to it first.

That can be a pain for situations where you are doing something unusual like this. I have been known to add an SMSC with a real host name/IP Address, then take it offline by manually editing the SMSGW.INI file and editing the host name/IP address.

Granted, that's not an ideal way of doing things. We should have a way to add an SMSC entry without validating it.

If you do use my approach:

1.)Add the SMSC entry with a valid host name.

2.) UNcheck "Support any outbound message traffic" so that it will not try to process messages.

3.) Apply. Exit configuration UI

4.) Edit SMSGW.INI and change host name to invalid one.

5.) Reload configuration UI and see invalid/off-line entry. Add blocked recipient list to "Preferred Connection for" list.



The message Q is all individual files in ProgramData\NowSMS\Q, with some information about the content cached in memory. (Reloaded if service stopped/started.)

--
Des
NowSMS Support