[Home]

Summary:ASTERISK-03487: [patch] Remote MOH
Reporter:Anthony Minessale (anthm)Labels:
Date Opened:2005-02-11 12:15:34.000-0600Date Closed:2011-06-07 14:05:01
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_musiconhold
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) moh_relay_rev0.diff
Description:This is an experiment I tried to prove an idea that you could use a voip connection as a way to patch MOH into a caller.  I'm not so sure it's the very best approach but this is what I've got.

You can define a remote channel and a requested codec to dial up and get music on a main music box.

[moh_relay]
default => IAX2/moh@musicbox/1234,ulaw
default_sip => SIP/musicbox/1234,ulaw

When you put a call on hold it will open up a channel to that desination and deliver the audio so it only makes sense to call to an extension that plays music unless you are cruel you could randomly call a payphone or something so the holder can hear them saying "hello?! hello?!"




****** ADDITIONAL INFORMATION ******

Disclaimer on file.

This patch is mega experimental and may cause certian side effects including nausea, vommiting and dizzyness.  Some cases were fatal.
Comments:By: Mark Spencer (markster) 2005-02-11 17:23:00.000-0600

diff -u :)

By: Kevin P. Fleming (kpfleming) 2005-02-11 19:13:03.000-0600

(Tony, add "diff -u" to your .cvsrc and you won't have to remember to generate the proper diff format <G>)

I like this idea a lot, I've thought about it before, it would allow you to easily centralize MOH if you have high-CPU-consumption MOH (like Shoutcast streams or something similar). The only real concern I have is the rapid creation/destruction of channels when MOH is started/stopped frequently (like for callers waiting in queues and getting position announcements).

Here's a bizarre thought: how about if the moh_relay actually started up a conference bridge (just one channel to the remote MOH source), and callers being placed into that MOH class were just joined/dropped from the bridge?

By: Anthony Minessale (anthm) 2005-02-12 11:13:02.000-0600

DoH! , Thx.

The other idea i had was a seperate app that was a command line IAX client that could connect to a remote server and spit raw slin to stdout then you could use the custom thing and the pipe in place of rawplayer.

By: Kevin P. Fleming (kpfleming) 2005-02-12 11:28:16.000-0600

Yeah, that's a nifty idea too.

By: Olle Johansson (oej) 2005-02-12 16:30:41.000-0600

Why a device, why not an extension? :-)

Feeling dizzy...

By: florian (florian) 2005-02-21 09:25:06.000-0600

can you say chan_local ?

By: Anthony Minessale (anthm) 2005-02-21 12:23:22.000-0600

ch... ch... chhaan chan_local! yep, why'd ya ask?

By: florian (florian) 2005-02-21 12:57:23.000-0600

As a response to oej, chan_local is the way to do this with extensions. I am sure oej is already aware of this, but since he was asking an (obvious?) question I figured I might as well supply an (obvious?) answer :-)

By: Anthony Minessale (anthm) 2005-02-21 13:26:32.000-0600

ahh I see! I was kinda tilting my head at that trying to figure out what you meant.

By: Kevin P. Fleming (kpfleming) 2005-03-03 16:44:04.000-0600

No response from Mark... but I think this looks OK and would be useful.

By: Mark Spencer (markster) 2005-03-03 18:47:25.000-0600

Having the separate app probably makes more sense.

By: Brian West (bkw918) 2005-03-17 20:56:13.000-0600

Will reopen if someone really wants this.

/b

By: Terry Wilson (twilson) 2005-03-25 15:28:57.000-0600

I really want it-so I guess I will reopen it.  If you ever want to set it up so you have multiple orgs sharing a box (I mean a lot of orgs) and they each want to be able to supply their own music on hold, you don't want to have to have each of the boxes in your organization playing 50 mp3s simultaneously while handling all the call routing, etc.  Having dedicated remote music on hold boxes would make this type of situation much easier to deal with.

