Question about parallel calling to different endpoints.
If bob cancel incoming call, then alice phone still ringing. How can I make that the call to Alice also end, if the bob has canceled the call?
same => n,Dial(PJSIP/alice&PJSIP/bob,)
or
same => n,Dial(PJSIP/alice&PJSIP/bob&PJSIP/sten,)
If sten decline/cancel incoming call, then alice and bob phones stop ringing.
Maybe possible add some new Dial() flag, which allow to parallel calling to different endpoints and this different endpoints work as one endpont?
Bob cannot cancel the call, as they are a UAS in this context. In principle, for the PABX to cancel the call to Alice, Bob must use a 6xx series SIP response code, rather than a 4xx response code, to reject the call. 4xx response codes say the condition exists “here”, whereas 6xx codes indicate that it exists everywhere.
Unfortunately, Asterisk is based on ISDN, not SIP, and ISDN doesn’t have the here/everywhere distinction. Whilst I may have missed some recent tweak to allow for your use case, I’m fairly sure that Asterisk doesn’t support it.
You could get round it by using local channels, which hung up the upstream caller, in their hangup processing, but that would probably mean that the Alice would not get “answered elsewhere”, if Bob answered, but rather a more generic clearing cause.
If you hang up the incoming channel, the outgoing calls will be abandoned.
If you can’t do it more directly, you can use channel redirect to send the incoming channel to dialplan that hangs it up. Actually the channel redirect will be enough to abort the Dial operation.
Thank you so much for your support!
It works, my current Dialplan is
[some_context]
same => n,Set(_INCOMING_CHANNEL=${CHANNEL})
same => n,Dial(LOCAL/alice@context&LOCAL/bob@context&LOCAL/sten@context)
[context]
same => n,Dial(PJSIP/{EXTEN}@trunk,60,r)
same => n,NoOp({DIALSTATUS})
same => n,GoToIf(["{DIALSTATUS}" = “BUSY”]?killchan)
;same => n,(killchan),SoftHangup(${INCOMING_CHANNEL},a)
same => n,(killchan),Set(STOP={SHELL(asterisk -rx 'channel request hangup {INCOMING_CHANNEL}’)})