Music On Hold via LINE IN on Sound Card

crees
Posts: 293
Member Since:
2006-08-09

****UPDATE. I successfully got MOH working via LINE IN on sound card. Please read the thread for more info. As always with Asteisk and Open source - your mileage may vary.

Anyone here have any luck getting MOH to work with the LINE IN on the sound card?

I know this is a common MOH topic but I have only found examples but nothing that seems to explain or support that it works.

Here is my setup:

musiconhold_additional.conf

[default]
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/var/lib/ast-playlinein

ast-playlinein

#!/bin/bash
/usr/bin/arecord -q -c 1 -r 8000 --buffer-size=2048 -f S16_LE -t raw

Log of error when MOH is launched

-- Executing Answer("SIP/2100-0977a780", "") in new stack
-- Executing Playback("SIP/2100-0977a780", "pls-hold-while-try") in new stack
-- Playing 'pls-hold-while-try' (language 'en')
-- Executing SetMusicOnHold("SIP/2100-0977a780", "default") in new stack
-- Executing WaitMusicOnHold("SIP/2100-0977a780", "300") in new stack
-- Started music on hold, class 'default', on channel 'SIP/2100-0977a780'
-- Stopped music on hold on SIP/2100-0977a780

I have tried many differnet varaitions (CHOMD, enable line in on the mixer etc) with restarting asterisk between all of the tries. If I lauch the ast-playlinein It does give me alot of character feedback. I luanched the mixer and made sure my line is was on and verified it with the speakers. Looks to be something with my syntax and or rights.

Any suggestions or pointers that any of you have will be great. I know this is more of an Asterisk Issue but figured I would see if anyone here has come across this and had any success



jtknapp
Posts: 108
Member Since:
2006-06-07
Re: Music On Hold via LINE IN on Sound Card

Has anyone been able to get MOH from a sound card line in to work with 1.2.3? If so how did you do it?

--


jtknapp
Posts: 108
Member Since:
2006-06-07
Re: Music On Hold via LINE IN on Sound Card

when you launched Asterisk from -CG did it work for you?

--


crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Updated 2-24-07

Ok I beleive I got it figured out, If anyone would like to try this (on your non production boxes) let me know what resutls you get.

1. use your favorite editor, or config edit and open up the musiconhold.conf
You will mostlikley already have a [default] cateogry. Rename [default] to [default2]

then Add the following into musiconhold.conf:

[default]
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/var/lib/tb-playlinein

2. Check and make sure In /var/lib/asterisk/mohmp3 there should be at least one mp3 file. (by default there should be songs here unless they have been removed manually) :

cd /var/lib/asterisk/mohmp3
ls

Check and make sure there are at least one music file

3. Now we need to create a simple script for MOH to run when called. Create a script file /var/lib/tb-playlinein by using nano:

nano -w /var/lib/tb-playlinein

copy following 2 lines of code and paste it in nano:

#!/bin/bash
/usr/bin/arecord -q -c 1 -r 8000 --buffer-size=2048 -f S16_LE -t raw

now save your changes (control x) confirm by pushing y and enter to save and quit.

now set ownsship and make it executable but make sure you are in the appropriate directory:

cd /var/lib
chown asterisk:asterisk tb-playlinein
chmod 777 tb-playlinein

4. now we need to allow asterisk to have access to the sound device/files. We will need to create a group called audio and give root and asterisk access to it.

groupadd -g 525 audio
usermod -G audio root
usermod -G audio asterisk

5. In order for asterisk to use the card we will need to add a couple of lines in the amportal startup script. When your TB boots up it will set the appropriate permissions allowing MOH to access the card and play the line in souce. Use nano and add 2 lines of code to accomplish this:

nano -w /usr/sbin/amportal

Depending on your version of TB and settings look for the following line "chown asterisk /dev/tty9" (mine was on line 51) Add the following two lines after but make sure NOT to delete any existing commands above or below:

chown -R root:audio /dev/snd
chmod -R a+rwX /dev/snd

Your finished result should look simular to this plus code on top and bottom :

