[macro-hangupcall-custom] never gets called?

I am trying to run a bash script whenever a caller hangs up. I have already created a [macro-hangupcall-custom]-context in the extensions_custom.conf. Unfortunately it seems, that the custom-context never gets called.

[macro-hangupcall-custom]
exten => s,1,DumpChan()
exten => s,n,System(/bin/bash /var/lib/asterisk/scripts/xxx.sh)
exten => s,n,MacroExit()

Is there an error in my file? Am I missing something? :slight_smile:
Thanks for your help
Chris

My asterisk log:

<SIP/203078.tenios.com-00000001>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0

Executing [s@from-trunk:24] ExecIf (" SIP/203078.tenios.com-00000001 ", " 1?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1) ") in new stack

Executing [s@from-trunk:25] Goto (" SIP/203078.tenios.com-00000001 ", " customdests,dest-1,1 ") in new stack

Goto (customdests,dest-1,1)

Executing [dest-1@customdests:1] NoOp (" SIP/203078.tenios.com-00000001 ", " Entering Custom Destination Neuer Anruf talkradio1 ") in new stack

Executing [dest-1@customdests:2] Gosub (" SIP/203078.tenios.com-00000001 ", " neueranruf,s,1() ") in new stack

Executing [s@neueranruf:1] System (" SIP/203078.tenios.com-00000001 ", " /bin/bash /var/lib/asterisk/scripts/neueranruf.sh +491603774112 ") in new stack

Executing [s@neueranruf:2] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [dest-1@customdests:3] NoOp (" SIP/203078.tenios.com-00000001 ", " Returned from Custom Destination Neuer Anruf talkradio1 ") in new stack

Executing [dest-1@customdests:4] Goto (" SIP/203078.tenios.com-00000001 ", " from-did-direct,100,1 ") in new stack

Goto (from-did-direct,100,1)

Executing [100@from-did-direct:1] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?ext-local,100,1:followme-check,100,1 ") in new stack

Goto (ext-local,100,1)

Executing [100@ext-local:1] Set (" SIP/203078.tenios.com-00000001 ", " __RINGTIMER=1 ") in new stack

Executing [100@ext-local:2] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(__CWIGNORE=) ") in new stack

Executing [100@ext-local:3] Macro (" SIP/203078.tenios.com-00000001 ", " exten-vm,novm,100,1,1,1 ") in new stack

Executing [s@macro-exten-vm:1] Macro (" SIP/203078.tenios.com-00000001 ", " user-callerid, ") in new stack

Executing [s@macro-user-callerid:1] Set (" SIP/203078.tenios.com-00000001 ", " TOUCH_MONITOR=1621129611.1 ") in new stack

Executing [s@macro-user-callerid:2] Set (" SIP/203078.tenios.com-00000001 ", " AMPUSER=+491603774112 ") in new stack

Executing [s@macro-user-callerid:3] Set (" SIP/203078.tenios.com-00000001 ", " HOTDESCKCHAN=203078.tenios.com-00000001 ") in new stack

Executing [s@macro-user-callerid:4] Set (" SIP/203078.tenios.com-00000001 ", " HOTDESKEXTEN=203078.tenios.com ") in new stack

Executing [s@macro-user-callerid:5] Set (" SIP/203078.tenios.com-00000001 ", " HOTDESKCALL=0 ") in new stack

Executing [s@macro-user-callerid:6] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(HOTDESKCALL=1) ") in new stack

Executing [s@macro-user-callerid:7] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(CALLERID(name)=) ") in new stack

Executing [s@macro-user-callerid:8] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?report ") in new stack

Executing [s@macro-user-callerid:9] ExecIf (" SIP/203078.tenios.com-00000001 ", " 1?Set(REALCALLERIDNUM=+491603774112) ") in new stack

Executing [s@macro-user-callerid:10] Set (" SIP/203078.tenios.com-00000001 ", " AMPUSER= ") in new stack

