[英]Tropo and RapidSMS integration does not work
I followed all the steps detailed at http://docs.rapidsms.org/en/develop/tutorial/tutorial04.html to use tropo to send and receive SMS in RapidSMS of Django and deployed it on heroku. 我按照http://docs.rapidsms.org/en/develop/tutorial/tutorial04.html上详述的所有步骤使用tropo在Django的RapidSMS中发送和接收SMS,并将其部署在heroku上。 Then I tried to do 2 things.
然后我尝试做两件事。
1) send SMS using tropo - I registered a phone number and while selecting the back-end, I was thinking that Tropo (my-tropo-backend) would be an option in the back-end selection. 1)使用tropo发送短信-我注册了一个电话号码,并且在选择后端时,我以为Tropo(my-tropo-backend)将是后端选择中的一个选项。 But I don't see tropo as a backend option, just message_tester.
但是我不认为tropo是后端选项,而只是message_tester。
2) receive SMS using tropo - I send a SMS to my tropo phone number, I can see the message coming in tropo log, but I don't see a response from Django URL https://yourhost.example.com/tropo/ in the tropo log (used ping-pong example). 2)使用tropo接收短信-我将短信发送到我的tropo电话号码,我可以在tropo日志中看到该消息,但看不到Django URL https://yourhost.example.com/tropo/的响应在对数日志中(以乒乓为例)。
My Django settings for RapidSMS and Tropo is as follows: 我对RapidSMS和Tropo的Django设置如下:
INSTALLED_BACKENDS = {
"my-tropo-backend": {
"ENGINE": "rtropo.outgoing.TropoBackend",
'config': {
# Your Tropo application's outbound token for messaging (required)
'messaging_token': '244e51db5424c3438f122753b8947dee70803dshlfhdfdsdkjfdfd455466565e8e620c05f75323c17864',
# Your Tropo application's voice/messaging phone number, starting
# with "+" and the country code (required)
'number': '+1-000-200-6007',
},
},
"message_tester": {
"ENGINE": "rapidsms.backends.database.DatabaseBackend",
},
}
urls.py has urls.py有
url(r"^tropo/$",
views.message_received,
kwargs={'backend_name': 'my-tropo-backend'},
name='tropo'),
and 'rtropo' has been added to INSTALLED_APPS 并且“ rtropo”已添加到INSTALLED_APPS
What am I missing, Anyone done this before and faced this issue? 我想念的是什么,有人做过此事并遇到过这个问题吗? Please let me know.
请告诉我。
Thank you. 谢谢。
The problem was I was not putting the trailing slash at the end of the URL in Tropo settings. 问题是我没有在Tropo设置中的URL末尾添加斜杠。 Example: I was giving https://yourhost.example.com/tropo it should be https://yourhost.example.com/tropo/
示例:我给的是https://yourhost.example.com/tropo,它应该是https://yourhost.example.com/tropo/
With the trailing slash at the end, Django redirects to the same URL after adding a trailing slashes and this this time the data is sent by GET and not by POST. 末尾带有斜杠,Django在添加斜杠后重定向到相同的URL,这一次数据是通过GET发送的,而不是通过POST发送的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.