A SIP call to a mobile phone is a special case of calls between a browser and a SIP device, when the SIP server either operates as a GSM/PSTN gateway itself or connects to one during the call.
Chrome | Firefox | Safari 11 | Edge | |
---|---|---|---|---|
Windows | + | + | + | |
Mac OS | + | + | + | |
Android | + | + | ||
iOS | - | - | + |
Management of SIP functions is performed using the REST API.
1. For the test we use:
2. Open the Phone UI web application. Click Log in and enter the data of the SIP account:
3. Enter the mobile phone number and click Voice call. Dialing starts:
4. The mobile phone displays an incoming call on the screen:
5. Answer the call on the mobile phone:
6. The browser also shows that the connection is established.
7. To terminate the call, click the "Hangup" button.
Below is the call flow when using the Phone example to create a call.
1. Creating a call:
session.createCall(), call.call() code
var outCall = this.session.createCall({ callee: callee, visibleName: this.sipOptions.login, localVideoDisplay: this.localVideo, remoteVideoDisplay: this.remoteVideo, constraints: constraints ... }); outCall.call(); |
2. Establishing a connection to the SIP server
3. Establishing a connection to the GSM/PSTN gateway
4. Establishing a connection to the mobile terminal
5. Receiving a confirmation from the GSM/PSTN gateway
6. Receiving a confirmation from the SIP server
7. Receiving from the server an event confirming successful connection.
CallStatusEvent ESTABLISHED code
var outCall = this.session.createCall({ callee: callee, visibleName: this.sipOptions.login, localVideoDisplay: this.localVideo, remoteVideoDisplay: this.remoteVideo, constraints: constraints ... }).on(CALL_STATUS.ESTABLISHED, function(call){ me.callStatusListener(call); ... }); outCall.call(); |
8. Participants of the call exchange audio streams
9. Terminating the call
call.hangup() code
Phone.prototype.hangup = function () { trace("Phone - hangup " + this.currentCall.id() + " status " + this.currentCall.status()); this.hideFlashAccess(); if (this.currentCall.status() == CALL_STATUS.PENDING) { this.callStatusListener(this.currentCall); } else { this.currentCall.hangup(); } this.flashphonerListener.onHangup(); }; |
10. Sending the command to the SIP server
11. Sending the command to the GSM/PSTN gateway
12. Receiving a confirmation from the GSM/PSTN gateway
13. Receiving a confirmation from the SIP server