Do the additional calls get to Asterisk? If the answer is no, then there’s nothing you can do in Asterisk. It’s upstream and would be something they would have to do instead.
CALLER 1
- Executing [00*****@router:1] GotoIf("PJSIP/CALLER1-00000003", "1?incoming_00*****,00*****,1") in new stack
-- Goto (incoming_00*****,00*****,1)
Executing [00*****@incoming_00*****:1] Stasis("PJSIP/CALLER1-00000003", "externalMedia2") in new stack
and
CALLER 2
- Executing [00*****@router:1] GotoIf("PJSIP/CALLER2-00000004", "1?incoming_00*****,00*****,1") in new stack
-- Goto (incoming_00*****,00*****,1)
Executing [00*****@incoming_00*****:1] Stasis("PJSIP/CALLER2-00000004", "externalMedia2") in new stack
- Executing [00*****@router:1] GotoIf("PJSIP/CALLER2-00000005", "1?incoming_00*****,00*****,1") in new stack
- Executing [00*****@incoming_00*****:1] Stasis("PJSIP/CALLER1-00000005", "externalMedia2") in new stack
-- Goto (incoming_00*****,00*****,1)
- Executing [00*****@router:1] GotoIf("PJSIP/CALLER2-00000006", "1?incoming_00*****,00*****,1") in new stack
-- Goto (incoming_00*****,00*****,1)
Executing [00*****@incoming_00*****:1] Stasis("PJSIP/CALLER1-00000006", "externalMedia2") in new stack
Thanks!
My ARI application is connected to AI so I want that the first CALLER goes into the application to use the AI and that the second CALLER (to the same phone number) goes on a queue to wait the end of the first conversation (and to wait, I want to play a music to the CALLER using a queue for the N CALLERS)
What does this mean? Your logs appear to show the SIP number handling multiple calls at the same time. It looks like you problem is that the ARI application hasn’t been structured as an event driven application.
Your options are:
don’t serialise within the stasis application, and handle multiple calls simultaneously.
implement queue logic within the stasis application.
make the stasis application manipulate a pseudo device state, or do that in standard and return busy in the case of races, and using Queue(), with the application on a local channel.
as the previous, except all the state handling is done in normal dialplan, before calling stasis.