Twilio Voice SDK - show FriendlyName on call

狂风中的少年 提交于 2019-12-25 01:34:26

问题


So, I'm now able to create a voice call (voip, no phone numbers) using the Twilio Sever JS SDK, executing the following code:

makeCall : function(req, res) {
    req.checkBody({
        'To' : {
            notEmpty : true,
            errorMessage : 'Invalid To'
        }
    });

    req.getValidationResult().then(function(result) {
        if (!result.isEmpty()) {
            res.status(400).json(responseHandler.errorResponse("INVALID_FIELDS", result.mapped()));
            return;
        }

        const twimlRes = new Twiml.VoiceResponse();

        const dial = twimlRes.dial()

        dial.client(req.body.To);

        res.set('Content-Type', 'text/xml');

        res.send(twimlRes.toString());
    });
}

However on my phone and CallKit features (iOS) I only have access to a client ID, is there any method to update the ID to a friendlyName on getToken or on even on dial / VoiceResponse ?

I already tried to follow this but I think it only applies to phone numbers? Correct me If I'm wrong but I have no outgoingCallerIds..

EDIT: I also tried to add a callerId in the dial method:

twimlRes.dial({ callerId: 'Jose' })

But on my phone on my phone I have a transformed string which looks like the corresponding phone key numbers 5673 (Jose).

Thanks in advance

来源:https://stackoverflow.com/questions/46812414/twilio-voice-sdk-show-friendlyname-on-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!