{"action":"created","issue":{"url":"https://api.github.com/repos/agsh/onvif/issues/63","repository_url":"https://api.github.com/repos/agsh/onvif","labels_url":"https://api.github.com/repos/agsh/onvif/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/agsh/onvif/issues/63/comments","events_url":"https://api.github.com/repos/agsh/onvif/issues/63/events","html_url":"https://github.com/agsh/onvif/issues/63","id":182230469,"number":63,"title":"Bug in parsing XAddrs in Discovery","user":{"login":"RogerHardiman","id":10171169,"avatar_url":"https://avatars.githubusercontent.com/u/10171169?v=3","gravatar_id":"","url":"https://api.github.com/users/RogerHardiman","html_url":"https://github.com/RogerHardiman","followers_url":"https://api.github.com/users/RogerHardiman/followers","following_url":"https://api.github.com/users/RogerHardiman/following{/other_user}","gists_url":"https://api.github.com/users/RogerHardiman/gists{/gist_id}","starred_url":"https://api.github.com/users/RogerHardiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RogerHardiman/subscriptions","organizations_url":"https://api.github.com/users/RogerHardiman/orgs","repos_url":"https://api.github.com/users/RogerHardiman/repos","events_url":"https://api.github.com/users/RogerHardiman/events{/privacy}","received_events_url":"https://api.github.com/users/RogerHardiman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-11T10:36:13Z","updated_at":"2016-10-11T10:56:36Z","closed_at":null,"body":"I have some ONVIF devices which respond to a WS-Discovery but in the discovery XML reply there are TWO different XAddrs with a space between them.\r\nThe parsing code in discovery.js cannot handle this\r\n\r\nAxis Encoder return this...\r\n`<d:XAddrs>http://169.254.119.177/onvif/services http://192.168.1.125/onvif/services</d:XAddrs>\r\n`\r\nAxis Q1615 returns this...\r\n`<d:XAddrs>http://192.168.1.102/onvif/device_service http://169.254.125.197/onvif/device_service</d:XAddrs>`\r\n\r\nBosch Encoder returns this...\r\n`<d:XAddrs>http://192.168.1.124:80/onvif/device_service https://192.168.1.124:443/onvif/device_service</d:XAddrs>`\r\n\r\nOne device (360 Vision Pred) only has one entry in the XAddr and so parses fine\r\n\r\n\r\nThe problem looks like this line in discovery.js\r\n```\r\n                                                var camUri = url.parse(data.probeMatches.probeMatch.XAddrs);\r\n                                                cam = new Cam({\r\n                                                        hostname: camUri.hostname\r\n                                                        , port: camUri.port\r\n                                                        , path: camUri.path\r\n                                                });\r\n\r\n```\r\nfollowed by\r\n`                                        Discovery.emit('device', cam, rinfo, xml);\r\n`\r\n\r\n\r\nIt needs to detect if there are multiple XAddrs (some form of Split on Whitespace) and either loop through them, with multiple Emits() or turn the cam parameter into an array.\r\n"},"comment":{"url":"https://api.github.com/repos/agsh/onvif/issues/comments/252881503","html_url":"https://github.com/agsh/onvif/issues/63#issuecomment-252881503","issue_url":"https://api.github.com/repos/agsh/onvif/issues/63","id":252881503,"user":{"login":"Climax777","id":768925,"avatar_url":"https://avatars.githubusercontent.com/u/768925?v=3","gravatar_id":"","url":"https://api.github.com/users/Climax777","html_url":"https://github.com/Climax777","followers_url":"https://api.github.com/users/Climax777/followers","following_url":"https://api.github.com/users/Climax777/following{/other_user}","gists_url":"https://api.github.com/users/Climax777/gists{/gist_id}","starred_url":"https://api.github.com/users/Climax777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Climax777/subscriptions","organizations_url":"https://api.github.com/users/Climax777/orgs","repos_url":"https://api.github.com/users/Climax777/repos","events_url":"https://api.github.com/users/Climax777/events{/privacy}","received_events_url":"https://api.github.com/users/Climax777/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T10:56:35Z","updated_at":"2016-10-11T10:56:35Z","body":"@RogerHardiman I think the best could be to select the first one after the split and then bundle all of them in a new field, for example: `additionalXAddrs`"}}
{"actor":{"display_login":"Climax777"}}