Executing [s@macro-user-callerid:11] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?limit ") in new stack

Executing [s@macro-user-callerid:12] Set (" SIP/203078.tenios.com-00000001 ", " AMPUSERCIDNAME= ") in new stack

Executing [s@macro-user-callerid:13] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(__CIDMASQUERADING=TRUE) ") in new stack

Executing [s@macro-user-callerid:14] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?report ") in new stack

Goto (macro-user-callerid,s,23)

Executing [s@macro-user-callerid:23] NoOp (" SIP/203078.tenios.com-00000001 ", " Macro Depth is 2 ") in new stack

Executing [s@macro-user-callerid:24] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?report2:macroerror ") in new stack

Goto (macro-user-callerid,s,25)

Executing [s@macro-user-callerid:25] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?continue ") in new stack

Executing [s@macro-user-callerid:26] ExecIf (" SIP/203078.tenios.com-00000001 ", " 1?Set(__CALLEE_ACCOUNCODE=) ") in new stack

Executing [s@macro-user-callerid:27] Set (" SIP/203078.tenios.com-00000001 ", " __TTL=64 ") in new stack

Executing [s@macro-user-callerid:28] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?continue ") in new stack

Goto (macro-user-callerid,s,44)

Executing [s@macro-user-callerid:44] Set (" SIP/203078.tenios.com-00000001 ", " CALLERID(number)=+491603774112 ") in new stack

Executing [s@macro-user-callerid:45] Set (" SIP/203078.tenios.com-00000001 ", " CALLERID(name)=+491603774112 ") in new stack

Executing [s@macro-user-callerid:46] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?cnum ") in new stack

Executing [s@macro-user-callerid:47] Set (" SIP/203078.tenios.com-00000001 ", " CDR(cnam)=+491603774112 ") in new stack

Executing [s@macro-user-callerid:48] Set (" SIP/203078.tenios.com-00000001 ", " CDR(cnum)=+491603774112 ") in new stack

Executing [s@macro-user-callerid:49] Set (" SIP/203078.tenios.com-00000001 ", " CHANNEL(language)=de_DE ") in new stack

Executing [s@macro-exten-vm:2] Set (" SIP/203078.tenios.com-00000001 ", " RingGroupMethod=none ") in new stack

Executing [s@macro-exten-vm:3] Set (" SIP/203078.tenios.com-00000001 ", " __EXTTOCALL=100 ") in new stack

Executing [s@macro-exten-vm:4] Set (" SIP/203078.tenios.com-00000001 ", " __PICKUPMARK=100 ") in new stack

Executing [s@macro-exten-vm:5] Set (" SIP/203078.tenios.com-00000001 ", " RT=1 ") in new stack

Executing [s@macro-exten-vm:6] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Macro(vm,novm,DIRECTDIAL,) ") in new stack

Executing [s@macro-exten-vm:7] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

Executing [s@macro-exten-vm:8] ExecIf (" SIP/203078.tenios.com-00000001 ", " *0?Gosub(ext-intercom,80100,1()) ") in new stack

Executing [s@macro-exten-vm:9] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

Executing [s@macro-exten-vm:10] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?ChanSpy(VIRTUAL/100,q) ") in new stack

Executing [s@macro-exten-vm:11] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

Executing [s@macro-exten-vm:12] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Macro(vm,novm,DIRECTDIAL,) ") in new stack

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

Executing [s@macro-exten-vm:13] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

Executing [s@macro-exten-vm:14] ExecIf (" SIP/203078.tenios.com-00000001 ", " *0?Gosub(ext-intercom,80100,1()) ") in new stack

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

Executing [s@macro-exten-vm:15] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

Executing [s@macro-exten-vm:16] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?ChanSpy(VIRTUAL/100,q) ") in new stack

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

Executing [s@macro-exten-vm:17] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

