2012-02-24 157 views
4

我正在使用Kannel以發送/接收SMS,到目前爲止我們被告知要閱讀有關Kannel的文檔,並且還要進行模擬。我能夠使用Opensmpp發送短信,但我在接收短信給我的Kannel以處理它時遇到麻煩。如果有任何機會與OpenSmpp做這件事,請告訴我,因爲我被卡在這裏。如果不是,你可以將我引薦給另一個可以給我這種可能性的SMSC模擬器。 感謝您提前使用Kannel和SMSC模擬器發送和接收短信

回答

7

我可以強烈建議使用Selenium Software的SMPPSIM作爲SMSC模擬器。上次我從here得到它。它需要Java,但是如果我沒有記錯的話,OpenSMPP也是如此。一旦你啓動並運行,你可以連接到它的Web Interface端口,它允許你注入將被髮送到連接的客戶端的消息。它也允許ESME到ESME模式,它基本上發回你發送的所有內容。

+0

可否請你展示一個代碼示例如何在收發器模式下運行OpenSMPP。我可以成功將消息發送到SMSC,但無法獲得遞送回復。 – gkiko 2014-10-13 07:03:34

7

感謝您的回答。我使用SMPPSIm,它運行良好。我會把我的配置希望這將有助於某人。 Kannel.conf:

#kannel.conf 
group = core 
admin-port = 13000 
smsbox-port = 14000 
admin-password = saad 
log-file = /home/saad/klogs/kannel.log 
log-level = 0 
access-log = /home/saad/klogs/access_kannel.log 
dlr-storage = pgsql 

#--- postgresql connection 
group = pgsql-connection 
id = mydlr 
host = 127.0.0.1 
port = 5432 
username = saad 
password = **** 
database = kannelDb 
max-connections = 1 

#---- DLR table structure 
group = dlr-db 
id = mydlr 
table = "kannel_dlr" 
field-smsc = smsc 
field-timestamp = timstamp 
field-destination = destination 
field-source = source 
field-service = service 
field-url = url 
field-mask = mask 
field-status = status 
field-boxc-id = boxc_id 

group = smsbox 
#smsbox-id = mysmsbox do not uncomment this if you have only one smsbox 
bearerbox-host = localhost 
sendsms-port = 1025 
#global-sender = 1000 
log-file = /home/saad/klogs/smsbox.log 
log-level = 0 
mo-recode = true 

group = smsc 
smsc = smpp 
smsc-id = SMPPSim 
host = 127.0.0.1 
port = 2775 
transceiver-mode = 1 
receive-port = 2775 
smsc-username = smppclient1 
smsc-password = password 
system-type = 'VMA' 
#service-type = 'test' 
interface-version = 34 
#system-id = smppclient 
preferred-smsc-id = SMPPSim 

group = sendsms-user 
username = saad 
password = **** 
#forced-smsc = SMPPSim 
default-sender = '1000' 


group = sms-service 
keyword = default 
accept-x-kannel-headers = true 
#text = "No service specified" 
catch-all = true 
max-messages = 0 # it's better to put this parameter to 0 or you will have a lot Ack in  your network 
get-url = "http://localhost/kannel/?phone=%p&text=%a" 
+0

你好,確實kanel轉發到你指定處理入站短信的網址 – Smith 2013-04-23 09:27:08

+0

Hi @Smith,是的,你需要做的就是在get-url參數上放置合適的url,並且每次Kannel收到一個url短信。 – 2013-04-24 10:21:02

+0

好吧,還有一個問題,我怎麼發送短信從我的PHP應用程序到虛擬號碼或kanel,以便當它收到它將轉發到我的網址 – Smith 2013-04-24 11:37:20