Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Updated In-App guide #1127

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions site/global-guides/voice/inAppGuide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,18 @@ Once all of the above initialization steps have been completed, the client is in

The below methods on phone instances of the UA take care of readying the phone to make calls.

#### phone.setServerConfig(serverAddresses, serverDomain, iceServers);
#### phone.setServerConfig(serverAddresses, serverDomain, iceServers)

The setServerConfig method takes 3 parameters that establish the relationship between the client and the network for making calls. This method should be called prior to any attempts to perform any other client or calling functions.

There are three parameters for the setServerConfig method call:

1. serverAddresses: List of the Bandwidth WebRTC gateway FQDN
2. serverDomain: String containing the domain name to use in interactions with the WebRTC Gateway. This domain is a necessary portion of the endpoint addresses.
3. iceServers: List of the STUN and TURN servers, containing STUN:// or TURN:// IP addresses. This optional parameter is by default set as an empty list []. If it is used as an empty list, an external STUN server is not used during the creation of the call. This mode is useful when the client has direct visibility of the public network IP addresses of the Bandwidth WebRTC Gateway.
1. serverAddresses: ['wss://sbc.webrtc-app.bandwidth.com:10081']
+ List of the Bandwidth WebRTC gateway FQDN
2. serverDomain: 'sbc.webrtc-app.bandwidth.com'
+ String containing the domain name to use in interactions with the WebRTC Gateway. This domain is a necessary portion of the endpoint addresses.
3. iceServers: ['stun.l.google.com:19302', 'stun1.l.google.com:19302','stun2.l.google.com:19302']
+ List of the STUN and TURN servers, containing STUN:// or TURN:// IP addresses. This optional parameter is by default set as an empty list []. If it is used as an empty list, an external STUN server is not used during the creation of the call. This mode is useful when the client has direct visibility of the public network IP addresses of the Bandwidth WebRTC Gateway.

#### phone.setOAuthToken(token)

Expand Down Expand Up @@ -222,14 +225,15 @@ This method has two functions:

Once the UA has been configured and the connection to the Bandwidth WebRTC Gateway has been established, it is time to make and manage calls. Once the setup is done, the rest is relatively straightforward.

#### activeCall = phone.call(phone.AUDIO, tn)
#### activeCall = phone.call(callTo, extraHeaders, extraOptions)

The call method invoked on the UA instance will cause the configured and connected UA to launch a call towards the Bandwidth network. Yes - it is that simple.

The call method takes two parameters:
The call method takes three parameters:

1. The first parameter reflects the desired media, and as a result of the nature of the Bandwidth Voice network, this parameter must be supplied with the argument "phone.AUDIO" where the 'phone' represents the instance of the UA that has been created and configured. This parameter may be used in the future to extend the capabilities to other media.
2. The second parameter represents the destination telephone number for the outbound call. This TN should be a valid NANP telephone number.
1. callTo: The destination telephone number for the outbound call. This TN should be a valid E164 number.
2. extraHeaders: An array of strings, each representing a SIP header, to be added to the INVITE request.
3. extraOptions: The object can be used to set custom media streams for created calls.

The call method returns an instance of a Session object, providing a handle that can be used for subsequent modification of the call while it is in progress. The methods applicable to the Session object instance will be discussed below.

Expand Down
Loading