{"action":"created","comment":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/33878842","id":33878842,"diff_hunk":"@@ -193,14 +208,50 @@ order_group_members(Member, JObj) ->\n          ),\n     [V || {_, V} <- orddict:to_list(GroupMembers)].\n \n--spec create_group_member(ne_binary(), wh_json:object(), wh_json:object()) -> wh_json:object().\n-create_group_member(Key, Endpoint, Member) ->\n+-spec create_group_member(ne_binary(), wh_json:object(), integer(), wh_json:object()) -> wh_json:object().\n+create_group_member(Key, Endpoint, GroupWeight, Member) ->\n     DefaultDelay = wh_json:get_value(<<\"delay\">>, Member),\n     DefaultTimeout = wh_json:get_value(<<\"timeout\">>, Member),\n     wh_json:set_values([{<<\"endpoint_type\">>, wh_json:get_value(<<\"type\">>, Endpoint)}\n                         ,{<<\"id\">>, Key}\n                         ,{<<\"delay\">>, wh_json:get_value(<<\"delay\">>, Endpoint, DefaultDelay)}\n                         ,{<<\"timeout\">>, wh_json:get_value(<<\"timeout\">>, Endpoint, DefaultTimeout)}\n+                        ,{<<\"weight\">>, GroupWeight}\n                        ]\n                        ,Member\n                       ).\n+\n+-spec weighted_random_sort(wh_proplist()) -> wh_json:objects().\n+weighted_random_sort(Endpoints) ->\n+    random:seed(erlang:now()),","path":"applications/callflow/src/module/cf_ring_group.erl","position":165,"original_position":165,"commit_id":"92c7121d633665ecaae07b3d84ec6f20d6242ebd","original_commit_id":"92c7121d633665ecaae07b3d84ec6f20d6242ebd","user":{"login":"jamesaimonetti","id":160921,"avatar_url":"https://avatars.githubusercontent.com/u/160921?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesaimonetti","html_url":"https://github.com/jamesaimonetti","followers_url":"https://api.github.com/users/jamesaimonetti/followers","following_url":"https://api.github.com/users/jamesaimonetti/following{/other_user}","gists_url":"https://api.github.com/users/jamesaimonetti/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesaimonetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesaimonetti/subscriptions","organizations_url":"https://api.github.com/users/jamesaimonetti/orgs","repos_url":"https://api.github.com/users/jamesaimonetti/repos","events_url":"https://api.github.com/users/jamesaimonetti/events{/privacy}","received_events_url":"https://api.github.com/users/jamesaimonetti/received_events","type":"User","site_admin":false},"body":"Please use `os:timestamp()` instead; `erlang:now()` requires a global lock.","created_at":"2015-07-03T19:39:54Z","updated_at":"2015-07-03T19:39:54Z","html_url":"https://github.com/2600hz/kazoo/pull/1139#discussion_r33878842","pull_request_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1139","_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/33878842"},"html":{"href":"https://github.com/2600hz/kazoo/pull/1139#discussion_r33878842"},"pull_request":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1139"}}},"pull_request":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/1139","id":39153804,"html_url":"https://github.com/2600hz/kazoo/pull/1139","diff_url":"https://github.com/2600hz/kazoo/pull/1139.diff","patch_url":"https://github.com/2600hz/kazoo/pull/1139.patch","issue_url":"https://api.github.com/repos/2600hz/kazoo/issues/1139","number":1139,"state":"open","locked":false,"title":"KAZOO-3943: added \"weighted_random\" strategy to cf_ring_group","user":{"login":"siplabs","id":1489408,"avatar_url":"https://avatars.githubusercontent.com/u/1489408?v=3","gravatar_id":"","url":"https://api.github.com/users/siplabs","html_url":"https://github.com/siplabs","followers_url":"https://api.github.com/users/siplabs/followers","following_url":"https://api.github.com/users/siplabs/following{/other_user}","gists_url":"https://api.github.com/users/siplabs/gists{/gist_id}","starred_url":"https://api.github.com/users/siplabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siplabs/subscriptions","organizations_url":"https://api.github.com/users/siplabs/orgs","repos_url":"https://api.github.com/users/siplabs/repos","events_url":"https://api.github.com/users/siplabs/events{/privacy}","received_events_url":"https://api.github.com/users/siplabs/received_events","type":"User","site_admin":false},"body":"This strategy to order endpoints by weight.\r\n","created_at":"2015-07-03T08:03:56Z","updated_at":"2015-07-03T19:39:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9dbd311515f93069845e55c6e2740b10af9cfdf3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1139/commits","review_comments_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1139/comments","review_comment_url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/2600hz/kazoo/issues/1139/comments","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/92c7121d633665ecaae07b3d84ec6f20d6242ebd","head":{"label":"siplabs:KAZOO-3943","ref":"KAZOO-3943","sha":"92c7121d633665ecaae07b3d84ec6f20d6242ebd","user":{"login":"siplabs","id":1489408,"avatar_url":"https://avatars.githubusercontent.com/u/1489408?v=3","gravatar_id":"","url":"https://api.github.com/users/siplabs","html_url":"https://github.com/siplabs","followers_url":"https://api.github.com/users/siplabs/followers","following_url":"https://api.github.com/users/siplabs/following{/other_user}","gists_url":"https://api.github.com/users/siplabs/gists{/gist_id}","starred_url":"https://api.github.com/users/siplabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siplabs/subscriptions","organizations_url":"https://api.github.com/users/siplabs/orgs","repos_url":"https://api.github.com/users/siplabs/repos","events_url":"https://api.github.com/users/siplabs/events{/privacy}","received_events_url":"https://api.github.com/users/siplabs/received_events","type":"User","site_admin":false},"repo":{"id":18828051,"name":"kazoo","full_name":"siplabs/kazoo","owner":{"login":"siplabs","id":1489408,"avatar_url":"https://avatars.githubusercontent.com/u/1489408?v=3","gravatar_id":"","url":"https://api.github.com/users/siplabs","html_url":"https://github.com/siplabs","followers_url":"https://api.github.com/users/siplabs/followers","following_url":"https://api.github.com/users/siplabs/following{/other_user}","gists_url":"https://api.github.com/users/siplabs/gists{/gist_id}","starred_url":"https://api.github.com/users/siplabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siplabs/subscriptions","organizations_url":"https://api.github.com/users/siplabs/orgs","repos_url":"https://api.github.com/users/siplabs/repos","events_url":"https://api.github.com/users/siplabs/events{/privacy}","received_events_url":"https://api.github.com/users/siplabs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/siplabs/kazoo","description":"","fork":true,"url":"https://api.github.com/repos/siplabs/kazoo","forks_url":"https://api.github.com/repos/siplabs/kazoo/forks","keys_url":"https://api.github.com/repos/siplabs/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/siplabs/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/siplabs/kazoo/teams","hooks_url":"https://api.github.com/repos/siplabs/kazoo/hooks","issue_events_url":"https://api.github.com/repos/siplabs/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/siplabs/kazoo/events","assignees_url":"https://api.github.com/repos/siplabs/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/siplabs/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/siplabs/kazoo/tags","blobs_url":"https://api.github.com/repos/siplabs/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/siplabs/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/siplabs/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/siplabs/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/siplabs/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/siplabs/kazoo/languages","stargazers_url":"https://api.github.com/repos/siplabs/kazoo/stargazers","contributors_url":"https://api.github.com/repos/siplabs/kazoo/contributors","subscribers_url":"https://api.github.com/repos/siplabs/kazoo/subscribers","subscription_url":"https://api.github.com/repos/siplabs/kazoo/subscription","commits_url":"https://api.github.com/repos/siplabs/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/siplabs/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/siplabs/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/siplabs/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/siplabs/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/siplabs/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/siplabs/kazoo/merges","archive_url":"https://api.github.com/repos/siplabs/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/siplabs/kazoo/downloads","issues_url":"https://api.github.com/repos/siplabs/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/siplabs/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/siplabs/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/siplabs/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/siplabs/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/siplabs/kazoo/releases{/id}","created_at":"2014-04-16T05:33:28Z","updated_at":"2015-03-03T12:07:43Z","pushed_at":"2015-07-03T08:19:50Z","git_url":"git://github.com/siplabs/kazoo.git","ssh_url":"git@github.com:siplabs/kazoo.git","clone_url":"https://github.com/siplabs/kazoo.git","svn_url":"https://github.com/siplabs/kazoo","homepage":"","size":320481,"stargazers_count":0,"watchers_count":0,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"2600hz:master","ref":"master","sha":"cc605757548d8cf5c562536bb070a77460052a14","user":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"repo":{"id":2966241,"name":"kazoo","full_name":"2600hz/kazoo","owner":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2600hz/kazoo","description":"","fork":false,"url":"https://api.github.com/repos/2600hz/kazoo","forks_url":"https://api.github.com/repos/2600hz/kazoo/forks","keys_url":"https://api.github.com/repos/2600hz/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2600hz/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2600hz/kazoo/teams","hooks_url":"https://api.github.com/repos/2600hz/kazoo/hooks","issue_events_url":"https://api.github.com/repos/2600hz/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/2600hz/kazoo/events","assignees_url":"https://api.github.com/repos/2600hz/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/2600hz/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/2600hz/kazoo/tags","blobs_url":"https://api.github.com/repos/2600hz/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2600hz/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2600hz/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/2600hz/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/2600hz/kazoo/languages","stargazers_url":"https://api.github.com/repos/2600hz/kazoo/stargazers","contributors_url":"https://api.github.com/repos/2600hz/kazoo/contributors","subscribers_url":"https://api.github.com/repos/2600hz/kazoo/subscribers","subscription_url":"https://api.github.com/repos/2600hz/kazoo/subscription","commits_url":"https://api.github.com/repos/2600hz/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/2600hz/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/2600hz/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/2600hz/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/2600hz/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/2600hz/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2600hz/kazoo/merges","archive_url":"https://api.github.com/repos/2600hz/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2600hz/kazoo/downloads","issues_url":"https://api.github.com/repos/2600hz/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/2600hz/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/2600hz/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/2600hz/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2600hz/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/2600hz/kazoo/releases{/id}","created_at":"2011-12-12T18:08:02Z","updated_at":"2015-06-30T19:01:54Z","pushed_at":"2015-07-03T19:31:45Z","git_url":"git://github.com/2600hz/kazoo.git","ssh_url":"git@github.com:2600hz/kazoo.git","clone_url":"https://github.com/2600hz/kazoo.git","svn_url":"https://github.com/2600hz/kazoo","homepage":"","size":551189,"stargazers_count":267,"watchers_count":267,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":138,"mirror_url":null,"open_issues_count":19,"forks":138,"open_issues":19,"watchers":267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1139"},"html":{"href":"https://github.com/2600hz/kazoo/pull/1139"},"issue":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/1139"},"comments":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/1139/comments"},"review_comments":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1139/comments"},"review_comment":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1139/commits"},"statuses":{"href":"https://api.github.com/repos/2600hz/kazoo/statuses/92c7121d633665ecaae07b3d84ec6f20d6242ebd"}}}}