[2021-05-16 03:46:52] ERROR [7506][C-00000002]: res_pjsip_header_funcs.c : 454 func_read_header : This function requires a PJSIP channel.

Executing [s@macro-exten-vm:18] Gosub (" SIP/203078.tenios.com-00000001 ", " sub-record-check,s,1(exten,100,dontcare) ") in new stack

Executing [s@sub-record-check:1] GotoIf (" SIP/203078.tenios.com-00000001 ", " 13?initialized ") in new stack

Goto (sub-record-check,s,10)

Executing [s@sub-record-check:10] NoOp (" SIP/203078.tenios.com-00000001 ", " Recordings initialized ") in new stack

Executing [s@sub-record-check:11] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(ARG3=dontcare) ") in new stack

Executing [s@sub-record-check:12] Set (" SIP/203078.tenios.com-00000001 ", " REC_POLICY_MODE_SAVE= ") in new stack

Executing [s@sub-record-check:13] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(REC_STATUS=NO) ") in new stack

Executing [s@sub-record-check:14] GotoIf (" SIP/203078.tenios.com-00000001 ", " 5?checkaction ") in new stack

Goto (sub-record-check,s,17)

Executing [s@sub-record-check:17] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?sub-record-check,exten,1 ") in new stack

Goto (sub-record-check,exten,1)

Executing [exten@sub-record-check:1] NoOp (" SIP/203078.tenios.com-00000001 ", " Exten Recording Check between +491603774112 and 100 ") in new stack

Executing [exten@sub-record-check:2] Set (" SIP/203078.tenios.com-00000001 ", " CALLTYPE=external ") in new stack

Executing [exten@sub-record-check:3] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(CALLTYPE=) ") in new stack

Executing [exten@sub-record-check:4] Set (" SIP/203078.tenios.com-00000001 ", " CALLEE=dontcare ") in new stack

Executing [exten@sub-record-check:5] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(CALLEE=dontcare) ") in new stack

Executing [exten@sub-record-check:6] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?callee ") in new stack

Goto (sub-record-check,exten,11)

Executing [exten@sub-record-check:11] Gosub (" SIP/203078.tenios.com-00000001 ", " recordcheck,1(dontcare,external,100) ") in new stack

Executing [recordcheck@sub-record-check:1] NoOp (" SIP/203078.tenios.com-00000001 ", " Starting recording check against dontcare ") in new stack

Executing [recordcheck@sub-record-check:2] Goto (" SIP/203078.tenios.com-00000001 ", " dontcare ") in new stack

Goto (sub-record-check,recordcheck,3)

Executing [recordcheck@sub-record-check:3] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [exten@sub-record-check:12] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [s@macro-exten-vm:19] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?macrodial ") in new stack

Goto (macro-exten-vm,s,25)

Executing [s@macro-exten-vm:25] GosubIf (" SIP/203078.tenios.com-00000001 ", " 0?clrheader,1() ") in new stack

Executing [s@macro-exten-vm:26] Macro (" SIP/203078.tenios.com-00000001 ", " dial-one,1,HhTtr,100 ") in new stack

Executing [s@macro-dial-one:1] Set (" SIP/203078.tenios.com-00000001 ", " DEXTEN=100 ") in new stack

Executing [s@macro-dial-one:2] Set (" SIP/203078.tenios.com-00000001 ", " __CRM_SOURCE=+491603774112 ") in new stack

Executing [s@macro-dial-one:3] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(__EXTTOCALL=100) ") in new stack

Executing [s@macro-dial-one:4] Set (" SIP/203078.tenios.com-00000001 ", " DIALSTATUS_CW= ") in new stack

Executing [s@macro-dial-one:5] GosubIf (" SIP/203078.tenios.com-00000001 ", " 1?screen,1() ") in new stack

Executing [screen@macro-dial-one:1] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?memory ") in new stack

Executing [screen@macro-dial-one:2] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?System(rm -f /var/lib/asterisk/sounds/priv-callerintros/+491603774112.*) ") in new stack

