InnovateAsterisk / Browser-Phone

A fully featured browser based WebRTC SIP phone for Asterisk
https://www.innovateasterisk.com
GNU Affero General Public License v3.0
516 stars 256 forks source link

Browser-Phone as simple click-here web app for anonymous calls #332

Open vieridipaola opened 2 years ago

vieridipaola commented 2 years ago

Hi,

I'm evaluating the possibility of setting up a simple Internet-facing web page that would allow any client to simply click on a button and connect with an audio call to a specific destination/extension/endpoint/IVR.

I already implemented a telemedicine solution with Browser-Phone, but I did that by setting up temporary SIP guest accounts (with auto-provisioned passwords) that would auto-dial a healthcare service queue (in Asterisk). The incoming guest calls would be within a specific Asterisk context so they would be restricted to, say, just calling a queue. I also customized Browser-Phone so it did not display the search bar, the buddy list, etc.

What I would like to do now is an even "simpler" solution, but I'd like to have some feedback/thoughts before going into it. It's not a telemedicine solution anymore but a simple push-here-and-talk-to-operator widget. First of all, I'd like to avoid generating "guest" accounts unless I can use just one permanent SIP account (PJSIP) for all the potential webrtc clients that can connect from WAN. I'm also wondering if it's safe to enable anonymous SIP calls, and make all of them hit a specific Asterisk context so the caller would not be allowed to do anything except whatever that context provides.

Here's what I think I would do:

[webrtc_anonymous_defaults](!)
type = wizard
transport = transport-wss
accepts_registrations = no
sends_registrations = no
accepts_auth = no
sends_auth = no
has_hint = no
endpoint/context = anonymous
endpoint/dtls_auto_generate_cert = yes
endpoint/webrtc = yes
endpoint/allow_subscribe = no
endpoint/allow = !all,alaw,ulaw,opus,gsm,g722,vp8,h264
endpoint/direct_media = no
; endpoint/max_audio_streams = 10
; endpoint/max_video_streams = 10
endpoint/force_rport = yes
endpoint/disable_direct_media_on_nat = yes
endpoint/direct_media_method = invite
; endpoint/ice_support = yes
endpoint/moh_suggest = default
endpoint/send_rpid = yes
endpoint/rewrite_contact = yes
endpoint/send_pai = yes
endpoint/allow_transfer = yes
endpoint/trust_id_inbound = yes
endpoint/device_state_busy_at = 1
endpoint/trust_id_outbound = yes
endpoint/send_diversion = yes
endpoint/rtp_symmetric = yes
endpoint/tos_audio = 184
endpoint/tos_video = 136

[anonymous](webrtc_anonymous_defaults)
endpoint/callerid = Webcall <0>

I would then define the anonymous context in the dialplan.

How would I go about configuring Browser-Phone for this?

$config_extension = "anonymous";
$config_password = "";
$config_fullname = "Webcall";
phoneOptions.profileUser = "<?php echo $config_extension; ?>";
phoneOptions.profileName = "<?php echo $config_fullname; ?>";
phoneOptions.SipUsername = "web<?php echo $config_extension; ?>";
phoneOptions.SipPassword = "<?php echo $config_password; ?>";

Any thoughts or even code examples as POC?

InnovateAsterisk commented 2 years ago

The most minimal view that the browser phone will fit into is a small mobile screen of about 320(w) by 480(h). This is portrait view. The UI struggles a bit if it's smaller than that and there are a lot of features in the phone that appear by default that you may not want. Sure, you can strip them off, but then there is little point to using this project at all. If you only need a button to allow someone to call - consider only using the sipjs.js library file: https://github.com/onsip/SIP.js

I'll see what else I can do to accommodate this, but it may take some time. The only thing I could think of would be to open the phone temporarily as some kind of popup like this: https://www.innovateasterisk.com/phone/popup.html and close it again one the call is complete. This way you don't see any of the UI.

vieridipaola commented 11 months ago

Hi,

I believe that this "issue" is solved with the latest updates, eg.: https://github.com/InnovateAsterisk/Browser-Phone/blob/master/Phone/click-to-dial.html https://github.com/InnovateAsterisk/Browser-Phone/blob/master/Phone/popup.html

Correct?