Music on hold after dial macro call


We have a custom written screening script written that, upon an incoming customer call, will call the mobile number for the recipient, confirm they are available to take the call, and depending on their response either transfer the call or send it to voice mail.

The problem is that the music on hold plays for part of the caller’s call but not the whole experience.

Here’s how it works.
1 Caller calls in, enters an extension
2 Asterisk rings the recipient’s cell phone
3 The recipient answers and hear’s a message "You have a call. Press any key to accept"
4 If the recipient hits a key, the message transfers to his phone.

The specific issue is that the music on hold plays for step 2 but not step 3. Hence callers hear a disconcerting gap of 5-10 seconds while the recipient listens to the prompt.

We’ve traced the problem to this line:

exten => s,500,Dial(SIP/${ARG1}@${VOICEPULSE_GATEWAY_OUT_C}|${BACKUP_RING_TIMEOUT}|mgM(screen^${ARG1}^${ARG2}^${ARG3}))

Basically, once the recipient answers their phone, the macro “screen” is called which asks them whether they are free to take the call. While that macro is running, music on hold stops.

Any suggestions as to how I can continue to have the music playing for the original caller?

An excerpt from the extensions.conf is below.

;;;; dial outside number with Voicepulse Connect for person searching
;;;; will then screen to see if they are available
;;;;   arg1 = telephone number to dial
;;;;   arg2 = greeting for extension that was dialed
;;;;   arg3 = if it exists, this is a priority call

exten => s,1,GotoIf($["${OUTSIDECALL}" = "TRUE"]?7)
exten => s,n,Set(CALLERID(name)=Forio Business Simulations)
exten => s,n,Set(CALLERID(number)=${FORIO-NUMBER})
exten => s,n,Set(CALLERID(all)=${FORIO-NUMBER})
exten => s,n,Goto(s,10)

exten => s,7,Set(CALLERID(number)=${CALLERID(number)})
exten => s,n,Set(CALLERID(all)=${CALLERID(number)})
exten => s,n,Goto(s,10)

exten => s,10,Dial(SIP/+${ARG1}@${VOICEPULSE_GATEWAY_OUT_A}|${BACKUP_RING_TIMEOUT}|mgM(screen^${ARG1}^${ARG2}^${ARG3}))
exten => s,n,GotoIf($[${DIALSTATUS}=CHANUNAVAIL]?${ARG1}|200)
exten => s,200,Dial(SIP/+${ARG1}@${VOICEPULSE_GATEWAY_OUT_B}|${BACKUP_RING_TIMEOUT}|mgM(screen^${ARG1}^${ARG2}^${ARG3}))
exten => s,n,GotoIf($[${DIALSTATUS}=CHANUNAVAIL]?${ARG1}|500)
exten => s,500,Dial(SIP/${ARG1}@${VOICEPULSE_GATEWAY_OUT_C}|${BACKUP_RING_TIMEOUT}|mgM(screen^${ARG1}^${ARG2}^${ARG3}))

;;;; macro initiated when screening call is connected.
;;;; checks to see if person is available.
;;;;   arg1 = telephone number being called
;;;;   arg2 = greeting for extension that was dialed
;;;;   arg3 = if it exists, this is a priority call

exten => s,1,Wait(0.2)
exten => s,n,Set(CALL_ACCEPTED_${ARG1}=FALSE|g)
exten => s,n,Read(ACCEPT|custom/custom-you-have-a-call-for|1||1|1)
exten => s,n,GotoIf(${ISNULL(${ACCEPT})}?10:500)

; priority support?
;exten => s,10,GotoIf($[${ARG3} = "TRUE"]?15:20)
exten => s,10,GotoIf(${ARG3}?15:20)

exten => s,15,Read(ACCEPT|custom/priority-technical-support|1||1|1)
exten => s,n,GotoIf(${ISNULL(${ACCEPT})}?17:500)

exten => s,17,Read(ACCEPT|custom/for|1||1|1)
exten => s,n,GotoIf(${ISNULL(${ACCEPT})}?20:500)

exten => s,20,Read(ACCEPT|${ARG2}|1||1|1)
exten => s,n,GotoIf(${ISNULL(${ACCEPT})}?30:500)

exten => s,30,Read(ACCEPT|custom/custom-press-any-key|1||1|3)
exten => s,n,GotoIf(${ISNULL(${ACCEPT})} ?100:500)
exten => s,100,Set(MACRO_RESULT=CONTINUE)
exten => s,n,Set(CALL_ACCEPTED_${ARG1}=FALSE|g)

exten => s,500,Set(CALL_ACCEPTED_${ARG1}=TRUE|g)