Hangup handllers

Hi everyone.
I have a dialplan like that:

[context]
exten => 5007,1,Noop()
exten => 5007,n,AGI(call.php)
exten => 5007,n,Set(CHANNEL(hangup_handler_push)=handl1,s,1)
exten => 5007,n,Hangup()

[handl1]
exten => s,1,NoOp(Executing hangup handler)
exten => s,n,Verbose(1,Hangup handler executed)
exten => s,n,Return()

but my hangup handller dose not work. what should I do?

You should show the actual console output, to ensure that the call is leaving the AGI. If it doesn’t, then it won’t run.

On Tuesday 07 May 2024 at 14:10:08, saminab via Asterisk Community wrote:

[context]
exten => 5007,1,Noop()
exten => 5007,n,AGI(call.php)
exten => 5007,n,Set(CHANNEL(hangup_handler_push)=handl1,s,1)
exten => 5007,n,Hangup()

I presume the call is getting answered in your AGI script, so try seeting the
hangup handler first:

[context]
exten => 5007,1,Noop()
exten => 5007,n,Set(CHANNEL(hangup_handler_push)=handl1,s,1)
exten => 5007,n,AGI(call.php)
exten => 5007,n,Hangup()

Antony.


“If code doesn’t receive constant love, it turns to shit.”

  • Brad Fitzpatrick, Google engineer

                                                Please reply to the list;
                                                      please *don't* CC me.
    

do you mean this part?

– <SIP/x-IN-0000008a>AGI Script call.php completed, returning 4
== Spawn extension (x, 5007, 2) exited non-zero on ‘SIP/x-IN-0000008a’
– SIP/x-IN-0000008a Internal Gosub(crm-hangup,s,1) start
– Executing [s@crm-hangup:1] NoOp(“SIP/x-IN-0000008a”, “Sending Hangup to CRM”) in new stack
– Executing [s@crm-hangup:2] NoOp(“SIP/x-IN-0000008a”, “HANGUP CAUSE: 19”) in new stack
– Executing [s@crm-hangup:3] ExecIf(“SIP/x-IN-0000008a”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
– Executing [s@crm-hangup:4] NoOp(“SIP/x-IN-0000008a”, “MASTER CHANNEL: 1715083898.314 = 1715083898.314”) in new stack
– Executing [s@crm-hangup:5] GotoIf(“SIP/x-IN-0000008a”, “0?return”) in new stack
– Executing [s@crm-hangup:6] Set(“SIP/x-IN-0000008a”, “__CRM_HANGUP=1”) in new stack
– Executing [s@crm-hangup:7] AGI(“SIP/x-IN-0000008a”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <SIP/x-IN-0000008a>AGI Script sangomacrm.agi completed, returning 0
– Executing [s@crm-hangup:8] Return(“SIP/x-IN-0000008a”, “”) in new stack
== Spawn extension (x, 5007, 2) exited non-zero on ‘SIP/x-IN-0000008a’
– SIP/x-IN-0000008a Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=

Hi and tnx a lot.
It works

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