Once you scale past a certain point, it having a asterisk boxes set aside for various tasks (MOH, Voicemail, Call routing, etc.) makes a lot of sense.

By: Mark Spencer (markster) 2005-03-26 01:37:34.000-0600

But wouldn't it make more sense to use native music on hold?  Maybe we can get zoa to tell us whether this is more efficient or if it is more efficient to just use native methods.

By: Terry Wilson (twilson) 2005-03-26 02:36:56.000-0600

Maybe I don't understand exactly what this is doing, but I assumed that it would only connect to the remote moh when a call was actually placed on hold.  That way you wouldn't have to continually play the moh on the dialplan box and could farm it out to one or more other boxes as opposed to having 50+ sound files all playing in the background on one machine.  Was this incorrect?

By: Anthony Minessale (anthm) 2005-03-26 10:08:12.000-0600

That's right when moh starts it makes a call to the specific extension.

By: Clod Patry (junky) 2005-05-07 19:32:35

When im trying to use it, i've remark that if the specified adress is bad, we're going in an loop until we stop the MOH:
   -- Started music on hold, class 'default', on SIP/10-4a81
May  7 20:15:55 DEBUG[14134]: channel.c:1243 ast_settimeout: Scheduling timer at 160 sample intervals
May  7 20:15:55 DEBUG[14147]: channel.c:1505 ast_read: Generator got voice, switching to phase locked mode
May  7 20:15:55 DEBUG[14147]: channel.c:1243 ast_settimeout: Scheduling timer at 0 sample intervals
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 DEBUG[14134]: chan_sip.c:1014 __sip_ack: Stopping retransmission on '599D8B16-4709-4EB4-A7BE-9709B18B4FDD@192.168.123.100' of Response 50966: Found
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:55 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
May  7 20:15:56 NOTICE[14147]: chan_iax2.c:3012 iax2_read: I should never be called!
   -- Stopped music on hold on SIP/10-4a81
May  7 20:15:56 DEBUG[14134]: chan_iax2.c:2971 iax2_hangup: We're hanging up IAX2/65.39.228.10:4569-2 now...
   -- Hungup 'IAX2/65.39.228.10:4569-2'

Do you think we can get like: Remote MOH server is invalid or something like that?

I'd like to see that nice feature too, could be really useful.

By: zoa (zoa) 2005-05-08 11:39:16

i dont see a big gain in cpu power, i think the native moh with audio files stored in memory would be better.

But it would be great for people using a cluster of dumb asterisk machines, this way they dont have to play the music from an nfs or other network share, or synchronize their moh files over all the harddisks.

Premixing the audio files to 1 big file might save up just a little more, but probably not enough to actually do it :)

If you want to play shoutcast streams or mp3 files from some website or so, this iax2 dialing would centralize the cpu load.

Dunno what the ulaw param is used for (didnt look at the patches) but it sounds like a good idea to maybe have the codec (between the asterisk server and the server or client provoding the moh) to be set to the codec of the call on the local machine where you want to play the moh. (which will most likely be on the same lan).

It would be great to get around playing mp3 files with mpg123 too. (we dont care if the media server sometimes crashes).

By: Olle Johansson (oej) 2005-06-05 17:22:01

So where are we with this patch?

To me, it sounds like the agreement is that this is a useful tool.
Does it need some more touches or is it ready for cvs?
Does it apply cleanly to current cvs head?

/Housekeeping

By: Anthony Minessale (anthm) 2005-06-06 08:39:12

re: zoa

How bout this for your in-memory solution?

mkdir /moh and add this line to fstab:
none /moh tmpfs defaults 0 0

Now, /moh is a ramdisk use that with native moh and there ya go.

By: Clod Patry (junky) 2005-06-23 23:01:10

anthm: could you make something for my last note?
In case of invalid server, we're getting in an ugly loop, maybe we could prevent that loop by a clear and explicit message.

By: Michael Jerris (mikej) 2005-07-12 18:00:20

Closing... no consensus on this one but certainly can't go in with the issue junky brought up... I liked this one :(