One Leg In A Conference And Adjusting Stream Volume Of Other Leg

Home » Asterisk Users » One Leg In A Conference And Adjusting Stream Volume Of Other Leg
Asterisk Users 8 Comments

Hi all,

I’m looking for some serious help. 🙂 I couldn’t find a better description for my problem… I think it is quite complex! Here’s what I
would like to achieve:

A SIP caller dials into to my Asterisk 10. He will automatically listen to a specific MP3 stream.

Other SIP callers dial also into my Asterisk. They all will automatically listen to the same MP3 stream.

All callers automatically are joined into the same conference and are able to speak/hear each other at the same time they’re listening to the stream.

The tricky part:

A caller may now press some digits on their their keypad, like 1, or 2, and this will have the effect that the volume of the stream is increasing or decreasing.


When they adjust the volume of the stream, if effects only their stream, and not the volume of the stream of the other callers.

In short: All callers at all times are *always* in the same conference, but each caller is able to increase or decrease the volume of “their”
MP3 stream individually.

If I’m right the MP3 stream cannot come from inside conference (MeetMe or ConfBridge with MOH) because there is no functionality to control the volume individually. So, I guess the basic foundation is a plain conference room without MOH, and then somehow the MP3 stream is “joined”
to each caller individually, without bridging the audio into the whole conference …

I don’t know where to start. Queue? Local channel? …

Thank you so much for any advise! I’m puzzled. 🙂

Regards Markus

