Hello habraudi
In this topic I want to tell you about my experience with SIP telephony via webrtc. Tell about what problems I met, what software I tried, what crutches I wrote :).
What was used:
- Asterisk 11.5.1
- GSM gateway
- Sipml5
Start:
')
Initially, the task was to provide a working telephony in the browser. Once the task is set, it means it must be done. We decided not to use flash dialers, but try to call via webrtc. From js dialers were JSSIP and SipML5. I decided to use it in the SipML5 project.
First, we started using asterisk + webrtc2sip. Everything worked fine, but there was a problem with a very long incoming call connection. The problem disappeared after the restart of webrtc2sip. Googling, I learned that the asterisk can work with webrtc.
Made also as it is described in vik sipml5. Collected, checked - it works. Gash all, ruined dialplans, connected GSM gateway. Everything worked well, the problem went away, but other problems appeared:
- Asterisk began to fall when you click on the hold
- There is no call, and sipml is ringing
Seeing that the latest version of Asterisk 11.5.1, I decided to upgrade.
Collected, launched - works fine and without patches. But problems also remained.
Commenting out in rtp.conf
stunaddr=stun.l.google.com:19302
When holding a call, the asterisk stopped falling. But the second problem remained.
I decided to reset the call if the operator did not pick up the phone within four seconds.
For this added on 'i_new_call'
setTimeout(function() { if (!ctx.is_active) { ctx.sip_hangup(); } }, 4200);
The problem is gone. but there was another. If you place a call to hold, you cannot hear either the operator or the client leaving the hold.
Armed with wireshark went to see what was the matter. It turned out that if the call is removed from the hold, the connection comes from another port. Obviously, the solution is not to use hold as it is, but simply turn the microphone on / off to the operator.
audio_tracks = this.session_call.o_session.o_stream_local.getAudioTracks(); for (var i = 0, l = audio_tracks.length; i < l; i++) { audio_tracks[i].enabled = false; }
By chasing everything seemed to work as it should, but there was a periodic silence with the incoming call.
Well, the problem here turned out to be that the GSM gateway was connected to an asterisk from a private network. Migrated everything to public addresses. And this problem is gone
Conclusion
I hope this article will help someone in setting up telephony via webrtc.
Experienced dudes please forgive. First experience with telephony