Browser-Phone icon indicating copy to clipboard operation
Browser-Phone copied to clipboard

WebRTC in the cloud

Open prathibhacdac opened this issue 1 year ago • 17 comments

I've installed browser phone application in amazon cloud. I'm not getting the video.

In firefox, I'm getting STUN failed,add TURN server. Asterisk server in turn acts as the TURN server. Where should I add the TURN server in Browser phone application and whats the format for it?

prathibhacdac avatar Jul 14 '23 05:07 prathibhacdac

The same thing was happening to me, I was not getting the audio. So I tried it on my local server and it worked.

deepaksharma9899 avatar Jul 14 '23 10:07 deepaksharma9899

The same thing was happening to me, I was not getting the audio. So I tried it on my local server and it worked.

In local server it is working for me too. Now I want it in cloud.

prathibhacdac avatar Jul 14 '23 10:07 prathibhacdac

You must watch this video:

https://www.innovateasterisk.com/s2e2-webrtc-in-the-cloud/

There are specific settings in rtp for it to work.

InnovateAsterisk avatar Jul 14 '23 14:07 InnovateAsterisk

I tried this, it is working locally. but not working on AWS.

deepaksharma9899 avatar Jul 17 '23 05:07 deepaksharma9899

You must watch this video:

https://www.innovateasterisk.com/s2e2-webrtc-in-the-cloud/

There are specific settings in rtp for it to work.

There is no mention abt rtp in the documentation.

prathibhacdac avatar Jul 17 '23 08:07 prathibhacdac

Can you point me where it is mentioned?

prathibhacdac avatar Jul 19 '23 04:07 prathibhacdac

It could be just that the AWS firewall is not allowing the RTP packets inbound. Allow all the UDP packets inbound in your security group.

InnovateAsterisk avatar Jul 19 '23 10:07 InnovateAsterisk

Also, you can debug the RTP on the Asterisk box, and see the packet flow. Post a sample.

InnovateAsterisk avatar Jul 19 '23 11:07 InnovateAsterisk

I've allowed all the traffic. Its working now. Does hosting in cloud resolve the latency?

prathibhacdac avatar Jul 19 '23 11:07 prathibhacdac

Once I got the video. But now I'm not getting it.

WARNING[82838][C-00000008]: channel.c:5765 set_format: Unable to find a codec translation path: (slin) -> (opus|vp9) [2023-07-19 11:14:56] WARNING[82838][C-00000008]: res_musiconhold.c:379 ast_moh_files_next: Unable to open file '/var/lib/asterisk/moh/macroform-cold_day': Function not implemented [2023-07-19 11:14:56] WARNING[82838][C-00000008]: channel.c:5765 set_format: Unable to find a codec translation path: (slin) -> (opus|vp9) [2023-07-19 11:14:56] WARNING[82838][C-00000008]: res_musiconhold.c:379 ast_moh_files_next: Unable to open file '/var/lib/asterisk/moh/reno_project-system': Function not implemented [2023-07-19 11:14:56] WARNING[82838][C-00000008]: channel.c:5765 set_format: Unable to find a codec translation path: (slin) -> (opus|vp9) [2023-07-19 11:14:56] WARNING[82838][C-00000008]: res_musiconhold.c:379 ast_moh_files_next: Unable to open file '/var/lib/asterisk/moh/macroform-the_simplicity': Function not implemented [2023-07-19 11:14:56] WARNING[82838][C-00000008]: channel.c:5765 set_format: Unable to find a codec translation path: (slin) -> (opus|vp9) [2023-07-19 11:14:56] WARNING[82838][C-00000008]: res_musiconhold.c:379 ast_moh_files_next: Unable to open file '/var/lib/asterisk/moh/macroform-robot_dity': Function not implemented [2023-07-19 11:14:56] WARNING[82838][C-00000008]: channel.c:5765 set_format: Unable to find a codec translation path: (slin) -> (opus|vp9) [2023-07-19 11:14:56] WARNING[82838][C-00000008]: res_musiconhold.c:379 ast_moh_files_next: Unable to open file '/var/lib/asterisk/moh/manolo_camp-morning_coffee': Function not implemented

prathibhacdac avatar Jul 19 '23 11:07 prathibhacdac

I've allowed all the traffic.

Make sure its just UDP you allow all with... otherwise you will have trouble.

Does hosting in cloud resolve the latency?

The thing to remember here is that Asterisk is a B2BUA, meaning that the media always flows through it - especially with DTLS (the encrypted RTP). This "3rd point" in a conversation between two people can add latency. People say that from about 300ms latency can effect call quality. To reduce the time it takes for packets to flow from one person to the other, the most direct path is best - this means Peer-To-Peer, but Asterisk doesn't support this. (It probably never will)

InnovateAsterisk avatar Jul 19 '23 11:07 InnovateAsterisk

WARNING[82838][C-00000008]: channel.c:5765 set_format: Unable to find a codec translation path: (slin) -> (opus|vp9)

You don't have opus codec installed (13:01 in the video)

InnovateAsterisk avatar Jul 19 '23 11:07 InnovateAsterisk

debug the RTP on the Asterisk box, and see the packet flow. Post a sampl

Sent RTP packet to      14.139.183.221:56068 (type 98, seq 016379, ts 1853920523, len 001053)
Got  RTP packet from    42.111.161.213:31022 (type 107, seq 029513, ts 1168001882, len 000049)
Sent RTP packet to      14.139.183.221:56068 (type 111, seq 024776, ts 1168001856, len 000039)
Got  RTP packet from    42.111.161.213:31022 (type 107, seq 029514, ts 1168002842, len 000049)
Sent RTP packet to      14.139.183.221:56068 (type 111, seq 024777, ts 1168002816, len 000039)

prathibhacdac avatar Jul 19 '23 11:07 prathibhacdac

I've creating an peer to peer video call application. Is it possible to integrate asterisk with it for call routing? When a user dials a number(eg:100), the call should get routed to any one of the free call taker?

prathibhacdac avatar Jul 19 '23 11:07 prathibhacdac

Will Siperb be suitable for this?

prathibhacdac avatar Jul 20 '23 04:07 prathibhacdac

Will Siperb be suitable for this?

Siperb is designed to create private networks for Peer-to-Peer audio and video calls (with text and media), it does not use Asterisk as a switching service, it uses OpenSIPS. This should make it feel a lot like WhatsApp.

One of the "peers" however, can be your Asterisk or legacy server like Asterisk (on-site or hosted), meaning that this could be your office or home PBX, providing you with all the functionality of Asterisk that you are used to, like queue participation etc. In this connection mode, the calls are transcoded and formatted to be regular SIP. This should make it feel a lot like a regular PBX Extension.

At the moment Asterisk is only used for Voicemail, and for some Conference functionality. A user can send a public URL to invite participants to a conference, and this would route callers to an Asterisk Conference. This should make it feel a lot like Zoom.

InnovateAsterisk avatar Jul 20 '23 15:07 InnovateAsterisk

Can we change the server from asterisk to opensips. Will it resolve the problem of video?

deepaksharma9899 avatar Jul 21 '23 05:07 deepaksharma9899