I was thinking about this, and one of the things that the masquerade code currently does is to determine if the original channel in a masquerade has a "visible indication" on it. A visible indication is something that is indicated by a control frame and which the user of the channel can actually tell is being indicated. For instance, if an AST_CONTROL_RINGING frame is indicated to a channel, the user can hear ringing. It is a visible indication. If the ringing channel is going to be part of a masquerade, the masquerade detects that the party has a visible indication of AST_CONTROL_RINGING on it. After performing all of the rest of the masquerade operation, any visible indication is then re-indicated to the masqueraded channel. So in the AST_CONTROL_RINGING case, the control frame is re-indicated to the channel after the masquerade so that the channel will still hear ringing. Since masquerades already have code in them to attempt to detect user-perceivable state on the channel, I think you should essentially do option 2, but do it in the masquerade code instead of in channel drivers. Here's a summary of my idea for how to do this: 1) Around the same area where the visible indication on the original is checked, set a variable if AST_FLAG_MOH is set on original. 2) Around the same area where the visible indication is re-indicated on the original, if the variable you created for AST_FLAG_MOH is set, then call ast_moh_start() on original to get music playing on the channel again. The advantage to doing it in the masquerade code is that it will work for situations other than attended transfers (e.g. AMI redirects) and you won't have to put the same code in multiple places. Since masquerade code already has a blueprint for how to do this sort of thing, there shouldn't be much risk in expanding on it. |
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev

