Kannel receiving and processing long SMS - sms-gateway

Kannel 1.4.3
I need to receive "long" sms (length > 160 symbols) by Kannel. If sms length less than 160 - all is ok. But if it is long sms kannel splits sms to 2 or more sms and send not like one concatened sms but 2 or more different messages.
I tried to use
sms-combine-concatenated-mo = true
in kannel.conf core section but it did not help.
Here is my sms-service config:
# SMS Gateway Reciever
group = sms-service
keyword = default
omit-empty = true
post-url = "http://localhost:22222/recievesms?from=%p&time=%t&smsc=%i&coding=%c&service=%n&charset=%C"
concatenation = true
Can anybody suggest how to resolve this problem.

Problem was resolved by installing new version (daily snapshot) of Kannel.

Related

How do RabbitMQ per connection flow-control block client from publishing messages?

I'm new to RabbitMQ and I really want to figure out the detailed implementation of per connection flow control of RabbitMQ.
I read the source code of RabbitMQ server but can't find how flow-control blocking rabbitmq-java-client from publishing messages.
In rabbit_reader.erl I find control_throttle method which most likely do the flow control work.
% rabbitmq-server v3.7.x rabbit_reader.erl
control_throttle(State = #v1{connection_state = CS,
throttle = #throttle{blocked_by = Reasons} = Throttle}) ->
Throttle1 = case credit_flow:blocked() of
true ->
Throttle#throttle{blocked_by = sets:add_element(flow, Reasons)};
false ->
Throttle#throttle{blocked_by = sets:del_element(flow, Reasons)}
end,
State1 = State#v1{throttle = Throttle1},
case CS of
running -> maybe_block(State1);
%% unblock or re-enable blocking
blocked -> maybe_block(maybe_unblock(State1));
_ -> State1
end.
But in maybe_block method, it will send a "connection.blocked" message to client, which I find in rabbit-java-client is high-water-mark blocking message, not flow-control blocking.
So how does flow control block the client from publishing messages?
Where are the codes for blocking?
Does it block only on server-side or both on server and client side?
Thanks

"Mailbox size limit exceeded" when sending mails on an empty exchange account with MailKit .Net

I am using MimeKit and Mailkit to send emails from my VB.NET application, through my own SMTP server (run on Windows Server 2016, with SmarterMail).
Until then, I was sending emails to info#mywebsite.com which is an alias of infos#mywebsite.com and it worked very well. This email account is a exchange account with more of 49 Gio free.
Since a few days, I've received this error : Mailbox size limit exceeded
When a set a spy on it, this is what I get :
This is the log :
S: 235 Authentication successful
C: MAIL FROM:<info1#mywebsite.com> SIZE=599
S: 250 OK <info1#mywebsite.com> Sender ok
C: RCPT TO:<info#mywebsite.com>
S: 452 <info#mywebsite.com> Mailbox size limit exceeded
C: RSET
S: 250 OK
I don't understand why I get this error while my recipient account is pretty much empty.
When I try to send email from my outlook account to info#mywebsite, I get no error.
When I try to send emails from my code to anothers recipients, I get no error.
My disk space is very large on my mail serveur (almost 2 To).
This is my code :
Dim message As New MimeMessage()
message.From.Add(New MailboxAddress("My website", "info1#mywebsite.com"))
message.To.Add(New MailboxAddress("My website", "info#mywebsite.com"))
message.Subject = "any subject"
Dim builder As New BodyBuilder()
builder.TextBody = textemail
builder.HtmlBody = htmlemail
message.Body = builder.ToMessageBody()
' SERVER SMTP
Using client As New MailKit.Net.Smtp.SmtpClient()
client.ServerCertificateValidationCallback = (Function(sender, certificate, chain, sslPolicyErrors) True)
client.Connect("mail.mysmtpserver.com", 587, MailKit.Security.SecureSocketOptions.None)
client.Authenticate("Mailkit_SMTP_UserName", "Mailkit_SMTP_Password")
client.Send(message)
client.Disconnect(True)
End Using
Thanks a lot for any suggestion (I don't find any related topic on Google)
I've found what was wrong in my SMTP server : Smartermail has it own mailbox size configuration for any mail account, that is limited at 100Mb.
You can change it by going on : your domain > Manage > Account

How to communicate with HiveServer2 running NONE authentication

I'm trying to communicate with HiveServer2 via ruby TCPSocket. As per Thrift SASL spec, I send START message and then plain auth information.
Server returns COMPLETE status with an empty payload. It should return challenge as a payload but an empty string.
START = 0x01
OK = 0x02
COMPLETE = 0x05
auth = 'PLAIN'
header = [START, auth.length].pack('cl>')
auth_string = ['anonymous'].pack('u')
auth_message = "[LOGIN] \u0000 #{auth_string} \u0000 #{auth_string}"
auth_header = [OK, auth_message.length].pack('cl>')
socket = TCPSocket.new localhost, 10000
socket.write header + auth
socket.write auth_header + auth_message
socket.read(5).unpack('cl>')
=> [5,0]
HiveServer2 returns 5 status that is COMPLETE.
No further communication is possible via this socket as the server returns nothing anymore.
I suspect auth_message constructed in a wrong way or something else is wrong.
Can anyone suggest the way HiveServer2 will understand my requests?
Any help will be appreciated.
UPD: Thrift SASL spec
UPD2: Solved! STARTTLS block should look like following below:
START = 0x01
OK = 0x02
COMPLETE = 0x05
auth = 'PLAIN'
header = [START, auth.length].pack('cl>')
auth_message = "[ANONYMOUS]\u0000anonymous\u0000anonymous"
auth_header = [OK, auth_message.length].pack('cl>')
socket = TCPSocket.new localhost, 10000
socket.write header + auth
socket.write auth_header + auth_message
socket.read(5).unpack('cl>')
=> [5,0]
After COMPLETE status received from the server, I can use TCLIService::Client to communicate with the HiveServer2. Only one thing to notice:
All writes to the underlying transport must be prefixed by the 4-byte length of the payload data, followed by the payload. All reads from this transport
should read the 4-byte length word, then read the full quantity of bytes
specified by this length word.
Try to use thrift gem and consider https://github.com/dallasmarlow/hiveserver2 instead of Ruby sockets.

Read kannel DLR errors

I have kannel SMPP (kannel.org) and receive SMS statuses by param: %d
And here is table:
16 = not delivered to smsc
8 = you submitted to smsc. ie smsc tell
kannel he has the msg
4 = msg is in smsc queue. ie smsc tell kannel he queued the msg in its queue.
2 = failed 1 = delivered to phone
But here is very low information. How I can receive more information about (wrong number or something like what)? Now is just failed and whats all, if we want to know why failed we must ask our partners support.
More detailed information on delivery error you can fetch from the following sources:
network_error_code TLV (0x0423) - see p. 5.3.2.31 of SMPP v3.4 specification
text part of DLR message (%A in dlr-url)
command_status in case of rejection (represented as "NACK/$code"
Example of text part in DLR:
id:0832095221 sub:001 dlvrd:000 submit date:1203311115 done date:1204010436 stat:UNDELIV err:011 text:some text here
Here you can see 011 error code in undeliverable message.
However there are many vendor specific issues you need to discover with each new SMSC. And no strict requirements in SMPP specification to information to represented in DLR.
For your DLR URL add this:
dlr_mask=31
dlr_url=....?answer=%A&status=%d
Where DLR bitmask means:
1: Received by phone
2: Failure to deliver to phone
4: Queued for delivery
8: Accepted by other SMSC
16: Rejected by other SMSC
If you get a 16, or your get a 2 it'll look like this:
status=<2 or 16 here>
answer=NACK//
The get a table mapping hex_code to its vendor-specific meaning from the carrier

SMPP delivery report

How to check for the delivery report of the sent message. I am using PHP and I have the SMPP account. Can somebody help me with the checking of delivery report?
Will I get a delivery report as message like we get in our mobile?
Or the status of the send function will do for it?
Using SMPP you can retrieve delivery report in the following ways.
First choice is to set registered_delivery parameter to 1 when you send submit_sm PDU.
In this case SMSC should send you deliver_sm PDU with esm_class = 0x04 containing delivery report.
Other way is to request delivery status with query_sm command but this may generate more traffic if polling SMSC too often.
If you're asking about the format in which the Delivery_Receipt will be delivered back to the source then it's carried as the user data payload in the SMPP deliver_sm or data_sm operation.
The following fields are relevant in the deliver_sm and data_sm operations when used for transmitting delivery receipts:
• source address (i.e. source_addr_ton, source_addr_npi, source_addr)
• destination address (i.e. dest_addr_ton, dest_addr_npi, destination_addr)
• esm_class
• message_state
• network_error_code
• receipted_message_id
SMS delivery receipts are regular SMS text messages generated by SMSC, but esm_class = 0x04 is used to differentiate them. The esm_class = 0x04 means PDU direction is SMSC > ESME and short message contains SMSC delivery receipt short message.
Short message area of deliver_sm SMPP PDU consists below text format which is encoded using dcs=0x00 data coding scheme (i.e. SMSC Default Alphabet according to the SMPP specification):
id:{message_id}
sub:{message_sub}
dlvrd:{message_dlvrd}
submit date:{message_submit_date} done
date:{message_done_date}
stat:{message_stat}
err:{message_err}
Sample delivery receipt message text:
id:40072910491427628 sub:001 dlvrd:001 submit date:1007291049 done date:1007291049 stat:DELIVRD err:000
Adding the following link here for details of processing the sample message above:
SMS Delivery Reports with SMPP protocol