I am using Twilio Service and the voice calls from twilio. I am able to call on browser successfully but there is one issue. Whenever i call (from mobile) on my twilio number (on browser) Every user logged in on that time receive the notification of incoming call. In my case i show them an alertify box. When one user receives the call i want to close the alertify box from other users window. Is there any solution for this ?
This is my voice url example.com/incoming.php :
<?php
header('Content-type: text/xml');
?>
<Response>
<Dial>
<Client>someone</Client>
</Dial>
</Response>
And this is my view file twilio.php
<?php
$capability = new ClientToken(xxx,xxx);
$capability->allowClientOutgoing(xxxxxx);
$capability->allowClientIncoming("someone");
$token = $capability->generateToken();
?>
<script type="text/javascript">
Twilio.Device.setup("<?php echo $token; ?>");
Twilio.Device.connect(function (conn) {
alertify.confirm().close()
});
Twilio.Device.disconnect(function (conn) {
alertify.confirm().close()
});
Twilio.Device.incoming(function (conn) {
alertify.confirm('Incoming connection from ' + conn.parameters.From).set('onok', function (closeEvent) {
conn.accept();
})
});
</script>