chown asterisk /dev/tty9
chown -R root:audio /dev/snd
chmod -R a+rwX /dev/snd

now save your changes (control x) , confirm by pushing y, and enter to save and quit.

6. just for the heck of it reboot your pc. This will load the startup script and set the right permissions to access your sound card for the MOH line-in

7. You can then plug into the line-in port or the mic port your FM-tuner or external audio player. Then you need to configure your mixer to turn on any line in and capturing or any mic or mic capture. to do this launch the following command:

alsamixer

Play with the adjustments to find the appropriate level. Push the M key to unmute any mic line line-in and capture channels and space key to activate!. NOTE: I created a new que (with no agents) and set the wait/hold music to the newly created MOH group called "default". while listening to the music on hold and voice promps I was able to adjust the music volume in accordance to the prompts(not too loud or too quiet) I also found that on my soundcard I could not get the line in to work untill I pushed the space key on the caputre. I also moved the line to the mic in and both worked - very loud sound blaring at first in the phone. Make sure your music source is set right (not blaring or you will get a bad distortion)

and that should be it.

Since my linux skills are based on my google university degree I would ask those who are fluent with linux to correct any errors or proceedures I have listed.

hope this helps

crees



eoo
Posts: 448
Member Since:
2006-10-30
Re: Music On Hold via LINE IN on Sound Card

We don't use MOH because the each call on hold/in queue spawns a new instance to play music and it ends up reducing the call handling capacity of the server dramatically. Does moving to MOH from line-in address this at all or is this a clever way to route the line in into the existing MOH playing processes?



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Update: It looks like only one proccess is used when multiple calls are made. Can anyone test this and verify it. Using TOP only one arecord process is listed(the prccess that MOH Line in uses)

OLD POST:
Thats a good question. I do know that the MOH with line in launches the arecord command. according to the logs each time the MOH is initialized it shows MOH started..... asuming that this too spawns a new instance.

I will look into it further. However it does sound better then having the music start all over again.



jades
Posts: 2340
Member Since:
2006-11-26
Re: Music On Hold via LINE IN on Sound Card

if anyone got this working 100%, please let us know.

thanks

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Hi ja133

See if the steps I outlined above will work and let me know

Right now it works on my test box.

crees



jades
Posts: 2340
Member Since:
2006-11-26
Re: Music On Hold via LINE IN on Sound Card

it is playing the music on hold that is uploaded in the system

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

You will probably need to amportal stop start the system. you may even need to restart the box. It seems that I had this same problem untill it restarted and loaded the new config. Also make sure the name of the MOH is the same as your freepblx settings (defualt is what I kept mine at)
crees



jades
Posts: 2340
Member Since:
2006-11-26
Re: Music On Hold via LINE IN on Sound Card

i did anything i can
is there anything i should be commenting out on the musoconhold conf files?
thanks

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

post your musiconhold add conf file and any other files. run asterisk in verbose mode asterisk -vvvvvr and copy and paste the part when it initialzes the MOH.

crees



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Hi Ja133

I have updated the original instructions on this post (page 1) Please go over it again and make sure that your rename the original [default] to [default2] then also follow the instruction on adding the permission commands in the amportal startup script. I did this from a raw install on TB 1.2.3.

You will also need to check and make sure that your sound card is compadable with alsa. by launching alsamixer it should show what sound card it has detected. You will also need to play with your faders on your alsamixer (navigate by using left and right keys). By pushing m to unmute and space key to activate the capture part of the card plus moving the faders up (using up or down keys)

crees



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card
Quote:
eoo wrote:
We don't use MOH because the each call on hold/in queue spawns a new instance to play music and it ends up reducing the call handling capacity of the server dramatically. Does moving to MOH from line-in address this at all or is this a clever way to route the line in into the existing MOH playing processes?

Promising news!!!

Can someone confirm this for me?

I have used TOP command to monitor this proccess (tb-playlinein uses arecord in TOP) Only one instance of arecord was being used for multiple hold calls with on average of 1.0% CPU usage and %0.4 memory. I did not see any multiple instances.

