最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

deployment - Azure Communication Service: Incoming Call Event Not Triggering in JavaScript - Stack Overflow

programmeradmin5浏览0评论

I'm working on integrating the Azure Communication Service calling feature into my JavaScript application. While I can successfully create outgoing calls, the incoming call event (incomingCall) is not firing. I've already walked through the official Microsoft documentation and ensured that both the token and configuration are correct. Despite my efforts, incoming calls still aren't detected.

Here's the relevant portion of my code:

import { CallClient } from "@azure/communication-calling";
import { AzureCommunicationTokenCredential } from '@azure/communication-common';

let callAgent, incomingCall;

window.initNumbers = async (userToken) => {
    try {
        const callClient = new CallClient();

        callAgent = await callClient.createCallAgent(
            new AzureCommunicationTokenCredential(userToken)
        );

        callAgent.on('incomingCall', (event) => {
            console.log('Incoming call received.');
            incomingCall = event.incomingCall;
        });

    } catch (error) {
        console.error('Error initializing call agent:', error);
    }
};

...
发布评论

评论列表(0)

  1. 暂无评论