Playing soundfiles in running ConfBridge-ish conferences (originate/SipP?)

762 views
Skip to first unread message

fwoeck

unread,
Oct 14, 2011, 10:41:18 AM10/14/11
to Adhearsion
Hi, I'm looking for a way to play a sound file in a running
conference. The used program is similar to ConfBridge but has no
native option to inject sound files. I was thinking about
"originate"ing a call to the conference but don't get the job done
from within ahn. Is it possible or do I have to rely on external tools
like SipP?

Thanks in advance,
Frank

Ben Klang

unread,
Oct 14, 2011, 10:48:07 AM10/14/11
to adhea...@googlegroups.com
Hi Frank,

There are at least two ways to approach this:

1) Rather than something external like SipP, just use a Local channel.  You can Originate a call using AMI or even a call-file that will connect one end of a Local channel into the conference bridge and the other end to Adhearsion via AGI.  Then you can use normal AGI methods to play sound files into that conference.

2) If you are using something like app_konference, there are CLI commands that can be used to play sound files to a conference participant directly.  CLI commands can also be invoked via AMI.  For an example of this see https://github.com/bklang/ahn_appkonference/blob/master/lib/appkonference.rb

There are certainly other options, but the above two are probably easiest.

/BAK/


Thanks in advance,
Frank

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To post to this group, send email to adhea...@googlegroups.com.
To unsubscribe from this group, send email to adhearsion+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/adhearsion?hl=en.


fwoeck

unread,
Oct 14, 2011, 11:02:39 AM10/14/11
to Adhearsion
Hi Ben,

this is probably a noob question: I have a Drb connection setup and
stored in "Ahn".
So when I say

Ahn.originate(channel: "SIP/1234",
context: "robocall",
priority: "1",
exten: "1000",
async: "true")

What happens here? I don't get any "call" handle back to what I could
send a :play.
Or does the "originate" just one connection and I have still to
connect the "other end of the line" to another (ahn) context?

--Frank


On 14 Okt., 16:48, Ben Klang <bkl...@mojolingo.com> wrote:
> Hi Frank,
>
> On Oct 14, 2011, at 10:41 AM, fwoeck wrote:
>
> > Hi, I'm looking for a way to play a sound file in a running
> > conference. The used program is similar to ConfBridge but has no
> > native option to inject sound files. I was thinking about
> > "originate"ing a call to the conference but don't get the job done
> > from within ahn. Is it possible or do I have to rely on external tools
> > like SipP?
>
> There are at least two ways to approach this:
>
> 1) Rather than something external like SipP, just use a Local channel.  You can Originate a call using AMI or even a call-file that will connect one end of a Local channel into the conference bridge and the other end to Adhearsion via AGI.  Then you can use normal AGI methods to play sound files into that conference.
>
> 2) If you are using something like app_konference, there are CLI commands that can be used to play sound files to a conference participant directly.  CLI commands can also be invoked via AMI.  For an example of this seehttps://github.com/bklang/ahn_appkonference/blob/master/lib/appkonfer...

fwoeck

unread,
Oct 14, 2011, 11:41:05 AM10/14/11
to Adhearsion
I'll try to clarify my earlier post -
I have an asterisk extension:

