
Not so long ago,
we abandoned the use of Skype, as a means of corporate communications, in favor of Telegram. However, Skype had one very useful thing on board - audio / video conferencing. As mentioned in previous articles, Asterisk is responsible for communication with us, but while he was working in a minimal configuration (not counting the creation of tasks in redmine about missed calls), we decided to tie the conference call capability.
It all started with the fact that it was urgently necessary to organize a conference with a client and at that time had to use the services of third-party companies. But I would like to have my own, as they say with blackjack and other delights!
And so, to assemble a conference in Asterisk is easier than ever! Just call AppConfBridge:
context conference { 100 => ConfBridge(sb); }
We will not describe confbridge.conf and all possible parameters, you can look at all this, for example,
voip.rus.net/tiki-index.php?page=Asterisk+ConfBridgeIn order to just talk with colleagues in a voice, this is quite enough.
And now we will add the admin to the conference, and the opportunity to invite clients.
1) Permanent admins (Management always wants to be in charge)
Use the AstDB database for this.
database put conference 51 1
Where 51 is the internal number of one of the employees.
And now our conference call will look like this.
context conference { 100 => { Set(STATUS_ADMIN=${DB(conference/${CALLERID(num)})}); switch (${STATUS_ADMIN}) { case 1: Set(CONFBRIDGE(bridge,template)=sb_profile) Set(CONFBRIDGE(user,template)=sb_admin) Set(CONFBRIDGE(menu,template)=admin_menu) break; default: Set(CONFBRIDGE(bridge,template)=sb_profile) Set(CONFBRIDGE(user,template)=sb_user) Set(CONFBRIDGE(menu,template)=user_menu) break; }; Confbridge(sb); }; }
What we got: if the conference number is dialed by a subscriber with clid 51, then the template and the menu of the conference administrator are set for it, we do not give privileges to the rest.
But what if the conference is collected by someone from the junior admins? Raise the first person to the room:
... 100 => { Answer; Set(STATUS_ADMIN=${DB(conference/${CALLERID(num)})}); if ("${CONFBRIDGE_INFO(parties,sb)}"="0"){ Set(STATUS_ADMIN=1); }; switch (${STATUS_ADMIN}) { case 1: ...
$ {CONFBRIDGE_INFO (parties, sb)} - gives the number of participants. If there are 0 in the conference, then the first participant becomes the admin.
But it is not always convenient to talk on the phone, especially if we are talking about a conference with developers, where both hands are needed. Starting a SIP account for the developers of our clients would not be right, because we will use webrtc.
There were a lot of articles on customization, with suggestions to patch asterisk, but in version 13 everything works out of the box. It is only necessary to generate certificates and to include support for sockets.
The script for generating certificates can be found in the source or downloaded separately:
raw.github.com/rillian/asterisk-opus/master/contrib/scripts/ast_tls_cert mkdir /etc/asterisk/keys /usr/src/asterisk-13/contrib/scripts/ast_tls_cert -C asterisk.southbridge.ru -O "centos admin" -d /etc/asterisk/keys
http.conf:
[general] enabled=yes bindaddr=0.0.0.0 bindport=8088
Rtp
Since we all often sit at nat, we include support for ice and stun, otherwise the voice will not find us
rtp.conf:
[general] rtpstart=10000 rtpend=20000 icesupport=yes stunaddr=stun.l.google.com:19302
SIP. Setting peers
We activate websocket and create a feast.
sip.conf:
[general] udpbindaddr=0.0.0.0:5060 realm=pbx.domain.ru ; . transport=udp,ws [webrtc](!) host=dynamic context=from-internal type=friend encryption=yes avpf=yes force_avp=yes icesupport=yes nat=force_rport,comedia directmedia=no disallow=all qualify=yes videosupport=yes allow=ulaw,alaw,vp8,h264,h263p,mpeg4 dtlsenable=yes dtlsverify=no dtlscertfile=/etc/asterisk/keys/asterisk.pem dtlscafile=/etc/asterisk/keys/ca.crt dtlssetup=actpass ; [101](webrtc) defaultusername=101 secret=101Passw0rd
You can find many sip clients on github, for example this
github.com/onsip/sipjs-examplesEverything, now we are collecting the conference, giving the client a link to the softphone with one button “Join the conference” and everyone is happy.
')
You can still try to tie up Google services, for speech recognition and conversation shorthand in a ticket archive, but that's another story.
Author: System Administrator
Centos-admin.ru artzcom .