Kannel calling sms-service get-url twice - kannel

I am using GSM MODEM and gateway 1.4.3 to send sms.
I defined sms-service in my config file to catch all messages with keyword 'TT' and call an URL on receiving sunch message.
My problem is that get-url is getting called twice even though message received is small. Here is my config file..
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-file ="/tmp/smsbox.log"
log-level = 0
global-sender = 123456
group = sendsms-user
username = tester
password = foobar
#dlr-url = "http://192.168.13.67:8084/TestSMSDelReport/DeliveryReport/getDeliveryReport?smsID=?&timestamp=%t&status=%d&number=%p"
concatenation= true
max-messages = 3
forced-smsc = gsm_modem
group = sms-service
keyword = TT
#keyword-regex = .*
catch-all = yes
max-messages = 0
get-url = "http://192.168.75.241:8080/InwardMsg/InwardMsg/inwardMessages?phone=%p&text=%a"
text = "You asked nothing and I did it!"
Do I have to change any property so that get-url is called only once?
Thanks in advance

Remove "catch-all = yes". "catch-all = yes" makes kannel catch every message even if message doesn't match the keyword and call get-url.

Related

Traefik Redirect Domain to Subdomain

I want to permanently redirect all requests to example.com and www.example.com to blog.example.com in a TLS environment.
My current config:
traefik.toml:
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
[entryPoints.websecure]
address = ":443"
[providers.docker]
exposedbydefault = false
watch = true
network = "web"
[providers.file]
filename = "traefik_dynamic.toml"
[certificatesResolvers.lets-encrypt.acme]
email = "mymail#example.com"
storage = "/letsencrypt/acme.json"
[certificatesResolvers.lets-encrypt.acme.dnsChallenge]
provider = "myprovider"
traefik_dynamic.toml:
[http.middlewares]
[http.middlewares.goToBlog.redirectregex]
regex = "^https://(.*)example.com/(.*)"
replacement = "https://blog.example.com/$${2}"
permanent = true
[http.routers]
[http.routers.gotoblog]
rule = "Host(`example.com`) || Host(`www.example.com`)"
entrypoints = ["websecure"]
middlewares = ["goToBlog"]
service = "noop#internal"
[http.routers.gotoblog.tls]
certResolver = "lets-encrypt"
When I try to access example.com it gives my an SSL Protocol Error. All my other endpoints including blog.example.com are working. What am I doing wrong?
Okey, obviously it had nothing to do with my redirect configuration. Seemed like a hickup in traefik / docker, similar to ACME certificates timeout with traefik. Just waited one day and everything worked as expected. Just two minor updates to correct the redirect configuration. Maybe there's a more elegant solution.
traefik_dynamic.toml:
[http.middlewares]
[http.middlewares.goToBlog.redirectregex]
regex = "^https://(.*)example.com/(.*)"
replacement = "https://blog.example.com/${2}" # no double $$
permanent = true
[http.routers]
[http.routers.gotoblog]
rule = "Host(`example.com`, `www.example.com`)" # just an array of domains is fine, too
entrypoints = ["websecure"]
middlewares = ["goToBlog"]
service = "noop#internal"
[http.routers.gotoblog.tls]
certResolver = "lets-encrypt"

Sending an email over TLS

