CALLS NOT HANGING UP THROUGH AGI

Home » Asterisk Users » CALLS NOT HANGING UP THROUGH AGI
Asterisk Users 4 Comments

Hi Everyone,

I am dealing with a problem for now and its really annoying.

I want to hangup calls from AGI but it seems that my AGI is not rejecting the calls properly.

{
$agi->verbose(“number-not-in-service”);
$agi->exec(“Congestion”,”1″);
$agi->hangup();
exit;
}

with the above logic, all of my calls should be rejected and should be disconnected instantaneously.

But this doesn’t seem to be happening, in asterisk CLI I can see that AGI is executing multiple times.

Can anyone tell what I am doing wrong?

Thanks.

4 thoughts on - CALLS NOT HANGING UP THROUGH AGI

  • Is this SIP? If so what may be happening is that the system sending you calls may not consider a 503 Service Unavailable (which Congestion will send) to be a final response which terminates the call and thus send you a call again, and again, and again, in hopes that you’ll accept it. Since that is behavior of the system sending you calls you would need to determine if there is any SIP response which will provide the behavior you need and then find the appropriate cause code to cause it to be sent.

  • Yes Joshua, Its SIP and but the problem is I have tried everything but it doesn’t seem to work.

    In the SIP Trace I can see that I am sending 503 Service Unavailable as a response.

    You can check the SIP trace attached below:

    162.243.107.173:5060 -> 66.226.76.70:5060
    SIP/2.0 503 Service Unavailable Via: SIP/2.0/UDP 66.226.76.70:5060;branchz9hG4bK643.e44ea565.0;receivedf.226.76.70;rportP60 Via: SIP/2.0/UDP
    74.117.36.136;receivedt.117.36.136;rportP60;branch=z9hG4bKHBe9cmy3QX2Se From: ;tag=5H54caUKre8gc To: < sip:12023300643@162.243.107.173:5060>;tag=as61c328a0 Call-ID:
    15-8824754a-f58560c9-335bcd48-45558f71 CSeq: 103180201 INVITE Server:
    user_Anas Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer Content-Length: 0

  • You would need to determine what will stop the remote server from sending you the call again. Once you do that and can provide what it is then we can figure out how to get Asterisk to do that. As it is the problem isn’t Asterisk, it is what is sending you the call.

  • Ok, I also tried to hangup directly through dialplan, it doesn’t work.

    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b0”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b0’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b1”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b1’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b2”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b2’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b3”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b3’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b4”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b4’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b5”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b5’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b6”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b6’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b7”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b7’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b8”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b8’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0b9”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0b9’
    == Using SIP RTP CoS mark 5
    — Executing [12023300643@default:1]
    Hangup(“SIP/66.226.76.70-0000d0ba”, “41”) in new stack
    == Spawn extension (default, 12023300643, 1) exited non-zero on
    ‘SIP/66.226.76.70-0000d0ba’