[Home]

Summary:ASTERISK-03172: [patch] Music on hold is terminated immediately after caller is parked.
Reporter:zebble (zebble)Labels:
Date Opened:2005-01-03 12:05:46.000-0600Date Closed:2008-01-15 15:21:29.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_musiconhold
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) masq_music_rev0.diff
Description:(Originally reported in Bug ASTERISK-2262292)

How it "worked" before:



   - Caller places call to callee.

   - Callee picks up phone, flashes line, caller hears MoH, callee dials

700, both caller and callee hear MoH.

   - Callee hangs up.

   - 45 seconds later, callee gets a ringback, picks up and is

reconnected with the caller. (This didn't work of course, it was sent to

default,s,1)



   How it now works:



   - Caller places call to callee.

   - Callee picks up phone, flashes line, caller hears MoH, callee dials

700, Asterisk hangs up on callee, and caller no longer hears MoH (dead

air).

   - Callee hangs up.

   - 45 seconds later, callee gets a ringback, picks up and is

reconnecteed with the caller.  If the callee flashes the line again to

either re-park or transfer, the caller will not hear MoH anymore.



Any ideas?  The dead air can be a problem, as the caller might think

they've been hung up on.


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

CLI Output (Music on Hold stops at the "-- Added extension '701' priority 1 to parkedcalls" line):

Problem is the same with and without using a macro.


   -- Starting simple switch on 'Zap/4-1'

   -- Executing Macro("Zap/4-1", "stdexten|100|Zap/2") in new stack

   -- Executing Dial("Zap/4-1", "Zap/2|20") in new stack

   -- Called 2

   -- Zap/2-1 is ringing

   -- Zap/2-1 is ringing

   -- Zap/2-1 answered Zap/4-1

   -- Attempting native bridge of Zap/4-1 and Zap/2-1

   -- Started three way call on channel 2

   -- Started music on hold, class 'random', on Zap/4-1

   -- Attempting native bridge of Zap/4-1 and Zap/2-1

   -- Starting simple switch on 'Zap/2-2'

 == Parked Zap/4-1 on 701. Will timeout back to macro-stdexten,s,1 in 45

seconds

   -- Playing 'digits/7' (language 'en')

   -- Stopped music on hold on Parked/Zap/4-1<ZOMBIE>

   -- Hungup 'Zap/2-1'

 == Spawn extension (macro-stdexten, s, 1) exited non-zero on

'Parked/Zap/4-1<ZOMBIE>' in macro 'stdexten'

 == Spawn extension (trusted, 200, 1) exited non-zero on

'Parked/Zap/4-1<ZOMBIE>'

   -- Playing 'digits/0' (language 'en')

   -- Playing 'digits/1' (language 'en')

   -- Added extension '701' priority 1 to parkedcalls

   -- Parking call to 'Zap/2-2'

   -- Hungup 'Zap/2-2'

 == Timeout for Zap/4-1 parked on 701. Returning to macro-stdexten,s,1

   -- Executing Dial("Zap/4-1", "Zap/2|20") in new stack

   -- Called 2

   -- Zap/2-1 is ringing

   -- Zap/2-1 is ringing

   -- Hungup 'Zap/2-1'

 == Spawn extension (macro-stdexten, s, 1) exited non-zero on 'Zap/4-1'

   -- Hungup 'Zap/4-1'
Comments:By: Brian West (bkw918) 2005-01-03 12:16:34.000-0600

try naming your class default.  Let me know if the MOH works then.. if thats the case I think I know where the bug is.

bkw

By: zebble (zebble) 2005-01-03 12:25:55.000-0600

Well done bkw!  Works like a charm when I renamed "random" to "default".

By: Mark Spencer (markster) 2005-01-04 00:17:14.000-0600

Okay, bkw, so what's the bug then? :)

By: Brian West (bkw918) 2005-01-04 09:50:21.000-0600

Not sure but this code doesn't look quite right.. maybe its ok.. maybe its not.


   if (!class || ast_strlen_zero(class))
       class = chan->musicclass;
   if (!class || ast_strlen_zero(class))
       class = "default";

I have known about this problem from way before anthms moh patch made it into CVS because it drove me crazy for a few hours too but didn't have time to really track down the cause of it.

bkw

By: Kevin P. Fleming (kpfleming) 2005-01-04 10:23:40.000-0600

That code looks OK to me... it tries to get the class from the channel, and if there isn't one (or it's empty) then it uses "default".

It sounds like for some reason the channel has lost its "musicclass" setting, so I'd start looking at places that can modify that to see what might be happening.

By: Christopher L. Wade (clwade) 2005-01-06 14:12:04.000-0600

just a note, i've never been able to use any mohclass other than default and have it work for parking.  it worked for most other things like 'MusicOnHold' and actual 'hold' music, but never for parking.

and to kpfleming, yes - you are right.  I've looked at this in the past and the channel does lose its musicclass, it does so in the actual parking handler (can't remember the function name though).

finally, in my case anyway, the bug only rears its head noticably if you disable the 'default' musicclass and enable/create a different one (which you then associate in all the conf [sip/zapata/etc] files), thus leaving no 'default' class for those afforementioned lines of code to use.

clw

By: Brian West (bkw918) 2005-01-06 20:18:25.000-0600

its in the thread in res_features ...

bkw

By: Anthony Minessale (anthm) 2005-01-07 18:12:15.000-0600

Try this patch... (Disclaimer On File)

the problem is that when you park a call you are using ast_channel_masquerade which eventually causes the channel to be cloned into a new structure and it never bothers to copy the musicclass member string.  The attached patch will do this unless it's considered fundamentally wrong to implicitly do this if so then the individual implementations that use ast_channel_masquerade must perform a similar operation I chose to fix it in the core to ensure any other similar issues are fixed as well.

edited on: 01-07-05 18:12

edited on: 01-08-05 20:07

By: zebble (zebble) 2005-01-07 22:12:58.000-0600

I can confirm that anthm's patch works perfectly so far!

I tested prior to the patch, and had the MOH cutoff when parking.  Patching immediately fixed the problem.

By: Brian West (bkw918) 2005-01-07 22:50:03.000-0600

I'll add my 2 cents too.. Yes it fixes it..

By: Kevin P. Fleming (kpfleming) 2005-01-08 09:00:02.000-0600

I agree, this seems to be the correct fix.

By: twisted (twisted) 2005-01-08 14:36:39.000-0600

looks like a wiener to me.

markster?

By: Mark Spencer (markster) 2005-01-09 22:19:27.000-0600

Fixed in CVS, thanks anthm!

By: Russell Bryant (russell) 2005-01-12 22:33:24.000-0600

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:21:00.000-0600

Repository: asterisk
Revision: 4744

U   trunk/channel.c

------------------------------------------------------------------------
r4744 | markster | 2008-01-15 15:21:00 -0600 (Tue, 15 Jan 2008) | 2 lines

Handle masq properly with music (bug ASTERISK-3172)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4744

By: Digium Subversion (svnbot) 2008-01-15 15:21:29.000-0600

Repository: asterisk
Revision: 4777

U   branches/v1-0/channel.c

------------------------------------------------------------------------
r4777 | russell | 2008-01-15 15:21:28 -0600 (Tue, 15 Jan 2008) | 2 lines

copy musicclass (bug ASTERISK-3172)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4777