Skip to content

Commit b987c8e

Browse files
author
Kirill Kirsanov
committed
коррекктировка TON
1 parent f677da2 commit b987c8e

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

client.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,33 +118,18 @@ def sendMessage(self, sphone, tphone, message, op='tele2'):
118118
nonums = "".join(filter(lambda x: not x.isdigit(), sphone))
119119
if len(nonums) > 0:
120120
cfg['source_addr_ton'] = consts.SMPP_TON_ALNUM
121-
cfg['source_addr_npi'] = consts.SMPP_TON_UNK
121+
cfg['source_addr_npi'] = consts.SMPP_NPI_UNK
122122
cfg['dest_addr_ton'] = consts.SMPP_TON_INTL
123123
cfg['dest_addr_npi'] = consts.SMPP_NPI_ISDN
124124
else:
125-
cfg['source_addr_ton'] = consts.SMPP_TON_UNK
126-
cfg['source_addr_npi'] = consts.SMPP_NPI_ISDN
127-
cfg['dest_addr_ton'] = consts.SMPP_TON_INTL
128-
cfg['dest_addr_npi'] = consts.SMPP_NPI_ISDN
129-
"""
130-
if len(nonums)>0:
131-
cfg['source_addr_ton'] = consts.SMPP_TON_ALNUM
132-
cfg['source_addr_npi'] = consts.SMPP_TON_UNK
133-
cfg['dest_addr_ton'] = consts.SMPP_TON_INTL
134-
cfg['dest_addr_npi'] = consts.SMPP_NPI_ISDN
135-
else:
136-
137-
cfg['source_addr_ton']=consts.SMPP_TON_NWSPEC
138-
cfg['source_addr_npi'] = consts.SMPP_NPI_ISDN
139-
cfg['dest_addr_ton'] = consts.SMPP_TON_NATNL
140-
cfg['dest_addr_npi'] = consts.SMPP_NPI_ISDN
141-
"""
125+
cfg['source_addr_ton'] = 5#consts.SMPP_TON_UNK
126+
cfg['source_addr_npi'] = 0#consts.SMPP_NPI_ISDN
127+
cfg['dest_addr_ton'] = 1#consts.SMPP_TON_INTL
128+
cfg['dest_addr_npi'] = 1#consts.SMPP_NPI_ISDN
142129
try:
143130
parts, encoding_flag, msg_type_flag = gsm.make_parts(message)
144-
145131
for part in parts:
146132
pdu = self.send_message(
147-
148133
source_addr_ton=cfg['source_addr_ton'],
149134
source_addr_npi=cfg['source_addr_npi'],
150135
source_addr=sphone,

0 commit comments

Comments
 (0)