Hangup in case of bridged channels (via AMI)

Hi!

When I bridge 2 channels using the AMI action bridge everything works fine, except that if one peer of the bridged call hangs up the dialplan is restarted for the opposite peer.

Dialplan:

exten => _30XX,1,Verbose("Here we go ...");
 same => 2,Dial(PJSIP/${EXTEN},,tTge)
 same => 3,Verbose("Here we go again ...");
 same => 4,Hangup()

Extension 3030 calls 3040 first and afterwards 3050, then the call is bridged using AMI action bridge (verbose output):

    -- Channel PJSIP/3040-0000002a left 'simple_bridge' basic-bridge <1b3d48b8-80a7-4b7e-99c6-f50c00a7a24b>
    -- Channel PJSIP/3050-0000002c left 'simple_bridge' basic-bridge <1b3d48b8-80a7-4b7e-99c6-f50c00a7a24b>
  == Starting PJSIP/3050-0000002c at default,,1 failed so falling back to exten 's'
    -- Channel 'PJSIP/3050-0000002c' sent to invalid extension: context,exten,priority=default,s,1
    -- Executing [i@default:1] Playback("PJSIP/3050-0000002c", "invalid") in new stack
    -- <PJSIP/3050-0000002c> Playing 'invalid.slin' (language 'en')
    -- Auto fallthrough, channel 'PJSIP/3050-0000002c' status is 'UNKNOWN'
    -- Executing [h@default:1] Verbose("PJSIP/3050-0000002c", ""Hangup!!!!"") in new stack
Hangup!!!!

Any hints how to supress this unexpected dialplan behaviour?

Thanks
// FischC

It looks like the Dial options g and e are to blame. You are using the bridge action to interfere with the functioning of those Dial options.

Thanks for you answer,but I’ve tried without options e,g,e&g, etc. but this doesn’t make a difference.

I did some additional testing:
*) Bridge 2 incoming SIP calls (3040->3030, 3050->3030) - OK
*) Bridge 1 incoming and 1 outgoing SIP call (3040->3030, 3030->3050) - OK
*) Bridge 2 outgoing SIP calls (3030->3040, 3030->3050) - NOK. In this case, if the last channel has
left the simple bridge, the dialplan ist restarted. Any clues why this is happening and/or hints how to further debug this issue?

In the meantime I’ve implemented the following (dialplan) workaround :

exten => s,1,NoOP()
 same => n,GotoIf($[ ${HANGUPCAUSE} = 16 ]?Done)
 same => n,NoOP()
 same => n(Done),Verbose("${CALLERID(num)} hung up, do not restart dialplan! ")

Debug:

    -- Channel PJSIP/3050-00000216 joined 'simple_bridge' basic-bridge <6ccafe5b-b991-419e-b131-2949e0481966>
    -- Channel PJSIP/3030-00000215 joined 'simple_bridge' basic-bridge <6ccafe5b-b991-419e-b131-2949e0481966>
    -- Channel PJSIP/3040-00000212 left 'simple_bridge' basic-bridge <a3bd3686-7a38-4998-a3b0-1c92d4f2ad33>
    -- Channel PJSIP/3040-00000212 joined 'simple_bridge' basic-bridge <22d83754-b36d-42c0-bc3c-3a26cb9ffe9f>
    -- Channel PJSIP/3050-00000216 left 'simple_bridge' basic-bridge <6ccafe5b-b991-419e-b131-2949e0481966>
    -- Channel PJSIP/3030-00000211 left 'simple_bridge' basic-bridge <a3bd3686-7a38-4998-a3b0-1c92d4f2ad33>
    -- Channel PJSIP/3050-00000216 joined 'simple_bridge' basic-bridge <22d83754-b36d-42c0-bc3c-3a26cb9ffe9f>
  == Spawn extension (default, 3040, 2) exited non-zero on 'PJSIP/3030-00000211'
    -- Executing [h@default:1] Verbose("PJSIP/3030-00000211", ""Hangup!!!!"") in new stack
Hangup!!!!
    -- Channel PJSIP/3030-00000215 left 'simple_bridge' basic-bridge <6ccafe5b-b991-419e-b131-2949e0481966>
  == Spawn extension (default, 3050, 2) exited non-zero on 'PJSIP/3030-00000215'
    -- Executing [h@default:1] Verbose("PJSIP/3030-00000215", ""Hangup!!!!"") in new stack
Hangup!!!!
    -- <PJSIP/3040-00000212> Playing 'beep.slin' (language 'en')
    -- <PJSIP/3050-00000216> Playing 'beep.slin' (language 'en')
    -- Channel PJSIP/3050-00000216 left 'simple_bridge' basic-bridge <22d83754-b36d-42c0-bc3c-3a26cb9ffe9f>
    -- Channel PJSIP/3040-00000212 left 'simple_bridge' basic-bridge <22d83754-b36d-42c0-bc3c-3a26cb9ffe9f>
  == Starting PJSIP/3040-00000212 at default,,1 failed so falling back to exten 's'
    -- Executing [s@default:1] NoOp("PJSIP/3040-00000212", "") in new stack
    -- Executing [s@default:2] GotoIf("PJSIP/3040-00000212", "1?Done") in new stack
    -- Goto (default,s,4)
    -- Executing [s@default:4] Verbose("PJSIP/3040-00000212", ""3040 hung up, do not restart dialplan! "") in new stack
3040 hung up, do not restart dialplan! 
    -- Auto fallthrough, channel 'PJSIP/3040-00000212' status is 'UNKNOWN'
    -- Executing [h@default:1] Verbose("PJSIP/3040-00000212", ""Hangup!!!!"") in new stack
Hangup!!!!

Thanks & kind regards
// Clemens

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.