I've try send email using TLS and port number is 587 with server name is smtp.gmail.com but always got error "error '8004020e'". I set SSL to false because the port 587 Authentication is TLS. Any wrong in my code?
Set objMail = Server.CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xx#gmail.com"
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xx"
objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objConfig.Fields.Update
Set objMail.Configuration = objConfig
objMail.From = "xx#gmail.com"
objMail.To = "yy#yahoo.com"
objMail.Subject = "Test EMAIL"
objMail.TextBody = "Test EMAIL"
objMail.HTMLBody = "fffffffffff"
objMail.Send
Set objMail = Nothing
Use port 465 instead and use ssl (smtpusessl = True) for Gmail or Amazon SES SMTP.
And also have to make sure (log in to the Gmail account mailbox, check if there are messages, that tell you about previous unsuccessful attempts) that the mailbox usage for the "old applications" are enabled... (it's a new "feature", that can be enabled on Yahoo and Google mail servers since not too long ago... Even maybe some mobile email clients will not work if this is not set.)

kannel smpp: unable to get the acknowledgment

I'm working on a project for sending SMS using SMPP protocol and KANNEL.
Everything is working well; the only problem is that I'm still unable to get the acknowledgment, so I can't know if the message was successfully received by the client or if I should send it again.
Please, does anyone have an idea on how I can solve that? Or if there is a tool with a UI that I can use instead of KANNEL?
Here is my config file:
group = core
dlr-storage = internal
admin-port = 13000
admin-password = password
status-password = password
admin-allow-ip = ''
smsbox-port = 13001
log-level = 0
log-file = "/usr/local/kannel/logs/kannel.log"
box-allow-ip = "127.0.0.1"
group = smsbox
smsbox-id = BOX1
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-file = "usr/local/kannel/logs/smsbox.log"
log-level = 0
access-log = "usr/local/kannel/logs/access.log"
group = sendsms-user
username = user
password = password
group = smsc
smsc = smpp
smsc-id = SMSC1
host = my_host_ip
port = my_host_port
smsc-username = user
smsc-password = password
address-range = ""
system-type = ""
transceiver-mode = true
When sending your message, make sure you have your registered_delivery flag set appropriately.
Add dlr-mask = 31 to "group = sendsms-user"
OR
Using the Kannel HTTP API, set your dlr-mask. For example:
http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&to=+12345678910&text=Test&dlr-mask=31
From the Kannel User Guide: "dlr-mask: Optional. Request for delivery reports with the state of the sent message. The value is a bit mask composed of: 1: Delivered to phone, 2: Non-Delivered to Phone, 4: Queued on SMSC, 8: Delivered to SMSC, 16: Non-Delivered to SMSC. Must set dlr-url on sendsms-user group or use the dlr-url CGI variable."

Kannel only sending 153 characters

doing a bit of a project at the moment involving Kannel however I am having an issue.
When I send a long sms to the kannel gateway, it receives the first part of the sms and then uses the get-url to send my php script to add to the website. Then the second part gets sent and the same things happens.
Is there a way to send the full sms to the website?
Thanks very much in advance for any help. Below is my appended kannel.conf
group = core
admin-port = <snip>
admin-password = <snip>
status-password = <snip>
smsbox-port = <snip>
wdp-interface-name = "*"
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
group = smsc
smsc = at
modemtype = auto
device = /dev/ttyUSB1
speed = 9600
connect-allow-ip = 127.0.0.1
group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = <snip>
sendsms-chars = "0123456789 +-"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
global-sender = <snip>
sms-length = 500
group = sendsms-user
username = <snip>
password = <snip>
concatenation = true
group = modems
id = huawei_e220
name = "Huawei_E220"
detect-string = "huawei"
message-storage = sm
speed = 9600
group = sms-service
keyword =
catch-all = 1
max-messages = 0
# trying this below
#assume-plain-text = true
concatenation = true
get-url = "http://<snip>.net/inbound.php?phone=%p&text=%t"
# Ends
It may have something to do with your GSM modem. If I try a very similar configuration with a real SMSC, the message is properly reassembled. Also, the get-url for your sms-service group is incorrect - %t is message timestamp, if you want the whole message content, you should use %a. (At least that's the case with Kannel 1.5.0.)
So, the issue itself was to do with the routing of the messages from the bearerbox to the smsc and smsbox. Basically I had to define an smsc which pointed to the smsbox and that seemed to fix it. I do not have the code with me at the moment to post up however, for anyone else having this issue - please check your smsc settings.
Try to add the following settings to core group to combine MO SM from parts:
group = core
...
sms-combine-concatenated-mo = 1
sms-combine-concatenated-mo-timeout = 600
If this will not help - add logging to your smsc section with debug level (log-level = 0) to see diagnostics from Kannel.

VBScript Sending Email with High Importance

I used VBScript to write a function to send email automatically.
With .Configuration.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "SMTPHOST.redmond.corp.microsoft.com"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPAuthenticate) = cdoNTLM
.Item("urn:schemas:httpmail:importance") = sMailPriority
.Update
When I want to send email with high important, I set the sMailPriority to 2. When I test with the Gmail, it worked. But when I using outlook2010, it didn't work.
Some e-mail clients requires different headers to set e-mail priority.
Try to add all of these fields.
.Item("urn:schemas:httpmail:importance") = sMailPriority
.Item("urn:schemas:httpmail:priority") = 1 'sMailPriority
.Item("urn:schemas:mailheader:X-Priority") = 1 'sMailPriority

Resources