8 thoughts on - One Leg In A Conference And Adjusting Stream Volume Of Other Leg

  • Hi Matthew,

    Am 27.08.2012 15:41, schrieb Matthew Jordan:

    thanks! I wasn’t clear enough in my original mail. What I meant is: the volume of the stream that a user is listening to is adjusted, but the volume of the conference itself is not changed! That means, a conference is going on, and everyone is listening to the same music at the same time, but when the music becomes too loud or annoying, a user can individually adjust the volume of his music, while the volume of the speech of each user, basically the conference itself, remains the same.

    I think what I’m looking for is to inject the MP3 stream into only the
    “listening” direction of each user, and allow its volume to get adjusted via DTMF. And at the same time, each user is in the same conference.

    Even more: I would like to be able to feed each user a *different*
    volume-adjustable MP3 stream, but all of the users are still in the same conference (not hearing each others MP3 stream, only their voice!).

    I’ve researched high and low and came up with the following pointers:

    – Dial with the G flag
    – ChanSpy, whispering
    – VOLUME()
    – MOH connected to a local channel
    – Queue that loops indefinitely

    But I don’t know yet how to put it all together.

    I found some hints in the right direction here:

    “Playing audio to one channel only”:

    “Meetme with background music” (last post)

    “Background music during a call”

    Does anyone have the right solution and is available to create a dialplan for me for cash? Please get in touch!

    Thank you!

  • 2012-08-27 19:48, Markus skrev:

    I would do it like this:

    1. Use Meetme or Confbridge and use functionality to jump out of the conference if DTMF is pressed (X-flag in meetme, I expect similar exists in confbridge).

    2. Call AGI, Log to DB, etc – whatever – and return to the conference.

    3. Have a external program that manipulates the channel playing the music. For example this could be done by ChannelRedirect AMI to special dialplan extensions that lower and raises the volum. You can use System()-app in asterisk, or AGI for example. Then use AMI in the script.

    The music on hold could be implemented as a Local channel.

    a. Look at Originate-app, or Originate AMI command. One side of the call are connected to a context/extension/priority (for example: Meetme here). And the other end you dial Local/extension@context (for example:
    Here you play music).

    b. Prepare some extensions that lower/raises volume (look at func_volume)

    Good luck!


  • Hi Matthew,

    Am 27.08.2012 20:08, schrieb Matthew Jordan:

    thanks again. If I understand correctly, you are saying that there is a switch that allows a user to adjust the volume of the “background” music only, but the incoming speech that is coming in to him from other users will not get adjusted? That’s awesome, but I can’t find anything like that in the docs.

    Will your example


  • Markus writes:

    Your requirements are such that the only solution is to mix the audio for each participant individually. This is a rather expensive operation and not supported in either of the Asterisk conference applications, AFAIK.

    I can only think of one way of doing that: give each member their own conference and bridge one leg of that conference into the main conference. How to accomplish that is a bit beyond me though, but perhaps others can help.

    All the mixing is likely to cause a strain on your hardware, and the sound quality could suffer.


  • Matthew, Johan, everyone,

    I got it to work! 🙂 (With the help of a guy I hired via

    Time to share something with the community, so here are the pieces you need to create an open conference, where the users will be in the same conference, and at the same time will listen to an individual MP3 stream in the background, depending on which extension a user dials. Also, the volume of the stream is adjustable for each user separately via DTMF
    1+2, and the speech in the conference is also adjustable individually via DTMF 4+5 and 7+8 (this is plain ConfBridge, no magic there).

    Extensions 01 or 02 is what the user dials. If dialed 01, user will listen to stream 1, if dialed 02, user will listen to stream 2, but both users will be in the same conference and will not hear each others music, but only each others speech.


    exten => _.,1,NoOp(Increasing MOH volume…)
    exten => _.,n,NoOp(…for extension ${sipexten} )
    exten => _.,n,System(/var/lib/asterisk/agi-bin/mohvolume.php ${sipexten} up)

    exten => _.,1,NoOp(Decreasing MOH volume…)
    exten => _.,n,NoOp(…for extension ${sipexten} )
    exten => _.,n,System(/var/lib/asterisk/agi-bin/mohvolume.php ${sipexten}

    exten => go-conference,1,Answer()
    exten => go-conference,n,NoOp(MOH class is ${mohclass})
    exten => go-conference,n,System(/var/lib/asterisk/agi-bin/playmoh.php
    ${sipexten} ${mohclass})
    exten =>

    ; chat, stream 1
    exten => 01,1,NoOp(Dial)
    exten => 01,n,Set(__sipexten=${CHANNEL})
    exten => 01,n,Set(__DYNAMIC_FEATURES=mohvolumeup#mohvolumedown)
    exten => 01,n,Set(__mohclass=chatfire-1)
    exten => 01,n,NoOp(MOH class is ${mohclass})
    exten => 01,n,Dial(Local/go-conference@radio-chatfire,,)

    ; chat, stream 2
    exten => 02,1,NoOp(Dial)
    exten => 02,n,Set(__sipexten=${CHANNEL})
    exten => 02,n,Set(__DYNAMIC_FEATURES=mohvolumeup#mohvolumedown)
    exten => 02,n,Set(__mohclass=chatfire-2)
    exten => 02,n,NoOp(MOH class is ${mohclass})
    exten => 02,n,Dial(Local/go-conference@radio-chatfire,,)

    exten => 55555,1,Answer()
    exten => 55555,n,Set(VOLUME(TX,p)=-3)
    exten => 55555,n,NoOp(MOH class final is ${mohclass_final})
    exten => 55555,n,MusicOnHold(${mohclass_final})

    exten => do_chanspy,1,NoOp()
    exten => do_chanspy,n,Set(DB(moh_${sipexten}/channel)=${CHANNEL})
    exten => do_chanspy,n,ChanSpy(${sipexten},${chanspyoption})
    exten => do_chanspy,n,Hangup()

    exten => do_moh,1,NoOp(Dial)
    exten => do_moh,n,Set(__mohclass_final=${mohclass_play})
    exten => do_moh,n,Dial(Local/55555@radio-chatfire)


    enabled=yes portP38

    secret=kkkkkkkkkk allow=
    read all,system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan,originate write = all,system,call,agent,user,config,command,reporting,originate


    mohvolumeup => 1,self/caller,Macro,mohvolumeup mohvolumedown => 2,self/caller,Macro,mohvolumedown