{"action":"created","comment":{"url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/comments/24389003","id":24389003,"diff_hunk":"@@ -1,6 +1,77 @@\n+/*jslint node: true */\n 'use strict';\n \n-module.exports = function(callback){\n-    console.log(\"\\\"snarflegluff\\\" should be printed below:\");\n-    var str = \"snarflegluff\";\n-    return str;}\n+/**\n+ * Receives initial input and begins the application.\n+ * @param {Object} client - Client received from app.js.\n+ * @callback end - Handles errors and ends the application.\n+ */\n+module.exports = function(client, end) {\n+  designateMixingBridge();\n+\n+  /**\n+   * Looks for an existing mixing bridge and creates one if none exist.\n+   */\n+  function designateMixingBridge() {\n+    client.bridges.list(function(err, bridges) {\n+      var bridge = bridges.filter(function(candidate) {\n+        return candidate.bridge_type === 'mixing';\n+      })[0];\n+      if (bridge) {\n+        console.log('Using existing mixing bridge %s', bridge.id);\n+      } else {\n+        bridge = client.bridges.create({type: 'mixing'}, function(err, bridge) {","path":"lib/sla.js","position":27,"original_position":27,"commit_id":"83c348e861b29fec777b972d3d4fa6002b1ea212","original_commit_id":"83c348e861b29fec777b972d3d4fa6002b1ea212","user":{"login":"samuelg","id":21962,"avatar_url":"https://avatars.githubusercontent.com/u/21962?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelg","html_url":"https://github.com/samuelg","followers_url":"https://api.github.com/users/samuelg/followers","following_url":"https://api.github.com/users/samuelg/following{/other_user}","gists_url":"https://api.github.com/users/samuelg/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelg/subscriptions","organizations_url":"https://api.github.com/users/samuelg/orgs","repos_url":"https://api.github.com/users/samuelg/repos","events_url":"https://api.github.com/users/samuelg/events{/privacy}","received_events_url":"https://api.github.com/users/samuelg/received_events","type":"User","site_admin":false},"body":"This is an asynchronous call, you can't assign the result of it to bridge. The bridge object that is passed into the callback is the object you are looking for.","created_at":"2015-02-10T04:51:21Z","updated_at":"2015-02-10T04:51:21Z","html_url":"https://github.com/wolfeman67/node-ari-shared-line-appearances/pull/4#discussion_r24389003","pull_request_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/comments/24389003"},"html":{"href":"https://github.com/wolfeman67/node-ari-shared-line-appearances/pull/4#discussion_r24389003"},"pull_request":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4","id":28845543,"html_url":"https://github.com/wolfeman67/node-ari-shared-line-appearances/pull/4","diff_url":"https://github.com/wolfeman67/node-ari-shared-line-appearances/pull/4.diff","patch_url":"https://github.com/wolfeman67/node-ari-shared-line-appearances/pull/4.patch","issue_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/issues/4","number":4,"state":"open","locked":false,"title":"Originated channel is now added to a bridge.","user":{"login":"TACambron","id":8323558,"avatar_url":"https://avatars.githubusercontent.com/u/8323558?v=3","gravatar_id":"","url":"https://api.github.com/users/TACambron","html_url":"https://github.com/TACambron","followers_url":"https://api.github.com/users/TACambron/followers","following_url":"https://api.github.com/users/TACambron/following{/other_user}","gists_url":"https://api.github.com/users/TACambron/gists{/gist_id}","starred_url":"https://api.github.com/users/TACambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TACambron/subscriptions","organizations_url":"https://api.github.com/users/TACambron/orgs","repos_url":"https://api.github.com/users/TACambron/repos","events_url":"https://api.github.com/users/TACambron/events{/privacy}","received_events_url":"https://api.github.com/users/TACambron/received_events","type":"User","site_admin":false},"body":"The program checks for an available bridge. If a bridge is available,\r\nthen that bridge is reused. If no bridges are active, a new bridge\r\nis created. Once the bridge is created, a channel is originated to\r\na designated endpoint, and upon answering the call, the channel is\r\nadded to the bridge.","created_at":"2015-02-06T21:57:17Z","updated_at":"2015-02-10T04:51:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2d78c9fcac70583dd05b6d0b1487b88bf4280b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4/commits","review_comments_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4/comments","review_comment_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/comments/{number}","comments_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/issues/4/comments","statuses_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/statuses/83c348e861b29fec777b972d3d4fa6002b1ea212","head":{"label":"TACambron:sla","ref":"sla","sha":"83c348e861b29fec777b972d3d4fa6002b1ea212","user":{"login":"TACambron","id":8323558,"avatar_url":"https://avatars.githubusercontent.com/u/8323558?v=3","gravatar_id":"","url":"https://api.github.com/users/TACambron","html_url":"https://github.com/TACambron","followers_url":"https://api.github.com/users/TACambron/followers","following_url":"https://api.github.com/users/TACambron/following{/other_user}","gists_url":"https://api.github.com/users/TACambron/gists{/gist_id}","starred_url":"https://api.github.com/users/TACambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TACambron/subscriptions","organizations_url":"https://api.github.com/users/TACambron/orgs","repos_url":"https://api.github.com/users/TACambron/repos","events_url":"https://api.github.com/users/TACambron/events{/privacy}","received_events_url":"https://api.github.com/users/TACambron/received_events","type":"User","site_admin":false},"repo":{"id":30247500,"name":"node-ari-shared-line-appearances","full_name":"TACambron/node-ari-shared-line-appearances","owner":{"login":"TACambron","id":8323558,"avatar_url":"https://avatars.githubusercontent.com/u/8323558?v=3","gravatar_id":"","url":"https://api.github.com/users/TACambron","html_url":"https://github.com/TACambron","followers_url":"https://api.github.com/users/TACambron/followers","following_url":"https://api.github.com/users/TACambron/following{/other_user}","gists_url":"https://api.github.com/users/TACambron/gists{/gist_id}","starred_url":"https://api.github.com/users/TACambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TACambron/subscriptions","organizations_url":"https://api.github.com/users/TACambron/orgs","repos_url":"https://api.github.com/users/TACambron/repos","events_url":"https://api.github.com/users/TACambron/events{/privacy}","received_events_url":"https://api.github.com/users/TACambron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TACambron/node-ari-shared-line-appearances","description":"Co-op implementation of SLA in ARI using Node.js","fork":true,"url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances","forks_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/forks","keys_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/teams","hooks_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/hooks","issue_events_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/issues/events{/number}","events_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/events","assignees_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/assignees{/user}","branches_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/branches{/branch}","tags_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/tags","blobs_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/git/refs{/sha}","trees_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/statuses/{sha}","languages_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/languages","stargazers_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/stargazers","contributors_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/contributors","subscribers_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/subscribers","subscription_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/subscription","commits_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/commits{/sha}","git_commits_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/git/commits{/sha}","comments_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/comments{/number}","issue_comment_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/issues/comments/{number}","contents_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/contents/{+path}","compare_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/merges","archive_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/downloads","issues_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/issues{/number}","pulls_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/pulls{/number}","milestones_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/milestones{/number}","notifications_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/labels{/name}","releases_url":"https://api.github.com/repos/TACambron/node-ari-shared-line-appearances/releases{/id}","created_at":"2015-02-03T14:47:06Z","updated_at":"2015-02-03T20:44:45Z","pushed_at":"2015-02-09T22:32:15Z","git_url":"git://github.com/TACambron/node-ari-shared-line-appearances.git","ssh_url":"git@github.com:TACambron/node-ari-shared-line-appearances.git","clone_url":"https://github.com/TACambron/node-ari-shared-line-appearances.git","svn_url":"https://github.com/TACambron/node-ari-shared-line-appearances","homepage":null,"size":132,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"wolfeman67:master","ref":"master","sha":"d1cf701e38fd495891359d46d7f21b5bcfa30d2e","user":{"login":"wolfeman67","id":10468003,"avatar_url":"https://avatars.githubusercontent.com/u/10468003?v=3","gravatar_id":"","url":"https://api.github.com/users/wolfeman67","html_url":"https://github.com/wolfeman67","followers_url":"https://api.github.com/users/wolfeman67/followers","following_url":"https://api.github.com/users/wolfeman67/following{/other_user}","gists_url":"https://api.github.com/users/wolfeman67/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfeman67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfeman67/subscriptions","organizations_url":"https://api.github.com/users/wolfeman67/orgs","repos_url":"https://api.github.com/users/wolfeman67/repos","events_url":"https://api.github.com/users/wolfeman67/events{/privacy}","received_events_url":"https://api.github.com/users/wolfeman67/received_events","type":"User","site_admin":false},"repo":{"id":30209409,"name":"node-ari-shared-line-appearances","full_name":"wolfeman67/node-ari-shared-line-appearances","owner":{"login":"wolfeman67","id":10468003,"avatar_url":"https://avatars.githubusercontent.com/u/10468003?v=3","gravatar_id":"","url":"https://api.github.com/users/wolfeman67","html_url":"https://github.com/wolfeman67","followers_url":"https://api.github.com/users/wolfeman67/followers","following_url":"https://api.github.com/users/wolfeman67/following{/other_user}","gists_url":"https://api.github.com/users/wolfeman67/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfeman67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfeman67/subscriptions","organizations_url":"https://api.github.com/users/wolfeman67/orgs","repos_url":"https://api.github.com/users/wolfeman67/repos","events_url":"https://api.github.com/users/wolfeman67/events{/privacy}","received_events_url":"https://api.github.com/users/wolfeman67/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wolfeman67/node-ari-shared-line-appearances","description":"Co-op implementation of SLA in ARI using Node.js","fork":false,"url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances","forks_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/forks","keys_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/teams","hooks_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/hooks","issue_events_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/issues/events{/number}","events_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/events","assignees_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/assignees{/user}","branches_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/branches{/branch}","tags_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/tags","blobs_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/statuses/{sha}","languages_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/languages","stargazers_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/stargazers","contributors_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/contributors","subscribers_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/subscribers","subscription_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/subscription","commits_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/issues/comments/{number}","contents_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/contents/{+path}","compare_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/merges","archive_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/downloads","issues_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/issues{/number}","pulls_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls{/number}","milestones_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/milestones{/number}","notifications_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/labels{/name}","releases_url":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/releases{/id}","created_at":"2015-02-02T21:23:52Z","updated_at":"2015-02-09T21:19:32Z","pushed_at":"2015-02-09T20:04:22Z","git_url":"git://github.com/wolfeman67/node-ari-shared-line-appearances.git","ssh_url":"git@github.com:wolfeman67/node-ari-shared-line-appearances.git","clone_url":"https://github.com/wolfeman67/node-ari-shared-line-appearances.git","svn_url":"https://github.com/wolfeman67/node-ari-shared-line-appearances","homepage":null,"size":248,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4"},"html":{"href":"https://github.com/wolfeman67/node-ari-shared-line-appearances/pull/4"},"issue":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/issues/4"},"comments":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/wolfeman67/node-ari-shared-line-appearances/statuses/83c348e861b29fec777b972d3d4fa6002b1ea212"}}}}