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.

BUT:

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”:
    http://www.mail-archive.com/asterisk-users@lists.digium.com/msg245811.html

    “Meetme with background music” (last post)
    http://fonality.com/trixbox/forums/trixbox-forums/help/meetme-background-music

    “Background music during a call”
    http://www.mail-archive.com/asterisk-users@lists.digium.com/msg254252.html

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

    Thank you!
    Markus

  • 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!

    /Johan

  • 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

    [bridge_user_menu]
    *1=increase_listening_volume
    1=increase_listening_volume
    *2

  • 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.

    /Benny

  • Matthew, Johan, everyone,

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

    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.

    extensions.conf:

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

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

    [radio-chatfire]
    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 =>
    go-conference,n,ConfBridge(11*48*79*32,,chatfire-public,chatfire-public-menu)

    ; 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})

    [whisper-chatfire]
    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)

    manager.conf:

    [general]
    enabled=yes portP38
    bindaddr7.0.0.1

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

    features.conf:

    [applicationmap]
    mohvolumeup => 1,self/caller,Macro,mohvolumeup mohvolumedown => 2,self/caller,Macro,mohvolumedown

    confbridge.conf:

    [chatfire-public-menu]
    type=menu
    4=increase_listening_volume
    5