Thanks for the tip. So if I have a simple setup like below in which I try to use Local in a Dial command to start parallel work:
[broadcast]
;***
; NOTES
; This receives a tilde delimited list of broadcast targets and
; the path of a sound file. Each target is then called and
; Playback is used to play a selected message (${target})
;***
exten => s, 1, NoOp(=-=-=- ${EXTEN}@${CONTEXT} -=-=-=)
exten => s, n, Set(i=0)
exten => s, n, Set(_file=${soundfilepath})
exten => s, n, While($[${i} < ${targetcount}])
exten => s, n, Set(i=$[${i}+1])
exten => s, n, Set(_target=${CUT(targets,"~",${i})})
exten => s, n, Dial(Local/s@call-target,,)
exten => s, n, EndWhile
exten => s, n, Hangup()
[call-target]
exten => s, 1, NoOp(=-=-=- ${EXTEN}@${CONTEXT} -=-=-=)
exten => s, n, Originate(${target},app,Playback,${file})
exten => s, n, Hangup()
In my scenario the entry point is broadcast, and soundfileath="/some/path/to/a/soundfile.WAV" and targets=“SIP/Some_Ext_000@someVoipHost~SIP/8665551234@toPstn”. So this setup does work, in that both parties are called and the correct sound file is played upon pick up.
The problem is that it is still blocking at s@call-target:2. The second party’s device does not start ringing until Some_Ext_000 picks up. I understand Originate is necessarily blocking, but I thought that by use Dial(Local/ …) I had invoked call-target on a new, parallel channel. I’m sure it’s terribly obvious but what am I missing?
Thanks.