{"action":"created","issue":{"url":"https://api.github.com/repos/LinOTP/LinOTP/issues/59","repository_url":"https://api.github.com/repos/LinOTP/LinOTP","labels_url":"https://api.github.com/repos/LinOTP/LinOTP/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/LinOTP/LinOTP/issues/59/comments","events_url":"https://api.github.com/repos/LinOTP/LinOTP/issues/59/events","html_url":"https://github.com/LinOTP/LinOTP/issues/59","id":227674842,"number":59,"title":"HTTP SMS issue","user":{"login":"jfarcher","id":690161,"avatar_url":"https://avatars1.githubusercontent.com/u/690161?v=3","gravatar_id":"","url":"https://api.github.com/users/jfarcher","html_url":"https://github.com/jfarcher","followers_url":"https://api.github.com/users/jfarcher/followers","following_url":"https://api.github.com/users/jfarcher/following{/other_user}","gists_url":"https://api.github.com/users/jfarcher/gists{/gist_id}","starred_url":"https://api.github.com/users/jfarcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfarcher/subscriptions","organizations_url":"https://api.github.com/users/jfarcher/orgs","repos_url":"https://api.github.com/users/jfarcher/repos","events_url":"https://api.github.com/users/jfarcher/events{/privacy}","received_events_url":"https://api.github.com/users/jfarcher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-05-10T13:10:44Z","updated_at":"2017-05-11T14:58:07Z","closed_at":null,"body":"Having a strange issue I have setup our SMS messaging service as a provider, \r\n{ \"URL\":\"https://enterprisemessaging.ee.co.uk/cgphttp/servlet/sendmsg\", \"PARAMETER\": {\"username\":\"XXXXXXXXXXXXXXXXXXXXX\", \"password\": \"XXXXXXXXXX\"}, \"SMS_TEXT_KEY\":\"text\", \"SMS_PHONENUMBER_KEY\":\"destination\",\r\n\"RETURN_SUCCESS\": \"0 001 OK\"}\r\n\r\nIt does send the message but the RETURN_SUCCESS is not matched, I've also tried REGEX.\r\n\r\nUpon turning on the debug I see that an error page is returned\r\n<html>\r\n<body>\r\nAn error occurred.\r\n</body>\r\n\r\n</html>\r\n\r\nI do recieve the text message.\r\n\r\nOriginally I presumed that it was our messaging service, but taking the URL from the debug log which is used and using curl from the command line I get a successful send and proper response.\r\n\r\nI've tried adding <html> to the RETURN_SUCCESS string but even stranger things happen. for some reason a text message isn't sent, but the response match is successful.\r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/LinOTP/LinOTP/issues/comments/300815986","html_url":"https://github.com/LinOTP/LinOTP/issues/59#issuecomment-300815986","issue_url":"https://api.github.com/repos/LinOTP/LinOTP/issues/59","id":300815986,"user":{"login":"jfarcher","id":690161,"avatar_url":"https://avatars1.githubusercontent.com/u/690161?v=3","gravatar_id":"","url":"https://api.github.com/users/jfarcher","html_url":"https://github.com/jfarcher","followers_url":"https://api.github.com/users/jfarcher/followers","following_url":"https://api.github.com/users/jfarcher/following{/other_user}","gists_url":"https://api.github.com/users/jfarcher/gists{/gist_id}","starred_url":"https://api.github.com/users/jfarcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfarcher/subscriptions","organizations_url":"https://api.github.com/users/jfarcher/orgs","repos_url":"https://api.github.com/users/jfarcher/repos","events_url":"https://api.github.com/users/jfarcher/events{/privacy}","received_events_url":"https://api.github.com/users/jfarcher/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T14:58:07Z","updated_at":"2017-05-11T14:58:07Z","body":"Hi,\r\nI had already tried the \"HTTP_Method\":\"GET\" directive.\r\nI tried setting the \"RETURN_SUCCESS\":\".*\" as you suggested and get the following in the log\r\n\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [linotp.lib.tokens.smstoken][sendSMS #886] [sendSMS] submitMessage: u'705062', to phone u'XXXXXXXXXX'\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [linotp.lib.tokens.smstoken][sendSMS #886] [sendSMS] submitMessage: u'705062', to phone u'XXXXXXXXXX'\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_submitMessage #76] [submitMessage] submitting message 705062 to XXXXXXXXXX\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_submitMessage #82] [submitMessage] by method GET\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][getParameters #188] [getParameters] urldata: {u'destination': u'XXXXXXXXXX'}\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][getParameters #193] [getParameters] urldata: {u'text': u'705062', u'destination': u'XXXXXXXXXX'}\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][getParameters #198] [getParameters] urldata: {u'username': u'XXXXXXXXXX', u'text': u'705062', u'password': u'XXXXXXXXXX', u'destination': u'XXXXXXXXXX'}\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_submitMessage #85] [submitMessage] Now doing the Request\r\n2017/05/11 - 15:48:42 INFO  {140507758040832} [urllib3.connectionpool][_new_conn #807] Starting new HTTPS connection (1): enterprisemessaging.ee.co.uk\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [urllib3.connectionpool][_make_request #401] \"GET /cgphttp/servlet/sendmsg?username=XXXXXXXXXX&text=705062&destination=XXXXXXXXXX&password=XXXXXXXXXX HTTP/1.1\" 401 None\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][requests_request #317] HttpSMSProvider >><html>\r\n<body>\r\nAn....\r\n</body>\r\n\r\n</html>\r\n<<\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_check_success #213] [_check_success] entering with config {u'SMS_PHONENUMBER_KEY': u'destination', u'URL': u'https://enterprisemessaging.ee.co.uk/cgphttp/servlet/sendmsg', u'RETURN_SUCCESS': u'.*', u'HTTP_Method': u'GET', 'timeout': u'120', u'SMS_TEXT_KEY': u'text', u'PARAMETER': {u'username': u'XXXXXXXXXX', u'password': u'XXXXXXXXXX'}}\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_check_success #214] [_check_success] entering with reply <html>\r\n<body>\r\nAn error occurred.\r\n</body>\r\n\r\n</html>\r\n\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_check_success #240] [_check_success] success: .*\r\n2017/05/11 - 15:48:42 WARNI {140507758040832} [smsprovider.HttpSMSProvider][_check_success #244] [_check_success] failed to send SMS. Reply does not match the RETURN_SUCCESS definition\r\n2017/05/11 - 15:48:42 ERROR {140507758040832} [smsprovider.HttpSMSProvider][requests_request #321] HttpSMSProvider Exception('We received a none success reply from the SMS Gateway.',)\r\n2017/05/11 - 15:48:42 WARNI {140507758040832} [smsprovider.HttpSMSProvider][_submitMessage #168] Failed to access the HTTP SMS Service with requests: Exception('Failed to send SMS. We received a none success reply from the SMS Gateway.',)\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][httplib_request #348] Do the request to https://enterprisemessaging.ee.co.uk/cgphttp/servlet/sendmsg with {u'username': u'XXXXXXXXXX', u'text': u'705062', u'password': u'XXXXXXXXXX', u'destination': u'XXXXXXXXXX'}\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][httplib_request #424] HttpSMSProvider >>0 001 OK\r\nMessage-ID...sage-ID: 787597333\r\n<<\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_check_success #213] [_check_success] entering with config {u'SMS_PHONENUMBER_KEY': u'destination', u'URL': u'https://enterprisemessaging.ee.co.uk/cgphttp/servlet/sendmsg', u'RETURN_SUCCESS': u'.*', u'HTTP_Method': u'GET', 'timeout': u'120', u'SMS_TEXT_KEY': u'text', u'PARAMETER': {u'username': u'XXXXXXXXXX', u'password': u'XXXXXXXXXX'}}\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_check_success #214] [_check_success] entering with reply 0 001 OK\r\nMessage-ID: 787597333\r\n\r\n2017/05/11 - 15:48:42 DEBUG {140507758040832} [smsprovider.HttpSMSProvider][_check_success #240] [_check_success] success: .*\r\n2017/05/11 - 15:48:42 WARNI {140507758040832} [smsprovider.HttpSMSProvider][_check_success #244] [_check_success] failed to send SMS. Reply does not match the RETURN_SUCCESS definition\r\n2017/05/11 - 15:48:42 ERROR {140507758040832} [smsprovider.HttpSMSProvider][httplib_request #428] HttpSMSProvider Exception('We received a none success reply from the SMS Gateway.',)\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/pymodules/python2.7/smsprovider/HttpSMSProvider.py\", line 425, in httplib_request\r\n    ret = self._check_success(reply)\r\n  File \"/usr/lib/pymodules/python2.7/smsprovider/HttpSMSProvider.py\", line 246, in _check_success\r\n    raise Exception(\"We received a none success reply from the \"\r\nException: We received a none success reply from the SMS Gateway.\r\n2017/05/11 - 15:48:42 WARNI {140507758040832} [smsprovider.HttpSMSProvider][_submitMessage #176] Failed again to access the HTTP SMS Service: Exception('Failed to send SMS. We received a none success reply from the SMS Gateway.',)\r\n2017/05/11 - 15:48:42 WARNI {140507758040832} [linotp.lib.tokens.smstoken][submitChallenge #478] [submitChallenge] The SMS could not be sent: Exception('Failed to send SMS. We received a none success reply from the SMS Gateway.',)\r\n2017/05/11 - 15:48:42 WARNI {140507758040832} [linotp.lib.tokens.smstoken][submitChallenge #478] [submitChallenge] The SMS could not be sent: Exception('Failed to send SMS. We received a none success reply from the SMS Gateway.',)\r\n\r\nIt looks like it tries and fails a couple of times then succeeds. But the match is still not succeeding so I get a failed to send."}}
{"actor":{"display_login":"jfarcher"}}