{"action":"created","issue":{"url":"https://api.github.com/repos/versatica/JsSIP/issues/509","repository_url":"https://api.github.com/repos/versatica/JsSIP","labels_url":"https://api.github.com/repos/versatica/JsSIP/issues/509/labels{/name}","comments_url":"https://api.github.com/repos/versatica/JsSIP/issues/509/comments","events_url":"https://api.github.com/repos/versatica/JsSIP/issues/509/events","html_url":"https://github.com/versatica/JsSIP/issues/509","id":307964641,"number":509,"title":"Can not make a call if a stream is given at first.","user":{"login":"zeng450026937","id":21963532,"avatar_url":"https://avatars1.githubusercontent.com/u/21963532?v=4","gravatar_id":"","url":"https://api.github.com/users/zeng450026937","html_url":"https://github.com/zeng450026937","followers_url":"https://api.github.com/users/zeng450026937/followers","following_url":"https://api.github.com/users/zeng450026937/following{/other_user}","gists_url":"https://api.github.com/users/zeng450026937/gists{/gist_id}","starred_url":"https://api.github.com/users/zeng450026937/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeng450026937/subscriptions","organizations_url":"https://api.github.com/users/zeng450026937/orgs","repos_url":"https://api.github.com/users/zeng450026937/repos","events_url":"https://api.github.com/users/zeng450026937/events{/privacy}","received_events_url":"https://api.github.com/users/zeng450026937/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-23T09:57:08Z","updated_at":"2018-03-23T14:59:04Z","closed_at":null,"author_association":"NONE","body":"If A stream is given, the promise queue can't be resolve correctly in _sendInitialRequest()\r\n"},"comment":{"url":"https://api.github.com/repos/versatica/JsSIP/issues/comments/375692833","html_url":"https://github.com/versatica/JsSIP/issues/509#issuecomment-375692833","issue_url":"https://api.github.com/repos/versatica/JsSIP/issues/509","id":375692833,"user":{"login":"zeng450026937","id":21963532,"avatar_url":"https://avatars1.githubusercontent.com/u/21963532?v=4","gravatar_id":"","url":"https://api.github.com/users/zeng450026937","html_url":"https://github.com/zeng450026937","followers_url":"https://api.github.com/users/zeng450026937/followers","following_url":"https://api.github.com/users/zeng450026937/following{/other_user}","gists_url":"https://api.github.com/users/zeng450026937/gists{/gist_id}","starred_url":"https://api.github.com/users/zeng450026937/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeng450026937/subscriptions","organizations_url":"https://api.github.com/users/zeng450026937/orgs","repos_url":"https://api.github.com/users/zeng450026937/repos","events_url":"https://api.github.com/users/zeng450026937/events{/privacy}","received_events_url":"https://api.github.com/users/zeng450026937/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T14:59:04Z","updated_at":"2018-03-23T14:59:04Z","author_association":"NONE","body":"RTCSession._sendInitialRequest()\r\n```js\r\n    Promise.resolve()\r\n      // Get a stream if required.\r\n      .then(() =>\r\n      {\r\n        // A stream is given, let the app set events such as 'peerconnection' and 'connecting'.\r\n        if (mediaStream)\r\n        {\r\n          setTimeout(() => Promise.resolve);\r\n        }\r\n        // Request for user media access.\r\n        else if (mediaConstraints.audio || mediaConstraints.video)\r\n        {\r\n          this._localMediaStreamLocallyGenerated = true;\r\n\r\n          return navigator.mediaDevices.getUserMedia(mediaConstraints)\r\n            .catch((error) =>\r\n            {\r\n              if (this._status === C.STATUS_TERMINATED)\r\n              {\r\n                throw new Error('terminated');\r\n              }\r\n\r\n              this._failed('local', null, JsSIP_C.causes.USER_DENIED_MEDIA_ACCESS);\r\n\r\n              debugerror('emit \"getusermediafailed\" [error:%o]', error);\r\n\r\n              this.emit('getusermediafailed');\r\n\r\n              throw new Error('getUserMedia() failed');\r\n            });\r\n        }\r\n      })\r\n      .then((stream) =>\r\n      {\r\n           ....\r\n      }\r\n```\r\n```js\r\n if (mediaStream)\r\n {\r\n    // resolve nothing\r\n    setTimeout(() => Promise.resolve);\r\n }\r\n```\r\nNo media stream will be added to the peerconnection.\r\nIn my case, the offerConstraints for  connection.createOffer(), offerToReceiveAudio and offerToReceiveVideo are both false.\r\nThe promise queue will never resolve or reject.(maybe blocked in createOffer)\r\n"}}
{"actor":{"display_login":"zeng450026937"}}