crees



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

I have updated the instructions on page 1 of this post. The new update will now work when you reboot your trixbox. This was do to the rights changin on the /dev/snd after a reeboot. To fix this I added the needed commands to the amportal startup script. Read the updated post for more info.



jades
Posts: 2340
Member Since:
2006-11-26
Re: Music On Hold via LINE IN on Sound Card

hi
thanks. i did your changes, and it still plays the music already uploaded.
my soundcard is detected in the mixer
im using trixbox 2.0

here are my config files:

musiconhold.conf:
;
; Music on hold class definitions
; This is using the new 1.2 config file format, and will not work with 1.0
; based Asterisk systems
;
;[classes]
;default => quietmp3:/var/lib/asterisk/mohmp3/stream,http://10.10.173.80:9000/stream.mp3
;#include musiconhold_custom.conf
#include musiconhold_additional.conf
;slimp3 => custom:/var/lib/asterisk/mohmp3-dummy,/usr/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://scfire-chi0l-2.stream.aol.com:80/stream/1038

[default2]
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/var/lib/tb-playlinein

musiconhold_additional.conf:

[default]
mode=files
directory=/var/lib/asterisk/mohmp3/
random=yes
;[stream]
;mode=files
;directory=/var/lib/asterisk/mohmp3/stream/

musiconhold_custom.conf:

;application=/usr/local/bin/mpg123 -q -s --mono -r 8000 -f 8192 -b 0 http://64.236.34.97:80/stream/1074

heres the MOH part on asterisk -r....

-- Started music on hold, class 'default', on SIP/3092-091bb598
-- Started music on hold, class 'default', on SIP/3092-091bb598

thanks for all your help in advance

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Music On Hold via LINE IN on Sound Card

well u have it wrong
your default is still the default...
[default]
mode=files
directory=/var/lib/asterisk/mohmp3/
random=yes

you need to name this one default

[default2]
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/var/lib/tb-playlinein

try this use putty or at the console

mkdir /var/lib/asterisk/mohmp3/stream2
cd /var/lib/asterisk/mohmp3/
cp Q*.mp3 /var/lib/asterisk/mohmp3/stream2/stream2.mp3

now open musiconhold_custom.conf and add this...
[stream]
mode=custom
directory=/var/lib/asterisk/stream
application=/var/lib/tb-playlinein

now if you go into the MOH module in FPBX you should see the stream Category

and when you reboot you should be able to use it from the drop down menu..

Most sound cards will need to have something plugged into the MIC / LINE IN to work, MOH will die without some type of load on the card...



jades
Posts: 2340
Member Since:
2006-11-26
Re: Music On Hold via LINE IN on Sound Card

i tried that, and i tried many other possible ways
the furthest i got on asterisk -rvvvvv is where it told me music on hold is starting and than it says music on hold stopped. and under that it tells me /var...../tb-playlinein dump.
any other possibile ways?

thanks a lot

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Music On Hold via LINE IN on Sound Card

The method posted here works on any version of asterisk / freepbx I have loaded
so if it is not working for you then you need to slow down and go back over your setup.

Computers are on or off ...Black or White no gray area...



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Hmmm not sure why the tb-playlinein would be dumping. The original problem was that it would start and then quickly stop with not errors. This was all to do with file rights and permissions.

Another thing to make sure works is the sound card without the MOH. You can plug your speakers in the soundcard and then plug in your line in. play with the mixer (alsamixer) untill you get sound. If you get any errors then there may be a soundcard driver issue. If the mixer is able to adjust your volume from your line in then alsa and the rest of its components should work.

The tb-playlinein is just a exucutable that uses arecord (part of alsa). with arecord and its arguments tells it to record from the linein/mic capture port and then manipulate the stream to be Asterisk MOH compliant. You may need to troubleshoot this specific part and make sure that arecord can run.

crees



jtknapp
Posts: 108
Member Since:
2006-06-07
Re: Music On Hold via LINE IN on Sound Card

