When transfer the call with applicationmap that included the GoSub to IVR extension that has queue, only the Transferer agent and the Caller hear audio but the Transfered agent cannot hear any audio

The dialplan works like when the customer is called to the number the then the IVR swedish-ivr is played and wait for dtmf 123 if user pressed any of that the call is transfer to Queue(queue-swedish) and the customer talk with the agents and then the agent transfer to the next extension(IVR) of associated feature keymap then the ivr will play and Will ring to the Agent for example queue(queue-lf) then the queue-lf agent answer the call and the whole process done.But i did use Return().Is it related with the Queue()?Saying

[2025-02-18 06:18:01] WARNING[932940][C-0000005a]: app_stack.c:1079 gosub_run: PJSIP/1004-000000f9 Abnormal 'Gosub(lf-ivr,s,1)' exit.  Popping routine return locations.

when it’s reached to the Queue() statement.

here is the dialplan

root@mail /e/asterisk# cat custom/swedish.conf
[swedish-inbound]
; Incoming call from Swedish number +46108085275
exten => _X.,1,Noop(Incoming call from Swedish number)
same => n,Set(__DYNAMIC_FEATURES=lf-ivr#seb-ivr#skandia-ivr#swe-ivr)
same => n,Set(CALLERID(name)=SwedishCaller)  ; Set the caller name to indicate it's a Swedish call
same => n,Background(ivr-swedish)  ; Play Swedish IVR greeting
same => n,WaitExten(10)  ; Wait for input

; Option 1: Agent presses 1 to transfer to Seb IVR
exten => 1,1,Noop(Agent transferring to Seb IVR)
same => n,Queue(queue-swedish,tT)

; Option 2: Agent presses 2 to transfer to LF IVR
exten => 2,1,Noop(Agent transferring to LF IVR)
same => n,Queue(queue-swedish,tT)

; Option 3: Agent presses 3 to transfer to SWE IVR
exten => 3,1,Noop(Agent transferring to SWE IVR)
same => n,Queue(queue-swedish,tT)



; Option 4: Agent presses 4 to transfer to Skandia IVR
exten => 4,1,NoOp(Agent transferring to Skandia IVR)
same => n,Queue(queue-swedish,tT)

; Invalid input handler
exten => i,1,NoOp(Invalid input, retrying)
same => n,Playback(vm-invalid)  ; Invalid input message
same => n,WaitExten(10)  ; Wait for another input



[seb-ivr]
exten => s,1,NoOp(Handling IVR for seb-ivr with queue seb-ivr)
same => n,Answer()
same => n,Playback(seb-ivr)
same => n,Read(digit,,1)
same => n,ExecIf($["${digit}"="1"]?Queue(queue-seb))
same => n,ExecIf($["${digit}"="2"]?Queue(queue-seb))
same => n,ExecIf($["${digit}"="3"]?Queue(queue-seb))
same => n,Playback(vm-invalid)
same => n,Return()

[lf-ivr]
exten => s,1,NoOp(Handling IVR for lf-ivr with queue queue-lf)
same => n,Answer()
same => n,Playback(lf-ivr)
same => n,Read(digit,,1)
same => n,ExecIf($["${digit}"="1"]?Queue(queue-lf))
same => n,ExecIf($["${digit}"="2"]?Queue(queue-lf))
same => n,ExecIf($["${digit}"="3"]?Queue(queue-lf))
same => n,Playback(vm-invalid)
same => n,Return()

[swe-ivr]
exten => s,1,NoOp(Handling IVR for swe-ivr with queue queue-swe)
same => n,Answer()
same => n,Playback(swe-ivr)
same => n,Read(digit,,1)
same => n,ExecIf($["${digit}"="1"]?Queue(queue-swe))
same => n,ExecIf($["${digit}"="2"]?Queue(queue-swe))
same => n,ExecIf($["${digit}"="3"]?Queue(queue-swe))
same => n,Playback(vm-invalid)
same => n,Return()

[skandia-ivr]
exten => s,1,NoOp(Handling IVR for skandia-ivr with queue queue-skandia)
same => n,Answer()
same => n,Playback(skandia-ivr)
same => n,Read(digit,,1)
same => n,ExecIf($["${digit}"="1"]?Queue(queue-skandia))
same => n,ExecIf($["${digit}"="2"]?Queue(queue-skandia))
same => n,ExecIf($["${digit}"="3"]?Queue(queue-skandia))
same => n,Playback(vm-invalid)
same => n,Return()

Logs

    -- Called PJSIP/1005
    -- PJSIP/1005-000000fb is ringing
       > 0x7cafd02e6770 -- Strict RTP learning after remote address set to: 204.157.172.59:13884
    -- PJSIP/1005-000000fb answered PJSIP/1004-000000f9
    -- Stopped music on hold on PJSIP/1004-000000f9
    -- Channel PJSIP/1005-000000fb joined 'simple_bridge' basic-bridge <314e3f4d-3a0a-4a8b-bd0e-c17bb8223d55>
    -- Channel PJSIP/1004-000000f9 joined 'simple_bridge' basic-bridge <314e3f4d-3a0a-4a8b-bd0e-c17bb8223d55>
       > 0x7cafd02e6770 -- Strict RTP qualifying stream type: audio
       > 0x7cafd02e6770 -- Strict RTP switching source address to 204.157.172.59:13807
    -- PJSIP/1004-000000f9 Internal Gosub(lf-ivr,s,1) start
    -- Executing [s@lf-ivr:1] NoOp("PJSIP/1004-000000f9", "Handling IVR for lf-ivr with queue queue-lf") in new stack
    -- Executing [s@lf-ivr:2] Answer("PJSIP/1004-000000f9", "") in new stack
    -- Executing [s@lf-ivr:3] Playback("PJSIP/1004-000000f9", "lf-ivr") in new stack
    -- <PJSIP/1004-000000f9> Playing 'lf-ivr.slin' (language 'en')
       > 0x7cafd02e6770 -- Strict RTP learning complete - Locking on source address 204.157.172.59:13807
    -- Executing [s@lf-ivr:4] Read("PJSIP/1004-000000f9", "digit,,1") in new stack
    -- Accepting a maximum of 1 digits.
    -- User entered '1'
    -- Executing [s@lf-ivr:5] ExecIf("PJSIP/1004-000000f9", "1?Queue(queue-lf)") in new stack
    -- Started music on hold, class 'ireland_hold', on channel 'PJSIP/1004-000000f9'
    -- Called PJSIP/1007
    -- PJSIP/1007-000000fc is ringing
    -- PJSIP/1007-000000fc is ringing
       > 0x7cb03c0b8560 -- Strict RTP learning after remote address set to: 43.242.135.210:10200
       > 0x7cb03c0b8560 -- Strict RTP switching to RTP target address 43.242.135.210:10200 as source
    -- PJSIP/1007-000000fc answered PJSIP/1004-000000f9
    -- Stopped music on hold on PJSIP/1004-000000f9
    -- Channel PJSIP/1007-000000fc joined 'simple_bridge' basic-bridge <8f937ba2-9baa-48f2-bb09-6ef3f7772a33>
  == Spawn extension (lf-ivr, s, 5) exited non-zero on 'PJSIP/1004-000000f9'
[2025-02-18 06:18:01] WARNING[932940][C-0000005a]: app_stack.c:1079 gosub_run: PJSIP/1004-000000f9 Abnormal 'Gosub(lf-ivr,s,1)' exit.  Popping routine return locations.
       > 0x7cb03c0b8560 -- Strict RTP learning complete - Locking on source address 43.242.135.210:10200
mail*CLI> core show channels
Channel                                                          Location                         State   Application(Data)             
PJSIP/1005-000000fb                                              1@swedish-inbound:1              Up      AppQueue((Outgoing Line))     
PJSIP/1004-000000f9                                              s@lf-ivr:5                       Up      Queue(queue-lf)               
PJSIP/1007-000000fc                                              s@swedish-inbound:1              Up      AppQueue((Outgoing Line))     
3 active channels
1 active call
110 calls processed

[applicationmap]
seb-ivr => *1,callee,Gosub(seb-ivr,s,1)
lf-ivr => *2,callee,Gosub(lf-ivr,s,1)
swe-ivr => *3,callee,Gosub(swe-ivr,s,1)
skandia-ivr => *4,callee,Gosub(skandia-ivr,s,1)

Application maps are for short things to do while in the bridge. Going to an IVR, and then another queue is outside the scope of it and may or may not work (most likely won’t). I don’t have a suggestion on how to do this.

1 Like

Thank you.I try to fix it by using extensions i try with the Blind Transfer and Enter the extension number to be routed

exten => 1111,1,NoOp(Going to SEB IVR)
same => n,Goto(seb-ivr,s,1)

exten => 1113,1,NoOp(Going to Another Queue)
same => n,Goto(sew-ivr,s,1)

exten => 1112,1,NoOp(Going to Another Queue)
same => n,Goto(lf-ivr,s,1)

exten => 1114,1,NoOp(Going to Another Queue)
same => n,Goto(skandia-ivr,s,1)

Thank you for replying