Cannot identify concated messages. It will generate multiple emails in random orders.
Please let me know on how I can fix it. Thanks.作者: mcdull 時間: 2017-8-25 09:18
exten => sms,8,System(awk '{if ( NR == "2" ) print}' /var/log/asterisk/smsCMGRraw${DONGLENAME}_${channelID} | tee -a /var/log/asterisk/smsPDUraw${DONGLENAME}_${channelID})
What is the logic behind in your python to check if all SMS received?作者: mcdull 時間: 2017-9-26 21:35
What is the logic behind in your python to check if all SMS received?
ttmuskie 發表於 2017-9-26 19:51
the python will return 0 if the SMS is single or the last part of the concat message.
and 1 if the SMS is incomplete.. yet.
Originally I intended to use exit code but I cannot capture the return result properly. So I changed it to use the print out.作者: ttmuskie 時間: 2017-9-26 22:22
How to check if that's a single SMS or last part of the concat msg?作者: mcdull 時間: 2017-9-27 10:00
That was the tricky part. I initially want to decode the pdu just for the concat msg information. And it was found too complicated and I had to decode much variation of UDH. A lot of tools were available online only. And local library will NOT decode concat message correctly. So I have to make reference to http://smspdu.benjaminerhart.com/
I have much hesitation to post my sms online as it may contain verification from online banking, so I pulled the javascript (source provided in the site). With the same reason, I given up to port the javascript to python, so I have to set up a webserver (luckily I already got my own) and use beautifulsoup to capture the output for return.作者: mcdull 時間: 2017-9-27 10:25
I will use only the first return character as specified in the dialplan rule.作者: mcdull 時間: 2017-9-27 10:42
These should work with multiple dongles. I have 5 installed currently but it is not stable. I guess the hub cannot power 5 dongles so I removed one and left 4.作者: ttmuskie 時間: 2017-9-27 11:13
wow... you are amazing.作者: mcdull 時間: 2017-9-27 14:23
I am now still facing some issues.
If different message part come together, the python may finish in different time in reserve order and the sms will be displayed and sent in wrong order, and may receive multiple email or incomplete message email.作者: mcdull 時間: 2017-9-27 16:46
exten => sms,8,System(awk '{if ( NR == "2" ) print}' /var/log/asterisk/smsCMGRraw${DONGLENAME}_${channelID} | tee -a /var/log/asterisk/smsPDUraw${DONGLENAME}_${channelID})
exten => sms,8,System(awk '{if ( NR == "2" ) print}' /var/log/asterisk/smsCMGRraw${DONGLENAME}_${channelID} | tee -a /var/log/asterisk/smsPDUraw${DONGLENAME}_${channelID})
Hit a major issue in python.
when sys.exit after calling webdriver.PhantomJS(), it will not clean up the phantomJS child process. If I add driver.quit(), the phantomJS will not be closed either and the dialplan will not continue.
After a few tens of SMS, the server will run out of memory. No fix yet. Damn this simple things coz hell of troubles.
temp fix by issuing SIGKILL作者: mcdull 時間: 2017-10-10 12:04