Works Awesome. Thanks.

--


mustardman
Posts: 1289
Member Since:
2006-06-18
Re: Music On Hold via LINE IN on Sound Card

Going in a completely different direction, since a lot of radio stations stream on the internet you may want consider using that. I saw a procedure on the Asterisk wiki that looked simple enough. No static at all.......FM...no static at all da dadada...da! 8-)



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Thats the beauty of Asterisk, the abilities are endless.

One advantage with MOH line in is the ability to controll the volume with alsamixer and free up you bandwidth (if your on a tight connection)

So far on my testing I have found that MOH line-in uses only one process even if there are multiple calls on hold(compared to other alternatives that spawn multiple procceses). This is what I have found with my test box (a SIP ATA and my IAX softphone). Has anyone got this running on a production machine? and if so what are your proccess stats (top command) are you only getting one "arecord" process for multiple hold calls in MOH?

TIA

crees



jtknapp
Posts: 108
Member Since:
2006-06-07
Re: Music On Hold via LINE IN on Sound Card

Streaming from the Internet is nice. But I was holding an in house event and wanted others to be able to dial in to a conference and listen to presenters throughout the day. This weekend I had a small event and tested with a few people and it worked really well. In the up coming months I plan to do a few more of these.

I am in the process of writing a little app that will allow me to control/see the conference. I know the MeetMe web app is there but I want something where I can see/manage all the conferences at once.

I am now wondering if it would be possible to have multiple MOH sources. And have different conferences hear different MOH.

--


bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Music On Hold via LINE IN on Sound Card

yes no problem.. look where I posted how to create the files / folders change the names, if your sound card has mic and line in you can use two on a single box or use sound card plus the Stock and add shoutcast / ice streams....

when you really want to be in control
look at andromeda
http://www.turnstyle.com/andromeda/docs.asp

or for you open source folks Darwin streaming server....
http://developer.apple.com/opensource/server/streaming/index.html



del951
Posts: 42
Member Since:
2006-09-13
Re: Music On Hold via LINE IN on Sound Card

I followed the instructions and when I place a caller on hold I get a overrun!!! message on the console and there is no audio.

Any ideas?

Thanks!



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Hi del951

As long as you dont see the MOH go to sopped it is still working (if you see it start and stop then there is most likley a rights/permission issue). I also get an overunn status althoe it still runs. What may be the problem is your alsa mixer may not have the line in capture selected. You have several keys to use to get this to work. your arrow keys to navigate channels and volume, your m key to mute or unmute channels ( -MM- on top of channel means muted) and you also have the space key that will select the capture channel for the arecord function that gives you play back. You will notice on the channles with the "-------" above it is a capture device for the arecord to use. For testing I would unmute everything and then turn everything up. then go and press the space key on the channels with the "-------" above them untill you get sound via MOH. WARNING - dont have your ear too close to the phone because you will most likley get blasted with music :-) Untill you adust your volume levels on the mixer. Then of course bring all of the channels down that dont effect the sound and only leave the ones up that you need so you dont pick up any noise.

Hope this helps



jtknapp
Posts: 108
Member Since:
2006-06-07
Re: Music On Hold via LINE IN on Sound Card

Thanks I will look for your link. It would be great if Digium did something like this for those of us who cant make Spring 2007 Von.

--


del951
Posts: 42
Member Since:
2006-09-13
Re: Music On Hold via LINE IN on Sound Card

Crees, you are a life saver.....I was looking at all the detailed crap and forgot to unmute the line in.....thanks!



jades
Posts: 2340
Member Since:
2006-11-26
Re: Music On Hold via LINE IN on Sound Card

hi
i have done what i can and unmuted line-in.
the furthest i got was here:

asterisk1*CLI> /var/lib/tb-playlinein: line 2: 5413 Segmentation fault (core dumped) /usr/bin/arecord -q -c 1 -r 8000 --buffer-size=2048 -f S16_LE -t raw
-- Started music on hold, class 'default', on channel 'SIP/205-09100080'
-- Started music on hold, class 'default', on channel 'SIP/205-09100080'
-- Stopped music on hold on SIP/205-09100080
-- Stopped music on hold on SIP/205-09100080

