vline-node の例をローカルで正常にテストしましたが、コードをサーバーにアップロードすると、ユーザーは他の人に電話をかけることができますが、受信する電話がないため、他のエンド ユーザーは電話を受けることができません。私はGitHubからダウンロードしたこのスクリプトを使用しています。vline の例で使用されているリンク
https://github.com/vline/vline-php-example
あなたがこれを使ったなら、私を助けてください。ありがとう
var client, vlinesession,
authToken = '<?php echo $vline->getJWT() ?>',
serviceId = '<?php echo $vline->getServiceID() ?>',
profile = {"displayName": '<?php echo $vline->getUserDisplayName() ?>', "id": '<?php echo $vline->getUserID() ?>'};
// Create vLine client
window.vlineClient = client = vline.Client.create({"serviceId": serviceId, "ui": true});
// Add login event handler
client.on('login', onLogin);
// Do login
client.login(serviceId, profile, authToken);
function onLogin(event) {
vlinesession = event.target;
// Find and init call buttons and init them
$(".callbutton").each(function(index, element) {
initCallButton($(this));
});
}
// add event handlers for call button
function initCallButton(button) {
var userId = button.attr('data-userid');
// fetch person object associated with username
vlinesession.getPerson(userId).done(function(person) {
// update button state with presence
function onPresenceChange() {
if(person.getPresenceState() == 'online'){
button.removeClass().addClass('active');
}else{
button.removeClass().addClass('disabled');
}
button.attr('data-presence', person.getPresenceState());
}
// set current presence
onPresenceChange();
// handle presence changes
person.on('change:presenceState', onPresenceChange);
// start a call when button is clicked
button.click(function() {
if (person.getId() == vlinesession.getLocalPersonId()) {
alert('You cannot call yourself. Login as another user in an incognito window');
return;
}
if(button.hasClass('active'))
person.startMedia();
});
});
}
return client;
})();
$(window).unload(function() {
vlineClient.logout();
});
</script>`