Originate cmd: app format vs. context/ext/priority format

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.

Use a local channel. However, I would suggest dialing the destination in the local channel, rather than having one that answers then goes to sleep.

Thanks David. Like below? I’ve tried making the first arg to the initial originate previously, but I always received “No such extension Some_Phone_000@myhost while calling local channel …Unable to call channel Local/Some_Phone_000@myhost” errors.

 ...
  exten => s, n, Set(dial_args=SIP/Some_Phone_000@someHost~someFile)
  exten => s, n, Originate(Local/Some_Phone_000@myhost>,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()

Local doesn’t know anything about sip users and domain names. Think extensions and contexts.

Thanks David. In case anyone else has this problem, when Originating into a context using a Local channel, you can’t use “SIP/” or “@” inside anything to the left of “Local/” or you will get errors.

Therefore I had to do something like:

  exten => s, n, Originate(Local/Some_User_000~someHost@place-call,exten,place-call,,1)

Then inside of place-call I manually assembled a SIP call target by just concatting “SIP/” and CUT(exten,"~",1) and CUT(exten,"~",2).