Executing [screen@macro-dial-one:3] Set (" SIP/203078.tenios.com-00000001 ", " __SCREEN=nomemory ") in new stack

Executing [screen@macro-dial-one:4] Set (" SIP/203078.tenios.com-00000001 ", " __SCREEN_EXTEN=100 ") in new stack

Executing [screen@macro-dial-one:5] Set (" SIP/203078.tenios.com-00000001 ", " ARG2=HhTtrp ") in new stack

Executing [screen@macro-dial-one:6] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [s@macro-dial-one:6] GosubIf (" SIP/203078.tenios.com-00000001 ", " 0?cf,1() ") in new stack

Executing [s@macro-dial-one:7] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?skip1 ") in new stack

Goto (macro-dial-one,s,10)

Executing [s@macro-dial-one:10] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?nodial ") in new stack

Executing [s@macro-dial-one:11] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?continue ") in new stack

Executing [s@macro-dial-one:12] Set (" SIP/203078.tenios.com-00000001 ", " EXTHASCW=ENABLED ") in new stack

Executing [s@macro-dial-one:13] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?next1:cwinusebusy ") in new stack

Goto (macro-dial-one,s,25)

Executing [s@macro-dial-one:25] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?next3:continue ") in new stack

Goto (macro-dial-one,s,27)

Executing [s@macro-dial-one:27] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?nodial ") in new stack

Executing [s@macro-dial-one:28] GosubIf (" SIP/203078.tenios.com-00000001 ", " 1?dstring,1():dlocal,1() ") in new stack

Executing [dstring@macro-dial-one:1] Set (" SIP/203078.tenios.com-00000001 ", " DSTRING= ") in new stack

Executing [dstring@macro-dial-one:2] Set (" SIP/203078.tenios.com-00000001 ", " DEVICES=100 ") in new stack

Executing [dstring@macro-dial-one:3] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Return() ") in new stack

Executing [dstring@macro-dial-one:4] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(DEVICES=00) ") in new stack

Executing [dstring@macro-dial-one:5] Set (" SIP/203078.tenios.com-00000001 ", " LOOPCNT=1 ") in new stack

Executing [dstring@macro-dial-one:6] Set (" SIP/203078.tenios.com-00000001 ", " ITER=1 ") in new stack

Executing [dstring@macro-dial-one:7] Set (" SIP/203078.tenios.com-00000001 ", " THISDIAL=VIRTUAL/100 ") in new stack

Executing [dstring@macro-dial-one:8] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?docheck ") in new stack

Goto (macro-dial-one,dstring,14)

Executing [dstring@macro-dial-one:14] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?skipset ") in new stack

Executing [dstring@macro-dial-one:15] Set (" SIP/203078.tenios.com-00000001 ", " DSTRING=VIRTUAL/100& ") in new stack

Executing [dstring@macro-dial-one:16] Set (" SIP/203078.tenios.com-00000001 ", " ITER=2 ") in new stack

Executing [dstring@macro-dial-one:17] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?begin ") in new stack

Executing [dstring@macro-dial-one:18] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Return() ") in new stack

Executing [dstring@macro-dial-one:19] Set (" SIP/203078.tenios.com-00000001 ", " DSTRING=VIRTUAL/100 ") in new stack

Executing [dstring@macro-dial-one:20] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [s@macro-dial-one:29] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?nodial ") in new stack

Executing [s@macro-dial-one:30] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?skiptrace ") in new stack

Executing [s@macro-dial-one:31] GosubIf (" SIP/203078.tenios.com-00000001 ", " 1?ctset,1():ctclear,1() ") in new stack

Executing [ctset@macro-dial-one:1] Set (" SIP/203078.tenios.com-00000001 ", " DB(CALLTRACE/100)=+491603774112 ") in new stack

Most of the *-custom contexts are unusable. You want a hangup handler, which is explained in this post:

1 Like

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