[ 
https://issues.apache.org/jira/browse/OPENMEETINGS-2789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17917002#comment-17917002
 ] 

Horace Miles commented on OPENMEETINGS-2789:
--------------------------------------------

Maxim I have been looking into this from the asterisk side and here is what I 
have found.  Hopeully this will help.

To ensure that Asterisk SIP callers can hear the audio from the OpenMeetings 
whiteboards, you need to bridge the audio output of OpenMeetings (whiteboard 
audio events) into the Asterisk conference bridge where the SIP callers are 
connected. OpenMeetings supports audio sharing via streams, and Asterisk 
handles the SIP audio, so proper integration between these systems is key.

*Here's how you can achieve this step by step:*
*
 1. Understand the Workflow*

*1. Whiteboard Audio in OpenMeetings:*
   - OpenMeetings generates audio events for tools like whiteboards, screen 
sharing, and media playback. These are typically sent to web-based participants 
using WebRTC audio streams.

*2. SIP Callers via Asterisk:*
   - Asterisk connects SIP callers and bridges them into OpenMeetings 
conferences using SIP integration. However, SIP callers rely on RTP audio 
streams and cannot directly receive WebRTC streams.

*3. Solution:*
   - The audio generated by the OpenMeetings whiteboard must be captured and 
routed as an audio stream that Asterisk SIP callers can receive via RTP.

* 2. Steps to Ensure SIP Callers Hear Whiteboard Audio*
*
 Step 1: Enable Audio Sharing in OpenMeetings*
Ensure OpenMeetings is configured to broadcast audio properly for all 
participants, including SIP callers.

*1. Open the `openmeetings.properties` file:*
   ```bash
   sudo nano 
/opt/om/webapps/openmeetings/WEB-INF/classes/openmeetings.properties
   ```

*2. Ensure the following audio-related settings are enabled:*
   ```properties
   sip.audio=true
   stream.audio.bitrate=64000          Ensure a reasonable bitrate for audio 
quality
   stream.audio.enabled=true           Enable audio streams for all participants
   ```

*3. Restart OpenMeetings:*
   ```bash
   sudo systemctl restart openmeetings
   ```

* Step 2: Route OpenMeetings Audio to Asterisk*

You need to ensure that OpenMeetings audio streams (e.g., from the whiteboard) 
are sent to the SIP participants connected via Asterisk.

* Option A: Use a Loopback Audio Device*
A loopback audio device can capture the audio output from OpenMeetings and 
route it into Asterisk as an audio input for SIP callers.

*1. Install and Configure Loopback Audio on the Server:*
   - On Linux, install and configure a virtual audio device using ALSA or 
PulseAudio:
     ```bash
     sudo apt-get install alsa-utils
     sudo modprobe snd-aloop
     ```

   - Configure OpenMeetings to use the loopback device as its audio output.

*2. Set Up a SIP User in Asterisk for the Loopback Device:*
   - Add a dedicated SIP user in `pjsip.conf` (or `sip.conf` if using 
`chan_sip`) for the loopback device:
     ```ini
     [loopback_audio]
     type=endpoint
     context=from-openmeetings
     disallow=all
     allow=ulaw,alaw
     aors=loopback_audio_aor

     [loopback_audio_aor]
     type=aor
     max_contacts=1
     ```

*3. Connect the Loopback Device to Asterisk:*
   - Use a tool like FFmpeg or GStreamer to capture the audio output from 
OpenMeetings and stream it to Asterisk via SIP:
     ```bash
     ffmpeg -f alsa -i hw:Loopback,1 -ar 8000 -ac 1 -f rtp 
rtp://asterisk-server-ip:5060
     ```

*4. Bridge the Loopback Audio into the Asterisk Conference:*
   - Update your Asterisk dial plan to include the `loopback_audio` SIP 
endpoint in the conference:
     ```ini
     [conference_bridge]
     exten => 1000,1,ConfBridge(1000)
     exten => 1000,n,AddSIPCall(loopback_audio)
     ```

* Step 3: Use RTP Streams from OpenMeetings*
If OpenMeetings is configured to send its audio via RTP streams, you can 
configure Asterisk to receive these RTP streams directly.

*1. Enable RTP Audio Streaming in OpenMeetings:*
   - Check if OpenMeetings supports RTP output for audio:
     ```properties
     rtp.audio.enabled=true
     rtp.audio.port=5004             Set an RTP port for audio
     rtp.audio.format=PCMU           Use a compatible codec like PCMU (G.711 
u-law)
     ```
*
2. Configure Asterisk to Receive RTP Audio:*
   - In `pjsip.conf`, configure an RTP endpoint:
     ```ini
     [openmeetings_audio]
     type=endpoint
     context=from-openmeetings
     disallow=all
     allow=ulaw
     rtp_symmetric=yes
     force_rport=yes
     media_address=your_asterisk_ip
     ```
   - Route this endpoint to the conference.

* Step 4: Verify Codec Compatibility*
Ensure both OpenMeetings and Asterisk use compatible audio codecs:
- Common Codecs: `PCMU` (G.711 u-law), `PCMA` (G.711 a-law), or `Opus`.
- Update the SIP settings in OpenMeetings (`openmeetings.properties`) to allow 
these codecs:
  ```properties
  sip.audio.codec=PCMU
  ```

* 3. Testing and Validation*

*1. Place a Test Call:*
   - Call the OpenMeetings SIP endpoint via Asterisk and verify that audio from 
the whiteboard is audible.

*2. Monitor Asterisk Logs:*
   - Use the Asterisk CLI to check the call flow and audio streams:
     ```bash
     asterisk -rvvvvv
     ```

*3. Check OpenMeetings Logs:*
   - Verify that OpenMeetings is broadcasting audio correctly:
     ```bash
     tail -f /opt/om/logs/openmeetings.log
     ```

* 4. Troubleshooting*

*- Issue: SIP Callers Cannot Hear Audio*
  - Check that OpenMeetings is sending audio to the loopback device or RTP 
stream.
  - Confirm Asterisk is receiving the audio stream using `rtp set debug on`.

*- Issue: Audio Latency*
  - Optimize network conditions to reduce jitter and packet loss.
  - Use lower bitrates for audio streams if bandwidth is limited.

When I tried to add the suggested sip settings, I was unable to join the 
conference.


> SIP USERS UNABLE TO HEAR AUDIO FROM THE WHITE BOARD
> ---------------------------------------------------
>
>                 Key: OPENMEETINGS-2789
>                 URL: https://issues.apache.org/jira/browse/OPENMEETINGS-2789
>             Project: Openmeetings
>          Issue Type: Bug
>            Reporter: Horace Miles
>            Assignee: Maxim Solodovnik
>            Priority: Major
>
> I am using asterisk 18
> Name
> Glory To YAH
> Version
> 7.2.0
> Revision
> d1deecd
> Build date
> 2023-12-19T05:28:43Z
> Asterisk version 18.12.1
> kurento-media-server 7.0.0
> When a sip user connects to a conference room the are able hear audio from 
> the mics.  However, any audio from the whiteboard they are not able to hear.  
>  I will be checking with the Asterisk community to see if there some settings 
> I can change within pjsip file or if there is another codec that needs to be 
> loaded.  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to