Re[4]: route from opensmppbox to internal API

Хиль Эдуард <[email protected]>
Newsgroups gmane.comp.mobile.kannel.user
Message-ID <[email protected]>
Hey, Ruben! Thank you for your attention on my problem!

My last problem was, cuz i haven't defined any SMSC in my config. For example, this config works without error:

#
# opensmppbox config
#
group = core
dlr-storage = internal
store-file = "/var/log/kannel/smpp_store_sms"
group = opensmppbox
opensmppbox-id = test12
opensmppbox-port = 13005
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
log-level = 0
log-file = "/var/log/kannel/opensmppbox.log"
our-system-id = test12
use-systemid-as-smsboxid = true
smpp-logins = "/etc/kannel/users.conf"

#
# kannel config
#
group = core
admin-port = 13000
admin-password = "1234556"
status-password = "1234556"
admin-deny-ip = "*.*.*.*"
admin-allow-ip = "192.168.*.*"
log-file = "/var/log/kannel/bearerbox.log"
log-level = 0
access-log = "/var/log/kannel/access_kannel.log"
store-file = "/var/log/kannel/store_sms"
smsbox-port = 13001
dlr-storage = internal
sms-resend-retry = 1
group = smsc
smsc = fake
port = 10000
group = smsc
smsc = loopback
smsc-id = loop1
reroute-dlr = true
allowed-smsc-id = loop1
group = smsbox-route
smsbox-id = test12
smsc-id = loop1
group = smsbox
bearerbox-host = localhost
sendsms-port = 13003
log-file = /var/log/kannel/smsbox.log
log-level = 0
access-log = /var/log/kannel/access_smsbox.log
group = sendsms-user
username = "user"
password = "1234556"
concatenation = true
max-messages = 20
group = sms-service
keyword = default
catch-all = yes
omit-empty = true
assume-plain-text = yes
#post-url = "http://127.0.0.1/sendsms.php?d=%d&R=%R&F=%F&I=%I&c=%c=%C&O=%O&u=%u&n=%n&p=%p&P=%P&b=%b"
post-url = "http://127.0.0.1/sendsms.php?src=%p&dst=%P&time=%t&coding=%c&smsc=%i&charset=%C"
concatenation = true
max-messages = 0
BUT! This wrong logic. All SMS from client behind opensmpp, kannel simple resend to FAKESMSC. I don't need that kannel resend this SMS, cuz this SMS for me, i want kannel to "store" all SMS from opensmppbox to API with defined sms-service.

>Понедельник,  4 марта 2019, 1:47 +05:00 от Ruben Melikyan <[email protected]>:
>
>Hi Eduard, 
>I think you have messed something in your configurations. Can you please check  if your configs are correct? In my example 1234 was the opensmppbox-id, which receives incoming message. Otherwise you can share your configs which lead to error. 
> In this case maybe I can tell you why you are receiving mentioned errors.
>
>Best regards,
>Ruben Melikyan
>
>On Mar 2, 2019, at 17:31, Хиль Эдуард < [email protected] > wrote:
>
>>Hey, Ruben! Thank you for your advice and configs example!
>>
>>I have tried that configuration, and i got an errors:
>>
>>WARNING: Cannot find SMSCConn for message to < +99887766 >, rejected.
>>WARNING: Message rejected by bearerbox, no router!
>>
>>But if i remove " allowed-smsc-id = loop1 " on loopback settings, i sees another error
>>
>>WARNING: Could not route message to smsbox id <1234>, smsbox is gone!
>>
>>I have stuck on this error for this time... so i have tried another way: i have removed " smsbox-route " complitely, and on opensmppbox settings added "route-to-smsc = loop1" and it works, i see how kannel POST my sms:
>>
>>POST /sendsms.php?src=%2B1122334455&dst=%2B99887766&time=2019-03-02+12:55:02&coding=0&smsc=loop1&charset=UTF-8 HTTP/1.1
>>
>>but and in this case all not so fine... as you can see, there is "&smsc=loop1" thats mean, kannel will put loop1 in all cases, and if on my opensmppbox connects many clients - all of them will be "loop1" and i can't distinguish between them. In this case the only right decision is somehow chagne my API logic? And all this solution with opensmppbox "route-to-smsc" option is correct? Maybe i must somehow solve "Could not route message to smsbox id" error and then doing how said Ruben?
>>
>>>Суббота,  2 марта 2019, 16:04 +05:00 от Ruben Melikyan < [email protected] >:
>>>
>>>Hi Eduard,
>>> 
>>>You should config loopback smsc which will handle your incoming message from opensmppbox to your service.
>>> 
>>>Config example:
>>>#-----OPENSMPPBOX-----
>>>group = opensmppbox
>>>opensmppbox-id =  1234
>>>opensmppbox-port = …
>>>bearerbox-host = …
>>>bearerbox-port = …
>>>log-level = …
>>>log-file = ….
>>>our-system-id = ….
>>>smpp-logins = …..
>>>use-systemid-as-smsboxid=true
>>>source-addr-ton = …
>>>source-addr-npi = …
>>>dest-addr-ton = ….
>>>dest-addr-npi = ….
>>> 
>>>#-----SMSC smpp LOOP1-----
>>>group = smsc
>>>smsc = loopback
>>>smsc-id = loop1
>>>reroute-dlr=true
>>>allowed-smsc-id = loop1
>>> 
>>> 
>>># ------  SMS SERVICE ------
>>>group = sms-service
>>>keyword = default
>>>catch-all=yes
>>>max-messages = 4
>>>omit-empty = true
>>>assume-plain-text = yes
>>>concatenation = true
>>>max-messages = 4
>>>post-url =….
>>> 
>>># ------  SMS ROUTING ------
>>> 
>>>group = smsbox-route
>>>smsbox-id = 1234
>>>smsc-id = loop1
>>> 
>>> 
>>> 
>>> 
>>>Best regards
>>>Ruben Melikyan
>>> 
>>> 
>>>From: users [ mailto:[email protected] ]  On Behalf Of  Хиль Эдуард
>>>Sent: Saturday, 2 March, 2019 13:08
>>>To: [email protected]
>>>Subject: route from opensmppbox to internal API
>>> 
>>>Hi there!
>>>Let's imagine, that i have on my kannel one smsc and one sms-service with config:
>>>group = sms-service
>>>keyword = default
>>>post-url = " http://127.0.0.1/sendsms.php?src=%P&dst=%p&time=%t&coding=%c&smsc=%n&charset=%C "
>>>concatenation = true
>>>max-messages = 0
>>>
>>>In this case, when kannel calls this API, he used POST method and on this API (on PHP page) i have some code "file_get_contents('php://input')" where i can get text of SMS from html-body. All works correct and i'm satisfied.
>>>But now, i have opensmppbox and i must somehow route sms from opensmppbox to this API. I have find 2 methods: with "smsc http" and "smsc http with system-type generic", but in this both cases kannel uses GET method, and i must use %b variable that put text in http link (for example: ...&smsc=%n&charset=%C%text=%b), but i can't, cuz there are length and charset troubles - i can't put on my link sms message with over 900 symbols with strange codepage :'( 
>>>So, maybe there are some other methods to route SMS from opensmppbox to kannel sms-service? Or maybe kannel can use POST method not only on sms-service group?
>>>-- 
>>>Best regards,
>>>Me.
>>
>>-- 
>>Best regards,
>>Me.

-- 
Хиль  Эдуард
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.