src_ton in http api

302 views
Skip to first unread message

Christian

unread,
Feb 9, 2017, 6:07:46 AM2/9/17
to Jasmin SMS Gateway
Hi there,

i've setup jasmin and trying to send sms via http api. 

Using Jasmin 0.9.b15

Here's my configuration for smpp connection: 

jcli : smppccm -s smsc
ripf 0
con_fail_delay 10
dlr_expiry 86400
coding 0
logrotate midnight
submit_throughput 10
elink_interval 30
bind_to 30
port 9000
con_fail_retry yes
password ...
src_addr None
bind_npi 0
addr_range None
dst_ton 1
res_to 120
def_msg_id 0
priority 0
con_loss_retry yes
username ...
dst_npi 1
validity None
requeue_delay 120
host ....
src_npi 0
trx_to 300
logfile /var/log/jasmin/default-smsc.log
systype 
ssl no
cid smsc
loglevel 10
bind transceiver
proto_id None
dlr_msgid 0
con_loss_delay 10
bind_ton 0
pdu_red_to 10
src_ton 5

It works fine while sending sms with alphanumeric sender id over http api, but fails on sending numeric sender id: 

2017-02-09 11:52:13 DEBUG    5948 Sending PDU: PDU [command: submit_sm, sequence_number: 2, command_status: ESME_ROK
service_type: None
source_addr_ton: 'ALPHANUMERIC'
source_addr_npi: 'UNKNOWN'
source_addr: '+49176223xxxxx'
dest_addr_ton: EnumValue(<jasmin.vendor.enum.Enum object at 0x7f1241d32b10>, 6, 'INTERNATIONAL')
dest_addr_npi: EnumValue(<jasmin.vendor.enum.Enum object at 0x7f1241d32d50>, 9, 'ISDN')
destination_addr: '4917622xxxxxx'
esm_class: EsmClass[mode: STORE_AND_FORWARD, type: DEFAULT, gsmFeatures: set([])]
protocol_id: None
priority_flag: EnumValue(<jasmin.vendor.enum.Enum object at 0x7f1241d327d0>, 0, 'LEVEL_0')
schedule_delivery_time: None
validity_period: None
registered_delivery: RegisteredDelivery[receipt: SMSC_DELIVERY_RECEIPT_REQUESTED, smeOriginatedAcks: set([]), intermediateNotification: False]
replace_if_present_flag: EnumValue(<jasmin.vendor.enum.Enum object at 0x7f1241d32950>, 0, 'DO_NOT_REPLACE')
data_coding: DataCoding[scheme: DEFAULT, schemeData: SMSC_DEFAULT_ALPHABET]
sm_default_msg_id: 0
short_message: 'hello'
]
2017-02-09 11:52:13 DEBUG    5948 Sending data [000000410000000400000000000000020005002b3439313736323233323935343500010134393137363232333239353435000300000000010000000568656c6c6f]

Im getting Error 34. It works fine if i switch src_ton to 1 in smsc configuration. Is Jasmin not able to dynamically set src_ton based on "from" Parameter in http api? How could i solve this?

Thanks!
Christian

Bruno C

unread,
Mar 5, 2017, 11:04:16 AM3/5/17
to Jasmin SMS Gateway
src_ton is statically set when configuring the connector, it will not be changed from the http api for whatever src_address you set.

If you need to set some conditioning for setting src_ton, then do it through interceptor, that's one standard use of it !

Odyssey

unread,
Mar 8, 2017, 1:05:11 PM3/8/17
to Jasmin SMS Gateway
Dear Bruni,
Thanks for your reply, when send SMS via SMPP and src_ton=5 alphanumerical character sent as source address but when using http api, just letters allow to sent as source address and numeral source addresses not sent until src_ton changed to 1
Please note that our jasmin version is 0.9.b15

Eno

unread,
Oct 23, 2017, 6:05:42 AM10/23/17
to Jasmin SMS Gateway
Hello, 

I have the same problem and I need your help to build conditioning for setting src_ton on interceptor, so that it works automatically with src_ton 5 and 1.
hope to have helped!

Thanks
Eno

Eno

unread,
Oct 24, 2017, 2:07:03 PM10/24/17
to Jasmin SMS Gateway
Hi,
i have a solution and ist work:  interceptor.py

"Select route (connector) based on source_addr. Filter tag 1 = international, tag 2 = alphanumeric"
from jasmin.vendor.smpp.pdu.pdu_types import AddrTon
if routable.pdu.params['source_addr'][:2] == "49" or routable.pdu.params['source_addr'][:3] == "+49":
routable.addTag(1)
else:
routable.addTag(2)
Reply all
Reply to author
Forward
0 new messages