{"action":"created","issue":{"url":"https://api.github.com/repos/sipcapture/homer/issues/201","repository_url":"https://api.github.com/repos/sipcapture/homer","labels_url":"https://api.github.com/repos/sipcapture/homer/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/sipcapture/homer/issues/201/comments","events_url":"https://api.github.com/repos/sipcapture/homer/issues/201/events","html_url":"https://github.com/sipcapture/homer/issues/201","id":193787566,"number":201,"title":"Using JSON for deeplink into homer","user":{"login":"davidtek","id":8028202,"avatar_url":"https://avatars.githubusercontent.com/u/8028202?v=3","gravatar_id":"","url":"https://api.github.com/users/davidtek","html_url":"https://github.com/davidtek","followers_url":"https://api.github.com/users/davidtek/followers","following_url":"https://api.github.com/users/davidtek/following{/other_user}","gists_url":"https://api.github.com/users/davidtek/gists{/gist_id}","starred_url":"https://api.github.com/users/davidtek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidtek/subscriptions","organizations_url":"https://api.github.com/users/davidtek/orgs","repos_url":"https://api.github.com/users/davidtek/repos","events_url":"https://api.github.com/users/davidtek/events{/privacy}","received_events_url":"https://api.github.com/users/davidtek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-06T14:35:27Z","updated_at":"2016-12-06T16:37:02Z","closed_at":null,"body":"Relating to this message : https://github.com/sipcapture/homer/issues/141\r\n\r\nThere are multiple issues.\r\n\r\n1. For we can't pass unix time stamps because the code only handles strings. Which means we always have to pass formatted dates.\r\n2. The split is incorrect, and it is causing a quote to be included in the last string that is passed in the object\r\n3. The examples at the given link are incorrect and DO NOT WORK (end instead of enddate, start instead of startdate )\r\n4. Example left out / between # and r\r\n\r\nThe code uses primitive split to decode a complex string. Instead I propose we use JSON.\r\n\r\n\r\nThe attached patch modifies the behaviour of the function so that it accepts a JSON string ( which is properly decoded and supports integers ).\r\n\r\n\r\nSo using the old code you would use : \r\n\r\n#/result?query=(trancall:'true',startdate:\"2016-12-05 12:00:00\",enddate:\"2016-12-05 13:00,search_callid:'7216880062184e3c745256a5335101da@192.168.2.2:5060)\r\n\r\nAfter my patch, it would be like this ( purposely left out last quote because of bad parsing :\r\n\r\n#/result?query=(trancall:'true',startdate:'2016-12-05 12:00:00',enddate:'2016-12-05 13:00',search_callid:'7216880062184e3c745256a5335101da@192.168.2.2:5060)\r\n\r\n#/result?query={\"trancall\":1,\"startdate\":\"2016-12-05 12:00:00\",\"enddate\":\"2016-12-05 13:00\",\"search_callid\":\"7216880062184e3c745256a5335101da@192.168.2.2:5060\"}\r\n\r\nor properly encoded : \r\n#/result?query=%7B%22trancall%22%3A1%2C%22startdate%22%3A%222016-12-05+12%3A00%3A00%22%2C%22enddate%22%3A%222016-12-05+13%3A00%22%2C%22search_callid%22%3A%227216880062184e3c745256a5335101da%40192.168.2.2%3A5060%22%7D\r\n\r\n\r\n\r\nWhy is this better ?\r\n\r\n1. It uses standard and well known json\r\n2. It allows the user to pass timestamps in milliseconds as an integer OR a fully formatted time\r\n3. It fixes problems with the parser\r\n4. JSON is cool.\r\n\r\nThe original code is great because it allows linking directly to searching, I have simply reworked it to make it slightly better.\r\n\r\n\r\nI WROTE THIS PATCH AND GIVE PERMISSION TO THE SIPCAPTURE PROJECT TO INCLUDE IT IN THEIR PROJECT AND APPLY THE SAME LICENSE TO THE CODE AS THE SIPCAPTURE PROJECT USES.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sipcapture/homer/issues/comments/265199524","html_url":"https://github.com/sipcapture/homer/issues/201#issuecomment-265199524","issue_url":"https://api.github.com/repos/sipcapture/homer/issues/201","id":265199524,"user":{"login":"adubovikov","id":4513061,"avatar_url":"https://avatars.githubusercontent.com/u/4513061?v=3","gravatar_id":"","url":"https://api.github.com/users/adubovikov","html_url":"https://github.com/adubovikov","followers_url":"https://api.github.com/users/adubovikov/followers","following_url":"https://api.github.com/users/adubovikov/following{/other_user}","gists_url":"https://api.github.com/users/adubovikov/gists{/gist_id}","starred_url":"https://api.github.com/users/adubovikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adubovikov/subscriptions","organizations_url":"https://api.github.com/users/adubovikov/orgs","repos_url":"https://api.github.com/users/adubovikov/repos","events_url":"https://api.github.com/users/adubovikov/events{/privacy}","received_events_url":"https://api.github.com/users/adubovikov/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T16:37:02Z","updated_at":"2016-12-06T16:37:02Z","body":"Please make a pull request\nThank you.\n\nOn Dec 6, 2016 17:10, \"davidtek\" <notifications@github.com> wrote:\n\n> https://github.com/davidtek/homer-ui\n>\n> davidtek/homer-ui@7abe716\n> <https://github.com/davidtek/homer-ui/commit/7abe716d9ee98fc08d78a4658a946b26d57b8904>\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/sipcapture/homer/issues/201#issuecomment-265191575>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AETdJYSZKKP-rTkkijdnNnCLmezhVr-Eks5rFYj8gaJpZM4LFeVG>\n> .\n>\n"}}
{"actor":{"display_login":"adubovikov"}}