アプリサーバーの役割
サーバーアプリケーションであるアプリサーバーには2つの役割があります。
- 1対1通話やグループ通話(カンファレンス)の際に、受信者(または参加者)に着信を知らせる
- LINE Planetが通話のために要求する通話タイプごとの適切な情報を渡す
1対1通話 - cc_param
アプリサーバーは、受信者にNotifyコールバック(notify_cb
)のparam
からコピーしたcc_param
を渡さなければなりません。
notify_cb のデータ | データ型 | プッシュペイロードキー |
---|---|---|
param | String | cc_param |
ほとんどのモバイルアプリと同様に、モバイルプラットフォームのプッシュシステムを利用してこの作業を行うことができます。ここでは、APNs(Apple Push Notification service)やFCM(Firebase Cloud Messaging)を使用することを仮定しています。
{
...,
/*
* You have to deliver "cc_param"
* that can be obtained from "param" in "notify_cb".
*
* The callee must receive the "cc_param" value
* to complete the call setup normally.
*/
"cc_param": "...BYdVhGZW5UM1o4WmFwV....",
...
}
また、notify_cb
の他のフィールドを利用してアプリケーションのプッシュデータを定義し、発信者情報の表示や通話タイプの表示のような機能を処理することもできます。以下のサンプルをご覧ください。アプリケーションでは受信者に転送するフィールドを自由に追加できますが、そのフィールドはPlanetKitのコールセットアップ(call setup)に必ず必要なものではありません。
APNsの使用例
{
/*
* cc_param field is required.
*/
"cc_param": "...BYdVhGZW5UM1o4WmFwV....",
...
,
/*
* The following fields are optional.
* Application can add any fields to deliver
* to the callee but it's not required.
* Please note that
* LINE PlanetKit SDK requires only "cc_param" value
* to complete the call setup normally.
*/
"your_field_1": "some-optional-value-1",
"your_field_2": "some-optional-value-2",
...
}
GCM/FCMの使用例
{
/*
* "cc_param" field is required.
*/
"cc_param": "...BYdVhGZW5UM1o4WmFwV....",
...
,
/*
* The following fields are optional.
* Application can add any fields to deliver
* to the callee but it's not required.
* Please note that
* LINE PlanetKit SDK requires only "cc_param" value
* to complete the call setup normally.
*/
"your_field_1": "some-optional-value-1",
"your_field_2": "some-optional-value-2",
...
}
グループ通話(カンファレンス)
1対1通話とは違って、グループ通話ではアプリサーバー側で必要とする作業はありません。ただし、すべての参加者が同じルームで通話をするためには、サービスIDとルームIDが一致しなければなりません。アプリケーションは独自で定義したチャネルを通じて、クライアント間でその情報を共有できます。このときグループ通話のイベントコールバック(on_gcall_evt_cb
)を処理しなくても構いません。
アプリケーションでon_gcall_evt_cb
を使用するには、以下のフィールドからサービスIDとルームIDをコピーしてください。
- サービスID:
svc_id
- ルームID:
id