heres my current music on hold conf files:

musiconhold.conf:

;
; Music on hold class definitions
; This is using the new 1.2 config file format, and will not work with 1.0
; based Asterisk systems
;
#include musiconhold_custom.conf
#include musiconhold_additional.conf

[default2]
[default]
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/var/lib/tb-playlinein

musiconhold_additional.conf:

[default]
;mode=files
;directory=/var/lib/asterisk/mohmp3/
;random=yes
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/var/lib/tb-playlinein

musiconhold_custom.conf:
(empty)

can you please tell me what i can do?
thanks so much in advance for all your help

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



crees
Posts: 293
Member Since:
2006-08-09
Re: Music On Hold via LINE IN on Sound Card

Hi Ja133

Delete your [default2] entry in musichold.conf, and delete all the lines in your musiconhold_additional.conf (only one [default] statement is needed between the files.

Looking at your output its acting like it still has issues with security. make sure your have done the chmod stuff to the tb-playlinein and added the neccisary lines in the amportal script.

BTW if you can, do this on a test box before you do it on a production box.

Hope this helps



arbill
Posts: 1
Member Since:
2007-03-29
Re: Music On Hold via LINE IN on Sound Card

>Ok I beleive I got it figured out, If anyone would like to try this (on your non production >boxes) let me know what resutls you get.

Worked perfect first time. Thanks.
(on a junk p3 - 450 no less)
Bill



truevoice
Posts: 84
Member Since:
2006-12-25
Just dont know

Have gone over it so many times I can do it with my eyes closed, worked before on a system and is still but I just cant get it to work on this one. This is what I have any help please please

;
; Music on hold class definitions
; This is using the new 1.2 config file format, and will not work with 1.0
; based Asterisk systems
;
#include musiconhold_custom.conf
#include musiconhold_additional.conf

[default]
mode=custom
directory=/var/lib/asterisk/mohmp3
application=/var/lib/tb-playlinein

[default2]
mode=custom
directory=/var/lib/asterisk/mohmp3



del951
Posts: 42
Member Since:
2006-09-13
Anyone know how to get this

Anyone know how to get this to work on the new FreePBX (2.3.0beta) since the amportal file it refers to has changed. Thanks



Zildjian26
Posts: 239
Member Since:
2006-06-05
I don't have a freePBX beta

I don't have a freePBX beta 2.3 box running to look at, so, if you want to post what's changed maybe I can help.



jades
Posts: 2340
Member Since:
2006-11-26
i have the beta

i have the beta
just add the three lines to the end amportal.conf

dont worry

then do an amportal restart

and make sure you reput the config on the musiconhold conf files and comment out whatever is there already because a lot of conf files get back to default
let me know how it goes

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



mustardman
Posts: 1289
Member Since:
2006-06-18
So what sort of effect does

So what sort of effect does having a sound card constantly interrupting the PCI bus have on the system? Is anyone running this in a production or semi-production environment with several live calls going on at the same time?



jades
Posts: 2340
Member Since:
2006-11-26
i am running this on a

i am running this on a production environment
what interruptions are you talking about? everything works great for me and i also have multiple servers serving different ranges of extensions

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



mustardman
Posts: 1289
Member Since:
2006-06-18
A sound card streaming media

A sound card streaming audio all the time is a strain on a real time sytem that needs zero interruptions 100% of the time. If it's a newer motherboard that separates the sound function from everything else such as network and zaptel card it probably helps.



jades
Posts: 2340
Member Since:
2006-11-26
i am not using an integrated

i am not using an integrated sound card
is that what you mean by saying this? am i on the "safe" side?

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



crees
Posts: 293
Member Since:
2006-08-09
Its been a couple months

Its been a couple months since I really got into this project, but from what I recall the only time the soundcard is used is when MOH is in use and only 1 MOH proccess was running for multiple MOH cases. Using TOP I found that is was a very minimal overhead. I imagine that this is one of those "your mileage may vary" type of deals and it al depends on your Mobo and how it handels the hardware resources.

At one time the traditional MOH would spawn a proccess for each MOH session causing instability and high usage of CPU and resources. I beleive this is fixed now?



jades
Posts: 2340
Member Since:
2006-11-26
yes it looks fixed to me

yes it looks fixed to me because there are times where i use top to check the CPU usage and it does not get high

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



del951
Posts: 42
Member Since:
2006-09-13
Thanks, it worked for me. I

Thanks, it worked for me. I use the sound card so I can have all people on hold listening to the same thing at the same time, plus I have more control over MOH if I use another system connected to the line in.



jades
Posts: 2340
Member Since:
2006-11-26
anyone know how to get this

anyone know how to get this working with trixbox 2.3.0.2
it wont work for me and it worked in previous versions

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



jades
Posts: 2340
Member Since:
2006-11-26
if anyone can get this

if anyone can get this working on trixbox 2.4, please tell me. thanks

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



jades
Posts: 2340
Member Since:
2006-11-26
Bump

Bump

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



KodaK
Posts: 1885
Member Since:
2006-06-14
I'm going to be installing a

I'm going to be installing a test 2.4 system soon and I'll make this a back-burner goal. I'm not promising anything, but if I've got time I'll give it a shot and let you know.

--

WARNING: I no longer actively participate in these forums. My thoughts on trixbox in a nutshell: http://www.youtube.com/watch?v=q4xBMkWu1pE Use AsteriskNOW instead.



jades
Posts: 2340
Member Since:
2006-11-26
thanks a lot

thanks a lot

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



jades
Posts: 2340
Member Since:
2006-11-26
Nobody interested?

Nobody interested?

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



jades
Posts: 2340
Member Since:
2006-11-26
im surprised how nobody is

im surprised how nobody is interested in getting this working with trixbox 2.4

heres the CLI

Connected to Asterisk 1.4.16-1 RPM by vc-rpms@voipconsulting.nl currently running on sip (pid = 2451)
Verbosity is at least 3
-- Executing [*19@from-internal:1] NoOp("SIP/215-b7c052e8", "Running miscapp 1: z100") in new stack
-- Executing [*19@from-internal:2] Goto("SIP/215-b7c052e8", "app-blackhole|musiconhold|1") in new stack
-- Goto (app-blackhole,musiconhold,1)
-- Executing [musiconhold@app-blackhole:1] NoOp("SIP/215-b7c052e8", "Blackhole Dest: Put caller on hold forever") in new stack
-- Executing [musiconhold@app-blackhole:2] Answer("SIP/215-b7c052e8", "") in new stack
-- Executing [musiconhold@app-blackhole:3] MusicOnHold("SIP/215-b7c052e8", "") in new stack
-- Started music on hold, class 'default', on channel 'SIP/215-b7c052e8'
-- Stopped music on hold on SIP/215-b7c052e8
sip*CLI>

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



digicate
Posts: 2
Member Since:
2008-01-08
arecord Permission denied when accessing Music On Hold

Hi,

I have followed the instructions but have a small issue.

I have a Dell GX1 with a OpenVox TDM400P clone and a PCI sound card for line-in for Music On Hold.

I am still learning about trunks/routes/extensions/dial plans etc. I am testing using Zoiper softphone with SIP. When I dial my own extension, the call comes back to Zoiper. I answer the call and am put on hold. I hear silence.

On the trixbox console I see this message:
.
.
dialparties.agi: Methodolgy of ring is 'none'
arecord: main:508: audio open error: Permission denied

If I log on to the console as root and execute this command:
chmod -R a+rwX /dev/snd

then the Music On Hold works on the Zoiper softphone when I dial my own extension. I can hear the same audio signal as that being output to the headphones plugged into the back of the soundcard.

If I run this command:
amportal restart
I get the message:
chown: 'a+rwX': invalid user

My amportal looks like this:
chown asterisk /dev/tty9
chown -R root:audio /dev/snd
chmod -R a+rwX /dev/snd

I would like to be able have MOH work automatically on startup.

The goal of this project is to have a pabx with IVR that will allow people to dial into a meeting from a remote location and listen to the output from the meeting room sound system via the line input on the sound card.

Thanks,

Kim



mustardman
Posts: 1289
Member Since:
2006-06-18
So does this actually work

So does this actually work in a serious business production environment? Where is GSnover when I need him ;)



