APIを使用して新しいxAssistコールを作成する方法
1.有効なログイン認証情報を収集する。
2.rtc/createCall
エンドポイントを使用してポストコールをセットアップし、以下に説明するようにリクエストボディをセットアップする。
注釈付きリクエストボディJSON:
{
"callTitle": "Test Call", \\Name of the call
"callReason": "STANDARD", \\Either Standard or SERVICE_REQUEST
"callType": "SFU", \\ Defines the call technology used eg. MESH for 1:1 calls or SFU for Multicalls
"invitedContacts": [ \\ List of multiple CallLogContact objects
{
"displayName": "Tester",
"domain": "ubimax",
"email": "test@test.de",
"phoneNumber": "",
"userDbId": 8, \\The database id of the user, which the contact is linked too.
"userId": "tester" \\The user id id of the user, which the contact is linked too.
}
],
"invitedTeams": [], \\ Leave empty or add a team object to invite a whole team.
"joinAnonymousAllowed": true, \\ Set to true to allow anonymous joins else false
"informOthersDirectly": true, \\ Set to true to trigger the call notification pop-up on invited contacts screen
"creatorUser": 12, \\ The database id of the user. Leave empty or Set it to create calls on behalf of someone, behaving as a broker.
注釈付きレスポンスボディJSON(CallLog
オブジェクト):
注:いくつかのフィールドは簡潔にするために省略されている。
{
"id": 842, \\Incremental id generated by the database
"callId": "e76e1d8a-8267-4bd4-ba5c-00ab76743e74", \\UUID generated by the application
"anonymousJoinAllow": true, \\Whether anonymous joins are allowed or not
"callStatus": "Ended", \\Possible values: Planned, Started or Ended
"creatorContact": { \\ CallLogContact object. References the user that generated the call or the “creatorUser” specified when creating the call.
...
}
"invitedContacts": [ \\ List of multiple CallLogContact objects
{
...
}
]
"callEvents": [ \\ List of multiple call Events
{
"id": 234, \\Incremental id generated by the database
"type": "Created", \\Possible values: Created, Join, Leave, between others.
"contact": { \\ CallLogContact object. References the user related with the current event.
...
}
}
]
3.サーバーは、WebSocket、メール、SMS(CallLogContactObjectで
設定されている場合)を介して招待された連絡先に通知します。
APIを使用してコールの状態を知る方法
1.有効なログイン認証情報を収集する。
2.前述のcreateCall
エンドポイントの応答から取得したcallIdを
使用して、/rtc/getCallLogById?callId=value
エンドポイントを使用した取得コールを設定する。
注釈付きレスポンスボディJSON:
createCall
エンドポイントと同じ応答。たとえば、callertest1からcallertest2に発信された進行中のメッシュ呼の場合、イベントは以下のようになる:
"callEvents": [
{
"id": 697,
"type": "Created",
"contact": {
"id": 1,
"userId": "callertest1",
"userDbId": 8
}
},
{
"id": 698,
"type": "Join",
"contact": {
"id": 1,
"userId": "callertest1",
"userDbId": 8
}
},
{
"id": 699,
"type": "Join",
"contact": {
"id": 2,
"userId": "callertest2",
"userDbId": 9
},
}
],
コネクタからメッシュコールを作成する方法
RtcControllerApi
が公開しているメソッドを使用します。目立つのは、createCallForContacts
でコールを作成し、getCallLogById
でコールの状態を知ることです。
呼び出しを作成するには、前述のcreatorUser
プロパティを使用します。これをスマートグラス・ユーザーのuserDbIdに
設定し、エキスパート・ユーザーとコネクター・ユーザーをinvitedContacts
配列に追加します。したがって、コネクタはブローカーのように動作することになります。スマートグラス・ユーザーが呼び出されるのは、エキスパート・ユーザーが呼び出しに応答した後であることに注意してください。
シーケンス図
Node.jsの例
Node.jsのサンプル・コール(削除され、さらなるセキュリティ・ヘッダとクッキーが必要な場合があります。Login経由で収集されます)。
fetch("https://<serverurl>/rtc/createCall", {
"headers": {
"authorization": "Bearer <token>",
},
"body": "{\"callType\":\"SFU\",\"invitedContacts\":[{\"userId\":\"tester\",\"userDbId\":8,\"email\":\"test@test.com\",\"domain\":\"ubimax\",\"displayName\":\"Tester\",\"phoneNumber\":null}],\"invitedTeams\":[],\"joinAnonymousAllowed\":false,\"callTitle\":\"New Call\",\"plannedDateTime\":null,\"callReason\":\"STANDARD\"}",
"method": "POST",
"mode": "cors"
});