[][src]Function skyway_webrtc_gateway_api::media::call

pub async fn call<'_>(call_params: &'_ CallQuery) -> Result<CallResponse, Error>

Have WebRTC Gateway start establishing MediaConnection to neighbour.

It's bindings for POST /media/connections.

API

Examples

use skyway_webrtc_gateway_api::media::{call, CallQuery, Constraints};
use skyway_webrtc_gateway_api::prelude::{PeerId, MediaConnectionId, Token};

async fn example() {
    let media_connection_id = MediaConnectionId::new("mc-example");
    let query = CallQuery {
        peer_id: PeerId::new("peer_id"),
        token: Token::new("token"),
        target_id: PeerId::new("target_id"),
        constraints: Some(Constraints {
            video: true,
            videoReceiveEnabled: Some(false),
            audio: false,
            audioReceiveEnabled: Some(false),
            video_params: None,
            audio_params: None,
        }),
        redirect_params: None,
    };
    let result = call(&query).await;
}