I have previously used something like the following to broadcast a call in my dialplan:
...
exten => s, n, Originate(SIP/Some_Phone_000@someHost,app,Playback,someFile)
...
However, I’d like to do some far more complex things before the call (primarily set caller ID) is actually shipped off, and also do some complex things (silence detection) once pick up does occurs. So instead of using Originate in app format with Playback, I’d like to do something like:
...
exten => s, n, Set(dial_args=SIP/Some_Phone_000@someHost~someFile)
exten => s, n, Originate(SIP/Some_Phone_000@someHost,exten,place-call,${dial_args},1))
...
[place-call]
exten => _., Set(target=${CUT(EXTEN,"~",1)})
exten => _., Set(_filename=${CUT(EXTEN,"~",2)})
exten => _., Set(CALLERID(name)=MyCompany)
exten => _., Set(CALLERID(num)=2025551234)
exten => _., Dial(${target},,G(call-answered,s,1))
[call-answered]
exten => s, 1, WaitForSilence(2500,,60)
exten => s, n, Playback(${filename})
exten => s, n, Hangup()
The above kind of works, with the obvious defect that Some_Phone_000 has to get picked up before place-call is executed, meaning Some_Phone_000 has to ring/be picked up before a new channel is created and passed to place-call. I really just need a mechanism to create a new channel WITHOUT the need of someone picking up first. If I can manually create a channel in this way, I can pass it to place-call. Is this possible?
EDIT: This seems really sloppy/hacky, but it’s a thought. Would it be possible to specify a pseudo device that somehow always picks up every Originate immediately? Somehow by using Pickup elsewhere in the dialplan for this specific pseudo device?
EDIT 2: Dial is not an option. The reason is that in this broadcast scenario, the original originate is occurring on Local pseudo channels. So if I replace the problem Originate with a Dial, as soon as a single callee picks up the actual channel is bridged and all other pseudo channels go away – meaning only one person could ever pick up.