jades
Posts: 2340
Member Since:
2006-11-26
Yes! I used this for many

Yes! I used this for many clients up until 2,4 came out. Now all of a sudden nobody is interested

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



mustardman
Posts: 1289
Member Since:
2006-06-18
All of a sudden your clients

All of a sudden your clients aren't interested? How is that tied to Trixbox 2.4?



jades
Posts: 2340
Member Since:
2006-11-26
No. All of a sudden nobody

No. All of a sudden nobody on the forum is interested in this anymore with trix 2.4. It no longer works because of a permissions issue. Please someone help us getting music on hold from the sound card working in 2.4

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



mustardman
Posts: 1289
Member Since:
2006-06-18
In general when it WAS

In general when it WAS working was it robust enough for a serious business production environment? In other words 24/7/365 uptime with at least 5-10 regularly used extensions and significant incoming call volume.



jades
Posts: 2340
Member Since:
2006-11-26
worked for perfectly for me

worked for perfectly for me and cleints, 14 hours of phone calls daily, clients with 20+ phones

just sometimes after a yum update we had to reapply some code to musiconhold config files and the amportal script

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



digicate
Posts: 2
Member Since:
2008-01-08
Re: arecord Permission denied when accessing Music On Hold

Hi,

I think I have figured out my permissions issue.

