[Asterisk-Users] Music On Hold - not working for me... (FIXED)

avizion asterisk-users at relay.dk
Thu Jul 29 01:32:51 MST 2004


Hi Eric,

Thanks a bunch for your reply. It certainly pointed me in the right direction!

After a few mins. of investigation I thought it was the -g option, but I was
wrong. Then I was blaming the -c option... also wrong.

Changing my safe_asterisk to have CONSOLE=no instead of CONSOLE=yes actually did
make everything work. Before and after this I tried starting asterisk
"manually" with -vvv, -vvvd, -vvvgd, -vvvvvd, etc. :)

All of these also worked fine! So it really made my wonder... but doing the
following (reformatted) made me realise something else:

# diff -u /usr/src/asterisk/contrib/scripts/safe_asterisk
/usr/sbin/safe_asterisk
--- /usr/src/asterisk/contrib/scripts/safe_asterisk 2004-03-12 21:20:36 +0100
+++ /usr/sbin/safe_asterisk 2004-07-29 10:15:05 +0200
@@ -1,6 +1,6 @@
 #!/bin/sh
 TTY=9                  # TTY (if you want one) for Asterisk to run on
-CONSOLE=yes            # Whether or not you want a console
+CONSOLE=no             # Whether or not you want a console
 #NOTIFY=ben at alkaloid.net       # Who to notify about crashes
 DUMPDROP=/tmp
 #
@@ -64,18 +64,13 @@
  mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
  fi
  else
- if [ "${EXITSTATUS}" = "0" ]; then
-  echo "Asterisk ended normally.  Aborting."
-  exit 0
- else
-  echo "Asterisk died with code $EXITSTATUS."
-  if [ -f /tmp/core ]; then
-   mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
-  fi
+  echo "Asterisk died with code $EXITSTATUS.  Aborting."
+  if [ -f /tmp/core ]; then
+   mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
   fi
+  exit 0
  fi
  echo "Automatically restarting Asterisk."
- sleep 1
  done
 }

It seems that the script /usr/sbin/safe_asterisk is never replaced when you
"make install" in asterisk. While it's nice that your own hacks are preserved,
I think it would be a lot nicer to have a warning if that file was updated
since your last install - and it could simply backup your existing
safe_asterisk and replace it with the updated version.

I did not actually find out the real reason why that safe_asterisk script did
not work in the first place. Maybe someone more experienced can answer that
better.

Solution: replacing the safe_asterisk with whatever HEAD version I had
downloaded last made "everything" (about MOH) work.

Or: Simply run asterisk manually and/or with your own "safe" wrapper.

Best regards

- avizion

Quoting "Hall, Eric M." <ehall at amaxx.com>:
> Have you tried to run * in debug mode? I have the same problem and I
> found that if I run * in debug (asterisk -vvvvvgcd) mode MOH works. I
> have no idea why but that is the only way I can get MOH to work for me.
>
> Good luck and please report back to the list if you find a fix!
>
> -----Original Message-----
> I'm trying to make some simple MOH (Music On Hold) working. So far I've
> failed miserably - so I turn here for help.
>
> Basically I've been using the wiki and all the sample confs I could from
> there and via google.
SNIP!
--
avizion on irc.freenode.org #asterisk



More information about the asterisk-users mailing list