Hangup The _called_ Channel ?

Home » Asterisk Users » Hangup The _called_ Channel ?
Asterisk Users 6 Comments

I understand that HangUp() hangs up the calling channel. I want to hangup the called channel.

SIP/mycall-xxxxx calls and bridges with DAHDI/1-1.

I send SIP/…. to listen to a long, very long, file.

GoSub(play-long-file,s,1)

[play-long-file]
exten=s,1, ;;; Here I want to hangup DAHDI/1-1, the called channel same=n,Playback(very-long-file)
same=n,Hangup()

How do I hangup the called channel, and leave the calling channel listening to the file ?

6 thoughts on - Hangup The _called_ Channel ?

  • GoSub(play-long-file,s,1)

    [play-long-file]
    exten=s,1, ;;; Here I want to hangup DAHDI/1-1, the called channel same=n,Playback(very-long-file)
    same=n,Hangup()

    Is there a better way ?

  • GoSub(play-long-file,s,1)

    [play-long-file]
    exten=s,1, ;;; Here I want to hangup DAHDI/1-1, the called channel same=n,Playback(very-long-file)
    same=n,Hangup()

    Is there a better way ?

  • You can’t have a channel both in dialplan directly and also bridged to another channel at the same time. There’s not enough context or information to really be able to answer without understanding fully.


    Joshua Colp Digium – A Sangoma Company | Senior Software Developer
    445 Jan Davis Drive NW – Huntsville, AL 35806 – US
    Check us out at: http://www.digium.com & http://www.asterisk.org

  • Maybe this will help explain it. Here’s the cli:

    Executing [s@incoming:7] Dial(“SIP/incall-00000001”,
    “DAHDI/g0,55,tTD(:1)”) in new stack
    — Called DAHDI/g0
    — DAHDI/1-1 answered SIP/incall-00000001
    — Channel DAHDI/1-1 joined ‘simple_bridge’ basic-bridge
    <5312c0a8-7697-4a97-b3ff-ff0484fbaf3d>
    — Channel SIP/incall-00000001 joined ‘simple_bridge’ basic-bridge
    <5312c0a8-7697-4a97-b3ff-ff0484fbaf3d>
    — SIP/incall-00000001 Internal Gosub(long-file,s,1) start
    — Executing [s@long-file:1] Playback(“SIP/incall-00000001”,
    “long-file”) in new stack
    Playing ‘long-file.slin’ (language
    ‘en’)
    — Executing [s@long-file:2] Verbose(“SIP/incall-00000001”,
    “bridgepeer is DAHDI/1-1”) in new stack Executing [s@long-file:3] Hangup(“SIP/incall-00000001”, “”) in new stack
    == Spawn extension (long-file, s, 3) exited non-zero on
    ‘SIP/incall-00000001’
    [Sep 12 13:06:06] NOTICE[2217][C-00000001]: app_stack.c:1082 gosub_run:
    SIP/callcentric20-00000001 Abnormal ‘Gosub(long-file,s,1)’ exit. Popping routine return locations.
    — Channel SIP/incall left ‘simple_bridge’ basic-bridge
    <5312c0a8-7697-4a97-b3ff-ff0484fbaf3d>
    — Channel DAHDI/1-1 left ‘simple_bridge’ basic-bridge
    <5312c0a8-7697-4a97-b3ff-ff0484fbaf3d>
    — Hanging up on ‘DAHDI/1-1’
    — Hungup ‘DAHDI/1-1’

    As you can see DAHDI/1-1 is not hungup until after Playback. I want to hangup DAHDI/1-1 before the Playback.

    Thanks,