{"action":"created","comment":{"url":"https://api.github.com/repos/rilmodem/ofono/pulls/comments/95624445","pull_request_review_id":16186059,"id":95624445,"diff_hunk":"@@ -372,19 +377,33 @@ static void rild_cb(struct ril_msg *message, gpointer user_data)\n \n \tg_ril_print_response_no_args(vd->ril, message);\n \n-\t/* CLCC will update the oFono call list with proper ids  */\n-\tif (!vd->clcc_source)\n+\t/*\n+\t * CLCC will update the oFono call list with proper ids. However, if\n+\t * the callback isn't there, it's likely that an\n+\t * UNSOL_RESPONSE_CALL_STATE_CHANGED has been issued and the CLCC\n+\t * has been called already. So, there's no need to trigger another CLCC.\n+\t */\n+\tif (!vd->clcc_source && vd->cb)\n \t\tvd->clcc_source = g_timeout_add(POLL_CLCC_INTERVAL,\n \t\t\t\t\t\tril_poll_clcc, vc);\n-\n-\t/* we cannot answer just yet since we don't know the call id */\n-\tvd->cb = cb;\n-\tvd->data = cbd->data;\n-\n \treturn;\n \n out:\n-\tcb(&error, cbd->data);\n+\t/*\n+\t * If the callback isn't there, it's likely that the callback has been\n+\t * called with success already in CLCC's response, so, we can't signal\n+\t * the error to the caller. However, it's unlikely to have the new call\n+\t * in the call list but the dial itself fails.\n+\t */\n+\tif (!vd->cb) {\n+\t\tofono_error(\"%s: DIAL request fails after the call appeared \"\n+\t\t\t\t\"in the call list.\", __func__);\n+\t}\n+\telse {","path":"drivers/rilmodem/voicecall.c","position":48,"original_position":48,"commit_id":"6c1d3789b605b703689d61d0681b3e9e97f2da7b","original_commit_id":"6c1d3789b605b703689d61d0681b3e9e97f2da7b","user":{"login":"alfonsosanchezbeato","id":3833021,"avatar_url":"https://avatars.githubusercontent.com/u/3833021?v=3","gravatar_id":"","url":"https://api.github.com/users/alfonsosanchezbeato","html_url":"https://github.com/alfonsosanchezbeato","followers_url":"https://api.github.com/users/alfonsosanchezbeato/followers","following_url":"https://api.github.com/users/alfonsosanchezbeato/following{/other_user}","gists_url":"https://api.github.com/users/alfonsosanchezbeato/gists{/gist_id}","starred_url":"https://api.github.com/users/alfonsosanchezbeato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfonsosanchezbeato/subscriptions","organizations_url":"https://api.github.com/users/alfonsosanchezbeato/orgs","repos_url":"https://api.github.com/users/alfonsosanchezbeato/repos","events_url":"https://api.github.com/users/alfonsosanchezbeato/events{/privacy}","received_events_url":"https://api.github.com/users/alfonsosanchezbeato/received_events","type":"User","site_admin":false},"body":"\"} else {\" instead","created_at":"2017-01-11T17:07:18Z","updated_at":"2017-01-11T17:09:01Z","html_url":"https://github.com/rilmodem/ofono/pull/259#discussion_r95624445","pull_request_url":"https://api.github.com/repos/rilmodem/ofono/pulls/259","_links":{"self":{"href":"https://api.github.com/repos/rilmodem/ofono/pulls/comments/95624445"},"html":{"href":"https://github.com/rilmodem/ofono/pull/259#discussion_r95624445"},"pull_request":{"href":"https://api.github.com/repos/rilmodem/ofono/pulls/259"}}},"pull_request":{"url":"https://api.github.com/repos/rilmodem/ofono/pulls/259","id":99922380,"html_url":"https://github.com/rilmodem/ofono/pull/259","diff_url":"https://github.com/rilmodem/ofono/pull/259.diff","patch_url":"https://github.com/rilmodem/ofono/pull/259.patch","issue_url":"https://api.github.com/repos/rilmodem/ofono/issues/259","number":259,"state":"open","locked":false,"title":"rilmodem: fix race condition in voice call dialling","user":{"login":"peat-psuwit","id":6771175,"avatar_url":"https://avatars.githubusercontent.com/u/6771175?v=3","gravatar_id":"","url":"https://api.github.com/users/peat-psuwit","html_url":"https://github.com/peat-psuwit","followers_url":"https://api.github.com/users/peat-psuwit/followers","following_url":"https://api.github.com/users/peat-psuwit/following{/other_user}","gists_url":"https://api.github.com/users/peat-psuwit/gists{/gist_id}","starred_url":"https://api.github.com/users/peat-psuwit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peat-psuwit/subscriptions","organizations_url":"https://api.github.com/users/peat-psuwit/orgs","repos_url":"https://api.github.com/users/peat-psuwit/repos","events_url":"https://api.github.com/users/peat-psuwit/events{/privacy}","received_events_url":"https://api.github.com/users/peat-psuwit/received_events","type":"User","site_admin":false},"body":"Previously, the oFono's dial callback will be kept in vd\r\n(ril_voicecall_data) when the RIL's DIAL request is responded, which\r\nwill be called later when GET_CURRENT_CALL's callback find out what is\r\nthe new call's id.\r\n\r\nThe problem is that a UNSOL_RESPONSE_CALL_STATE_CHANGED might be\r\nissued before the DIAL request is responded, resulting in a\r\nGET_CURRENT_CALL request being sent before the callback being put in\r\nvd. When we get the result, the callback will notice the new call but\r\nwill not notice about the pending dial request from oFono, and the\r\nfollowing GET_CURRENT_CALL request will not notice the new call anymore.\r\nNow, the pending oFono's dial callback will never be called, and the\r\nDBus call will timeout.\r\n\r\nThis commit make our dial function keeps the oFono's dial callback\r\nright after the RIL's DIAL request is sent successfully. This way,\r\nwe can ensure that whenever the new call is placed (before or after\r\nDIAL request is responded), the pending oFono's callback will be\r\ncalled.\r\n\r\nThis fix outgoing voice call on the Fairphone 2.","created_at":"2017-01-03T08:32:36Z","updated_at":"2017-01-11T17:09:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1819a3a5be10d0e4bc768df3426f166755c7f811","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rilmodem/ofono/pulls/259/commits","review_comments_url":"https://api.github.com/repos/rilmodem/ofono/pulls/259/comments","review_comment_url":"https://api.github.com/repos/rilmodem/ofono/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rilmodem/ofono/issues/259/comments","statuses_url":"https://api.github.com/repos/rilmodem/ofono/statuses/6c1d3789b605b703689d61d0681b3e9e97f2da7b","head":{"label":"peat-psuwit:FP2-voicecall-race-condition","ref":"FP2-voicecall-race-condition","sha":"6c1d3789b605b703689d61d0681b3e9e97f2da7b","user":{"login":"peat-psuwit","id":6771175,"avatar_url":"https://avatars.githubusercontent.com/u/6771175?v=3","gravatar_id":"","url":"https://api.github.com/users/peat-psuwit","html_url":"https://github.com/peat-psuwit","followers_url":"https://api.github.com/users/peat-psuwit/followers","following_url":"https://api.github.com/users/peat-psuwit/following{/other_user}","gists_url":"https://api.github.com/users/peat-psuwit/gists{/gist_id}","starred_url":"https://api.github.com/users/peat-psuwit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peat-psuwit/subscriptions","organizations_url":"https://api.github.com/users/peat-psuwit/orgs","repos_url":"https://api.github.com/users/peat-psuwit/repos","events_url":"https://api.github.com/users/peat-psuwit/events{/privacy}","received_events_url":"https://api.github.com/users/peat-psuwit/received_events","type":"User","site_admin":false},"repo":{"id":33370208,"name":"ofono","full_name":"peat-psuwit/ofono","owner":{"login":"peat-psuwit","id":6771175,"avatar_url":"https://avatars.githubusercontent.com/u/6771175?v=3","gravatar_id":"","url":"https://api.github.com/users/peat-psuwit","html_url":"https://github.com/peat-psuwit","followers_url":"https://api.github.com/users/peat-psuwit/followers","following_url":"https://api.github.com/users/peat-psuwit/following{/other_user}","gists_url":"https://api.github.com/users/peat-psuwit/gists{/gist_id}","starred_url":"https://api.github.com/users/peat-psuwit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peat-psuwit/subscriptions","organizations_url":"https://api.github.com/users/peat-psuwit/orgs","repos_url":"https://api.github.com/users/peat-psuwit/repos","events_url":"https://api.github.com/users/peat-psuwit/events{/privacy}","received_events_url":"https://api.github.com/users/peat-psuwit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/peat-psuwit/ofono","description":"7f3955122af8b0349fb7d3f2db8abd754459d146","fork":true,"url":"https://api.github.com/repos/peat-psuwit/ofono","forks_url":"https://api.github.com/repos/peat-psuwit/ofono/forks","keys_url":"https://api.github.com/repos/peat-psuwit/ofono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/peat-psuwit/ofono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/peat-psuwit/ofono/teams","hooks_url":"https://api.github.com/repos/peat-psuwit/ofono/hooks","issue_events_url":"https://api.github.com/repos/peat-psuwit/ofono/issues/events{/number}","events_url":"https://api.github.com/repos/peat-psuwit/ofono/events","assignees_url":"https://api.github.com/repos/peat-psuwit/ofono/assignees{/user}","branches_url":"https://api.github.com/repos/peat-psuwit/ofono/branches{/branch}","tags_url":"https://api.github.com/repos/peat-psuwit/ofono/tags","blobs_url":"https://api.github.com/repos/peat-psuwit/ofono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/peat-psuwit/ofono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/peat-psuwit/ofono/git/refs{/sha}","trees_url":"https://api.github.com/repos/peat-psuwit/ofono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/peat-psuwit/ofono/statuses/{sha}","languages_url":"https://api.github.com/repos/peat-psuwit/ofono/languages","stargazers_url":"https://api.github.com/repos/peat-psuwit/ofono/stargazers","contributors_url":"https://api.github.com/repos/peat-psuwit/ofono/contributors","subscribers_url":"https://api.github.com/repos/peat-psuwit/ofono/subscribers","subscription_url":"https://api.github.com/repos/peat-psuwit/ofono/subscription","commits_url":"https://api.github.com/repos/peat-psuwit/ofono/commits{/sha}","git_commits_url":"https://api.github.com/repos/peat-psuwit/ofono/git/commits{/sha}","comments_url":"https://api.github.com/repos/peat-psuwit/ofono/comments{/number}","issue_comment_url":"https://api.github.com/repos/peat-psuwit/ofono/issues/comments{/number}","contents_url":"https://api.github.com/repos/peat-psuwit/ofono/contents/{+path}","compare_url":"https://api.github.com/repos/peat-psuwit/ofono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/peat-psuwit/ofono/merges","archive_url":"https://api.github.com/repos/peat-psuwit/ofono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/peat-psuwit/ofono/downloads","issues_url":"https://api.github.com/repos/peat-psuwit/ofono/issues{/number}","pulls_url":"https://api.github.com/repos/peat-psuwit/ofono/pulls{/number}","milestones_url":"https://api.github.com/repos/peat-psuwit/ofono/milestones{/number}","notifications_url":"https://api.github.com/repos/peat-psuwit/ofono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/peat-psuwit/ofono/labels{/name}","releases_url":"https://api.github.com/repos/peat-psuwit/ofono/releases{/id}","deployments_url":"https://api.github.com/repos/peat-psuwit/ofono/deployments","created_at":"2015-04-03T15:49:11Z","updated_at":"2016-02-21T04:49:58Z","pushed_at":"2017-01-11T16:25:20Z","git_url":"git://github.com/peat-psuwit/ofono.git","ssh_url":"git@github.com:peat-psuwit/ofono.git","clone_url":"https://github.com/peat-psuwit/ofono.git","svn_url":"https://github.com/peat-psuwit/ofono","homepage":"","size":21274,"stargazers_count":0,"watchers_count":0,"language":"C","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":"rilmodem:master","ref":"master","sha":"a188d35e305d30390923c8598d22e9dedd264055","user":{"login":"rilmodem","id":5394617,"avatar_url":"https://avatars.githubusercontent.com/u/5394617?v=3","gravatar_id":"","url":"https://api.github.com/users/rilmodem","html_url":"https://github.com/rilmodem","followers_url":"https://api.github.com/users/rilmodem/followers","following_url":"https://api.github.com/users/rilmodem/following{/other_user}","gists_url":"https://api.github.com/users/rilmodem/gists{/gist_id}","starred_url":"https://api.github.com/users/rilmodem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rilmodem/subscriptions","organizations_url":"https://api.github.com/users/rilmodem/orgs","repos_url":"https://api.github.com/users/rilmodem/repos","events_url":"https://api.github.com/users/rilmodem/events{/privacy}","received_events_url":"https://api.github.com/users/rilmodem/received_events","type":"Organization","site_admin":false},"repo":{"id":12710932,"name":"ofono","full_name":"rilmodem/ofono","owner":{"login":"rilmodem","id":5394617,"avatar_url":"https://avatars.githubusercontent.com/u/5394617?v=3","gravatar_id":"","url":"https://api.github.com/users/rilmodem","html_url":"https://github.com/rilmodem","followers_url":"https://api.github.com/users/rilmodem/followers","following_url":"https://api.github.com/users/rilmodem/following{/other_user}","gists_url":"https://api.github.com/users/rilmodem/gists{/gist_id}","starred_url":"https://api.github.com/users/rilmodem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rilmodem/subscriptions","organizations_url":"https://api.github.com/users/rilmodem/orgs","repos_url":"https://api.github.com/users/rilmodem/repos","events_url":"https://api.github.com/users/rilmodem/events{/privacy}","received_events_url":"https://api.github.com/users/rilmodem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rilmodem/ofono","description":"7f3955122af8b0349fb7d3f2db8abd754459d146","fork":false,"url":"https://api.github.com/repos/rilmodem/ofono","forks_url":"https://api.github.com/repos/rilmodem/ofono/forks","keys_url":"https://api.github.com/repos/rilmodem/ofono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rilmodem/ofono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rilmodem/ofono/teams","hooks_url":"https://api.github.com/repos/rilmodem/ofono/hooks","issue_events_url":"https://api.github.com/repos/rilmodem/ofono/issues/events{/number}","events_url":"https://api.github.com/repos/rilmodem/ofono/events","assignees_url":"https://api.github.com/repos/rilmodem/ofono/assignees{/user}","branches_url":"https://api.github.com/repos/rilmodem/ofono/branches{/branch}","tags_url":"https://api.github.com/repos/rilmodem/ofono/tags","blobs_url":"https://api.github.com/repos/rilmodem/ofono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rilmodem/ofono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rilmodem/ofono/git/refs{/sha}","trees_url":"https://api.github.com/repos/rilmodem/ofono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rilmodem/ofono/statuses/{sha}","languages_url":"https://api.github.com/repos/rilmodem/ofono/languages","stargazers_url":"https://api.github.com/repos/rilmodem/ofono/stargazers","contributors_url":"https://api.github.com/repos/rilmodem/ofono/contributors","subscribers_url":"https://api.github.com/repos/rilmodem/ofono/subscribers","subscription_url":"https://api.github.com/repos/rilmodem/ofono/subscription","commits_url":"https://api.github.com/repos/rilmodem/ofono/commits{/sha}","git_commits_url":"https://api.github.com/repos/rilmodem/ofono/git/commits{/sha}","comments_url":"https://api.github.com/repos/rilmodem/ofono/comments{/number}","issue_comment_url":"https://api.github.com/repos/rilmodem/ofono/issues/comments{/number}","contents_url":"https://api.github.com/repos/rilmodem/ofono/contents/{+path}","compare_url":"https://api.github.com/repos/rilmodem/ofono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rilmodem/ofono/merges","archive_url":"https://api.github.com/repos/rilmodem/ofono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rilmodem/ofono/downloads","issues_url":"https://api.github.com/repos/rilmodem/ofono/issues{/number}","pulls_url":"https://api.github.com/repos/rilmodem/ofono/pulls{/number}","milestones_url":"https://api.github.com/repos/rilmodem/ofono/milestones{/number}","notifications_url":"https://api.github.com/repos/rilmodem/ofono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rilmodem/ofono/labels{/name}","releases_url":"https://api.github.com/repos/rilmodem/ofono/releases{/id}","deployments_url":"https://api.github.com/repos/rilmodem/ofono/deployments","created_at":"2013-09-09T19:45:47Z","updated_at":"2016-11-07T21:55:55Z","pushed_at":"2017-01-11T16:25:21Z","git_url":"git://github.com/rilmodem/ofono.git","ssh_url":"git@github.com:rilmodem/ofono.git","clone_url":"https://github.com/rilmodem/ofono.git","svn_url":"https://github.com/rilmodem/ofono","homepage":"","size":21208,"stargazers_count":8,"watchers_count":8,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":18,"forks":18,"open_issues":18,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rilmodem/ofono/pulls/259"},"html":{"href":"https://github.com/rilmodem/ofono/pull/259"},"issue":{"href":"https://api.github.com/repos/rilmodem/ofono/issues/259"},"comments":{"href":"https://api.github.com/repos/rilmodem/ofono/issues/259/comments"},"review_comments":{"href":"https://api.github.com/repos/rilmodem/ofono/pulls/259/comments"},"review_comment":{"href":"https://api.github.com/repos/rilmodem/ofono/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rilmodem/ofono/pulls/259/commits"},"statuses":{"href":"https://api.github.com/repos/rilmodem/ofono/statuses/6c1d3789b605b703689d61d0681b3e9e97f2da7b"}}}}
{"actor":{"display_login":"alfonsosanchezbeato"}}