datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 233 forks source link

Make call options #14

Closed datso closed 6 years ago

datso commented 7 years ago

Add ability to send custom headers and determine whether audio or video are enabled.

james-ovens commented 7 years ago

Documentation shows this as being possible: let options = { headers: { "P-Assserted-Identity": "Header example", "X-UA": "React native" } }

let call = await endpoint.makeCall(account, destination, options);

However it isn't there in the current version.

datso commented 7 years ago

Hello, please use with_video branch (https://github.com/Carusto/react-native-pjsip/tree/with-video), and iOS version. I will make a PR soon.

{ "hdr_list": { "P-Assserted-Identity": "Header example", "X-UA": "React native" } }

james-ovens commented 7 years ago

So the video branch on iOS will allow call options, but android doesn't?

datso commented 7 years ago

@james-ovens Yeap, I will make a PR on this weekend to support additional parameters for Java version.

pohodnya commented 6 years ago

@datso https://github.com/Carusto/react-native-pjsip/commit/23260490bbaa159e6719a99c848f5cfdfaf4e54c still work in progress?

How I can add custom header to call on ios?

let options = { headers: { "P-Assserted-Identity": "Header example", "X-UA": "React native" } }
let call = await endpoint.makeCall(account, destination, options);

or

let options = { hdr_list: { "P-Assserted-Identity": "Header example", "X-UA": "React native" } }
let call = await endpoint.makeCall(account, destination, options);
datso commented 6 years ago

Finally, I've decided to use camelCase, current master supports following configuration:

const callSettings = {
  audioCount: 1,
  videoCount: 1
}

const messageSettings = {
   headers: {
      "A": "B",
      "C": "D"
   },
   targetURI: "...",
   contentType: "...",
   body: "..."
}

endpoint.makeCall(account, destination, callSettings, messageSettings)