EnableNewMessageNotification(MessageNotification.ReceivedMessage) works but still returns 'false'
Added by beerygaz over 4 years ago
If result = ModemGateway.EnableNewMessageNotification(MessageNotification.ReceivedMessage) Then _log.Info("Inbound message notification set") Else _log.Error(ModemGateway.LastError, "Error setting message notification: {0}", ModemGateway.LastError.Message) End If
Produces the correct result in the log (CNMI=2,1,0,0,1), but still returns "False" with the following error:
Error setting message notification: Unsupported feature: SetMessageIndicationsFeature: Set message indications (CMS ERROR: 500 Unknown error)
However, new inbound messages do trigger. It's just that EnableNewMessageNotification(MessageNotification.ReceivedMessage) returns 'False'
Log:
2015.11.12-09.30.29: Sending watch dog message 2015.11.12-09.30.29: Sending: AT 2015.11.12-09.30.29: Response: <cr><lf>OK<cr><lf> 2015.11.12-09.30.35: Sending: AT+CNMI=2,1,0,0,1 2015.11.12-09.30.35: Response: <cr><lf>OK<cr><lf> 2015.11.12-09.40.53: Unsolicited message: +CMTI: "SM",1 2015.11.12-09.40.53: New SMS-DELIVER received (indicated by memory location)
Replies (3)
RE: EnableNewMessageNotification(MessageNotification.ReceivedMessage) works but still returns 'false' - Added by admin over 4 years ago
Hi,
Can you attach the full log file here?
Thanks
Regards
admin
RE: EnableNewMessageNotification(MessageNotification.ReceivedMessage) works but still returns 'false' - Added by beerygaz over 4 years ago
2015.11.20-07.41.29: Sending: ATZ 2015.11.20-07.41.30: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.30: Sending: ATE0 2015.11.20-07.41.30: Response: ATE0<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.30: Found echo in response 2015.11.20-07.41.30: Sending: AT+CPIN? 2015.11.20-07.41.30: Response: <cr><lf>+CPIN: READY<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.30: Sending: ATE0 2015.11.20-07.41.31: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.31: Sending: AT+COPS=0,2 2015.11.20-07.41.31: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.31: Sending: ATE0 2015.11.20-07.41.31: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.31: Sending: AT+CMEE=1 2015.11.20-07.41.32: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.32: Sending: AT+CPMS? 2015.11.20-07.41.32: Response: <cr><lf>+CPMS: "SM",0,50,"SM",0,50,"SM",0,50<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.32: Sending: AT+CMGF=0 2015.11.20-07.41.32: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.32: Sending: AT+CNMI=0,0,0,0,0 2015.11.20-07.41.32: CMS ERROR: 500 Unknown error 2015.11.20-07.41.33: Sending: AT+CNMI=2,0,0,0,0 2015.11.20-07.41.33: CMS ERROR: 500 Unknown error 2015.11.20-07.41.33: Sending: AT+CNMI=1,0,0,0,0 2015.11.20-07.41.33: CMS ERROR: 500 Unknown error 2015.11.20-07.41.33: Sending: AT+CNMI=3,0,0,0,0 2015.11.20-07.41.34: CMS ERROR: 500 Unknown error 2015.11.20-07.41.34: Sending: AT+CPMS="SM","SM","SM" 2015.11.20-07.41.34: Response: <cr><lf>+CPMS: 0,50,0,50,0,50<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.34: Sending: AT+CSCA="+27829119",145 2015.11.20-07.41.34: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.34: Sending: AT+CMEE=1 2015.11.20-07.41.35: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.35: Sending: AT+CMGF=0 2015.11.20-07.41.35: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.35: Sending: AT+CNMI=? 2015.11.20-07.41.35: Response: <cr><lf>+CNMI: (0-3),(0,1),(0,2,3),(0,2),(1)<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.35: Sending: AT+CNMI=2,1,0,0,1 2015.11.20-07.41.36: Response: <cr><lf>OK<cr><lf> 2015.11.20-07.41.36: Sending: AT+CSQ 2015.11.20-07.41.36: Response: <cr><lf>+CSQ: 29,99<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.36: Sending: AT+CPMS="SM" 2015.11.20-07.41.36: Response: <cr><lf>+CPMS: 0,50,0,50,0,50<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.36: Sending: AT+CPMS? 2015.11.20-07.41.37: Response: <cr><lf>+CPMS: "SM",0,50,"SM",0,50,"SM",0,50<cr><lf><cr><lf>OK<cr><lf> 2015.11.20-07.41.37: Sending: AT+CMGL=4 2015.11.20-07.41.37: Response: <cr><lf>OK<cr><lf>
RE: EnableNewMessageNotification(MessageNotification.ReceivedMessage) works but still returns 'false' - Added by beerygaz over 4 years ago
Looks like some bad logic in my code, I changed
If result = ModemGateway.EnableNewMessageNotification(MessageNotification.ReceivedMessage) Then _log.Info("Inbound message notification set")
to
Dim result = ModemGateway.EnableNewMessageNotification(MessageNotification.ReceivedMessage) If result = Then _log.Info("Inbound message notification set")
And all is well.