I found this file:
/etc/udev/permissions.d/50-udev.permissions

* N.b. The file may be named differently on your system. "man udev" for more details

Find the section entitled "# audio devices"
I changed this line:
snd/*:root:root:0660
to:
snd/*:root:audio:0777

I also added this line:
snd:root:audio:0777
But I don't think it is doing anything. Perhaps I should have put:
snd*:root:audio:0777

This is relying on creating the audio group as described by user crees, above.

I commented out the changes to the /usr/sbin/amportal script specified by crees' tutorial.

After rebooting the server (perhaps you only need to restart the udev daemon, if there is such a thing, but I am not smart enough fo that ;) my sound card line-in was immediately accessible for Music On Hold in Asterisk.

Just to reiterate, without editing the udev.permissions, Asterisk was outputting the following error when trying to access MOH from a handset/softphone to the console:
arecord: main:508: audio open error: Permission denied

I am running TrixBox 2.2.4.

I got the hint about udev from this link (greetz tobyl!):
http://www.linuxquestions.org/questions/slackware-14/udev-dev-and...

Well, now I can get to learning about the dialplan. Woot!

If this information is helpful to you, I would appreciate your comments.

Kim Groves



jades
Posts: 2340
Member Since:
2006-11-26
Thanks. Almost there. With

Thanks. Almost there. With trix 2.4 there was no permissions.d file. There was rules.d.
So I went in and saw that snd line but there wasn't "root:root" it was totally different.
If someone can figure this out it would be great

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



peteradtel
Posts: 48
Member Since:
2007-07-23
MoH Line in broken / unwanted fullduplex on console DSP

sorry for double posting but getting desperate
(also posted in http://www.trixbox.org/forums/trixbox-forums/help/music-hold-soun...)

I had updated early this year to the newest freepbx/asterisk for trix 2.2.x

Previously i had line in music working but could not get the realtime paging to work nicely with chan_oss (really choppy sound)

after the update live paging work perfectly but no more in-line music on-hold

also if i capture my music on hold source (set alsamixer to monitor line in)
i hear the music on hold on the phone during the page.
(it's working in full duplex mode, when i only want half-duplex)

I need line in music on hold working

i need to be able to page out the sound card but NOT hear the music on the phone.

regardless of being able to hear the music i can NOT get line music on hold working

arecord seams to be capturing data (when run manually) but it *seams* that asterisk is not initiating the ast-playlinein script.



jades
Posts: 2340
Member Since:
2006-11-26
peteradtel, maybe it is all

peteradtel, maybe it is all related to this right here that the music on hold via line in doesnt work anymore

cres, have you got a chance yet to test this on trixbox 2.4?

Thanks

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



jades
Posts: 2340
Member Since:
2006-11-26
Anyone figured this out

Anyone figured this out yet?

Maybe there's a way to pick up music on hold from another system? I don't mind installing trixbox 2.0 on an old machine nod mine

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



del951
Posts: 42
Member Since:
2006-09-13
Anyone have this working

Anyone have this working yet?



peteradtel
Posts: 48
Member Since:
2007-07-23
got an idea but don't think i have the time atm

see what i want to achieve is basically this

have line in being recorded to a locally hosted streaming server
then tell asterisk to use a streaming source for moh

also required is the ability to use console paging.

any1 interested please find an easy to setup reliable streaming server :)

interested to find out if newer drivers from www.alsa-project.org
work better or if chan_alsa is any good.
spent a fair bit of time with chan_oss and got paging working ok
but line in on arecord gone freaky

think it's something to do with permissions
with arecord or /dev/snd /dev/..............
had one line in working but then couldn't page
and then vice versa

but spent too long on this and just coping with only being able to overhead page.

i find these versions of alsa so far have been most reliable and work nicely with
intel hd audio on the asus p5gc board :)
alsa-driver-1.0.12-RHEL4U4-4.05b.tar.bz2
alsa-lib-1.0.9.tar.bz2
alsa-utils-1.0.9a.tar.bz2
if u need just ask

anywayz just some ideas



jades
Posts: 2340
Member Since:
2006-11-26
anyone has this working with

anyone has this working with tb2.6?

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



chaznet
Posts: 35
Member Since:
2007-12-30
I got music on hold using

I got music on hold using the above method to work perfectly fine on Trixbox 2.0 but I couldn't get it to on 2.2. Didnt work using Line in, but it worked using the Mic port.

--

Server information:

CPU: Intel Pentium 4 X2 2.8GHz
RAM: 1.5GB
HDD: 80GB
LAN: TBA



jades
Posts: 2340
Member Since:
2006-11-26
With trixbox 2.6 it says it

With trixbox 2.6 it says it started playing MOH and a second later it says it stopped playing MOH

Thats the problem with centos 5.1

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



chaznet
Posts: 35
Member Since:
2007-12-30
Only thing thats making it

Only thing thats making it hard for me right now is that now I have Music on Hold via Mic port working, but now paging via sound card isnt. before it was opposite.

--

Server information:

CPU: Intel Pentium 4 X2 2.8GHz
RAM: 1.5GB
HDD: 80GB
LAN: TBA



chaznet
Posts: 35
Member Since:
2007-12-30
Seems I have a decision i

Seems I have a decision i need to make...

After changing permissions on the /dev/snd, paging is not usable...

Is there a way to do this without having to modify permissions on the sound card? I need paging and music on hold via line in

--

Server information:

CPU: Intel Pentium 4 X2 2.8GHz
RAM: 1.5GB
HDD: 80GB
LAN: TBA



chaznet
Posts: 35
Member Since:
2007-12-30
K so ive now figured out

K so ive now figured out where im getting teh main issues...

If I set permissions to use Line in for MOH, Paging doesn't work. if I change permissions to use paging, MOH via Line in doesn't work. Has anyone been able to get both MOH and paging via sound card to work, or should I possibly be using 2 sound cards for this? I need overhead paging, and want to use a local radio station for music on hold. can this be done?

--

Server information:

CPU: Intel Pentium 4 X2 2.8GHz
RAM: 1.5GB
HDD: 80GB
LAN: TBA



jades
Posts: 2340
Member Since:
2006-11-26
Anyone figured out MOH via

Anyone figured out MOH via Soundcard with trixbox 2.6 yet?

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.