[robocall]
exten => _X.,1,AGI(agi://127.0.0.1)

and this ahn dialplan context:

robocall {
answer
dial("WOOMERA/conf:#{extension}")
hangup
}

Now, let's say there's an active conference in room/extension 8621
running. I want to play a sound into it.
I tried to do something like this:

Ahn.originate channel: 'SIP/1234', context: 'robocall', exten: '8621',
priority: '1', application: 'PlayBack', data: 'hello-world'

This may be syntactically wrong, but more important is, whether it's
general nonsense or not.
I have the feeling, that I'm missing something here.

--Frank

Ben Klang

unread,
Oct 14, 2011, 12:07:17 PM10/14/11
to adhea...@googlegroups.com
Sounds like you're pretty close on this.  Some ideas below:

On Oct 14, 2011, at 11:41 AM, fwoeck wrote:

I'll try to clarify my earlier post -
I have an asterisk extension:

[robocall]
exten => _X.,1,AGI(agi://127.0.0.1)

and this ahn dialplan context:

robocall {
 answer
 dial("WOOMERA/conf:#{extension}")
 hangup
}

Now, let's say there's an active conference in room/extension 8621
running. I want to play a sound into it.
I tried to do something like this:

Ahn.originate channel: 'SIP/1234', context: 'robocall', exten: '8621',
priority: '1', application: 'PlayBack', data: 'hello-world'


This will first place an outbound call to the SIP peer labeled "1234" from sip.conf.  As soon as that channel answers the line, Asterisk will connect it to the dialplan at the 8621 extension inside the robocall context.  Your Adhearsion app will then dial the WOOMERA channel and join the conference.

This sounds like a good example of how to connect an external SIP extension into a Woomera conference.  But you also want to play sound recordings.  I'd suggest a local channel to achieve this.

After you get a some people into the conference, try originating a second call, this time going to a different context.  The new context will be responsible for playing audio files.  I've taken your original code and modified it in this example gist:

Does that help?

/BAK/

fwoeck

unread,
Oct 14, 2011, 12:51:19 PM10/14/11
to Adhearsion
aah yes - this does clear up the thing for me.
Thank you!

fwoeck

unread,
Oct 14, 2011, 1:00:22 PM10/14/11
to Adhearsion
(by the way: adhearsion is awesome! for me, beeing a ruby programmer,
this stuff wouldn't be feasable without ahn)

On 14 Okt., 18:07, Ben Klang <bkl...@mojolingo.com> wrote:

fwoeck

unread,
Oct 15, 2011, 5:30:50 AM10/15/11
to Adhearsion
Hi Ben, I implemented your gist example, and it works well when I use
ConfBridge instead of the Woomera-Application.
However when I drop in Woomera, asterisk complains about the codecs
beeing used:

[Oct 15 09:25:16] NOTICE[17798]: channel.c:4128 __ast_read: Dropping
incompatible voice frame on WOOMERA/conf:1/
role=presenter:tiles=0:position=none-c328 of format alaw since our
native format has changed to 0x40 (slin)

Is there a way to define the codecs for local channels or is this
merely a sign of something else going wrong?
Thanks,
Frank

On 14 Okt., 18:07, Ben Klang <bkl...@mojolingo.com> wrote:

Ben Klang

unread,
Oct 15, 2011, 10:02:43 AM10/15/11
to adhea...@googlegroups.com
On Oct 15, 2011, at 5:30 AM, fwoeck wrote:

Hi Ben, I implemented your gist example, and it works well when I use
ConfBridge instead of the Woomera-Application.
However when I drop in Woomera, asterisk complains about the codecs
beeing used:

[Oct 15 09:25:16] NOTICE[17798]: channel.c:4128 __ast_read: Dropping
incompatible voice frame on WOOMERA/conf:1/
role=presenter:tiles=0:position=none-c328 of format alaw since our
native format has changed to 0x40 (slin)

Is there a way to define the codecs for local channels or is this
merely a sign of something else going wrong?
Thanks,
Frank


After reading your question it occurred to me that we could optimize away the whole Local channel.  I've updated the Gist to reflect the change, but essentially:

manager.call_and_exec "WOOMERA/conf:8621", "AGI", :data => "agi://127.0.0.1/noisemaker"


In this way there is no Local channel to set up or have a codec. Only a single outbound channel is connected to WOOMERA and the other side directly to AGI. Try that and see if it fixes the codec issue.

/BAK/


2) If you are using something like app_konference, there are CLI commands that can be used to play sound files to a conference participant directly.  CLI commands can also be invoked via AMI.  For an example of this seehttps://github.com/bklang/ahn_appkonference/blob/master/lib/appkonfer....

fwoeck

unread,
Oct 15, 2011, 11:12:22 AM10/15/11
to Adhearsion
Hi Ben! Again, this works with ConfBridge, but I experience lots of
asterisk segfaults:

asterisk[8659]: segfault at 0 ip 0000003feb530dfc sp 00007fb84835d788
error 4 in libc-2.12.so[3feb400000+186000]

as soon as Woomera comes into play (e.g. with the
manager_interface.originate: all callerids not beeing integer blow up,
weird).
I suspect, there's something wrong with the woomera module and I'll
try to get this fixed first.

Thanks
--Frank
Reply all
Reply to author
Forward
0 new messages