|
|
@@ -808,6 +808,7 @@ export function isSharingEnabled(sharingFeature: string) {
|
|
808
|
808
|
* Sends a post request to an invite service.
|
|
809
|
809
|
*
|
|
810
|
810
|
* @param {Array} inviteItems - The list of the "sip" type items to invite.
|
|
|
811
|
+ * @param {URL} locationURL - The URL of the location.
|
|
811
|
812
|
* @param {string} sipInviteUrl - The invite service that generates the invitation.
|
|
812
|
813
|
* @param {string} jwt - The jwt token.
|
|
813
|
814
|
* @param {string} roomName - The name to the conference.
|
|
|
@@ -816,6 +817,7 @@ export function isSharingEnabled(sharingFeature: string) {
|
|
816
|
817
|
*/
|
|
817
|
818
|
export function inviteSipEndpoints( // eslint-disable-line max-params
|
|
818
|
819
|
inviteItems: Array<Object>,
|
|
|
820
|
+ locationURL: URL,
|
|
819
|
821
|
sipInviteUrl: string,
|
|
820
|
822
|
jwt: string,
|
|
821
|
823
|
roomName: string,
|
|
|
@@ -825,13 +827,15 @@ export function inviteSipEndpoints( // eslint-disable-line max-params
|
|
825
|
827
|
return Promise.resolve();
|
|
826
|
828
|
}
|
|
827
|
829
|
|
|
|
830
|
+ const baseUrl = locationURL.href.toLowerCase().replace(`/${roomName}`, '');
|
|
|
831
|
+
|
|
828
|
832
|
return fetch(
|
|
829
|
|
- `${sipInviteUrl}?token=${jwt}`,
|
|
|
833
|
+ sipInviteUrl,
|
|
830
|
834
|
{
|
|
831
|
835
|
body: JSON.stringify({
|
|
832
|
836
|
callParams: {
|
|
833
|
837
|
callUrlInfo: {
|
|
834
|
|
- baseUrl: window.location.origin,
|
|
|
838
|
+ baseUrl,
|
|
835
|
839
|
callName: roomName
|
|
836
|
840
|
}
|
|
837
|
841
|
},
|
|
|
@@ -842,6 +846,7 @@ export function inviteSipEndpoints( // eslint-disable-line max-params
|
|
842
|
846
|
}),
|
|
843
|
847
|
method: 'POST',
|
|
844
|
848
|
headers: {
|
|
|
849
|
+ 'Authorization': `Bearer ${jwt}`,
|
|
845
|
850
|
'Content-Type': 'application/json'
|
|
846
|
851
|
}
|
|
847
|
852
|
}
|