[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 [[email protected]:24] ExecIf (" SIP/203078.tenios.com-00000001 ", " 1?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1) ") in new stack

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

Goto (customdests,dest-1,1)

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

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

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

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

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

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

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

Executing [[email protected]: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 [[email protected]:1] Set (" SIP/203078.tenios.com-00000001 ", " __RINGTIMER=1 ") in new stack

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

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

Executing [[email protected]:1] Macro (" SIP/203078.tenios.com-00000001 ", " user-callerid, ") in new stack

Executing [[email protected]:1] Set (" SIP/203078.tenios.com-00000001 ", " TOUCH_MONITOR=1621129611.1 ") in new stack

Executing [[email protected]:2] Set (" SIP/203078.tenios.com-00000001 ", " AMPUSER=+491603774112 ") in new stack

Executing [[email protected]:3] Set (" SIP/203078.tenios.com-00000001 ", " HOTDESCKCHAN=203078.tenios.com-00000001 ") in new stack

Executing [[email protected]:4] Set (" SIP/203078.tenios.com-00000001 ", " HOTDESKEXTEN=203078.tenios.com ") in new stack

Executing [[email protected]:5] Set (" SIP/203078.tenios.com-00000001 ", " HOTDESKCALL=0 ") in new stack

Executing [[email protected]:6] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(HOTDESKCALL=1) ") in new stack

Executing [[email protected]:7] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(CALLERID(name)=) ") in new stack

Executing [[email protected]:8] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?report ") in new stack

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

Executing [[email protected]:10] Set (" SIP/203078.tenios.com-00000001 ", " AMPUSER= ") in new stack

Executing [[email protected]:11] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?limit ") in new stack

Executing [[email protected]:12] Set (" SIP/203078.tenios.com-00000001 ", " AMPUSERCIDNAME= ") in new stack

Executing [[email protected]:13] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(__CIDMASQUERADING=TRUE) ") in new stack

Executing [[email protected]:14] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?report ") in new stack

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

Executing [[email protected]:23] NoOp (" SIP/203078.tenios.com-00000001 ", " Macro Depth is 2 ") in new stack

Executing [[email protected]:24] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?report2:macroerror ") in new stack

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

Executing [[email protected]:25] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?continue ") in new stack

Executing [[email protected]:26] ExecIf (" SIP/203078.tenios.com-00000001 ", " 1?Set(__CALLEE_ACCOUNCODE=) ") in new stack

Executing [[email protected]:27] Set (" SIP/203078.tenios.com-00000001 ", " __TTL=64 ") in new stack

Executing [[email protected]:28] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?continue ") in new stack

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

Executing [[email protected]:44] Set (" SIP/203078.tenios.com-00000001 ", " CALLERID(number)=+491603774112 ") in new stack

Executing [[email protected]:45] Set (" SIP/203078.tenios.com-00000001 ", " CALLERID(name)=+491603774112 ") in new stack

Executing [[email protected]:46] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?cnum ") in new stack

Executing [[email protected]:47] Set (" SIP/203078.tenios.com-00000001 ", " CDR(cnam)=+491603774112 ") in new stack

Executing [[email protected]:48] Set (" SIP/203078.tenios.com-00000001 ", " CDR(cnum)=+491603774112 ") in new stack

Executing [[email protected]:49] Set (" SIP/203078.tenios.com-00000001 ", " CHANNEL(language)=de_DE ") in new stack

Executing [[email protected]:2] Set (" SIP/203078.tenios.com-00000001 ", " RingGroupMethod=none ") in new stack

Executing [[email protected]:3] Set (" SIP/203078.tenios.com-00000001 ", " __EXTTOCALL=100 ") in new stack

Executing [[email protected]:4] Set (" SIP/203078.tenios.com-00000001 ", " __PICKUPMARK=100 ") in new stack

Executing [[email protected]:5] Set (" SIP/203078.tenios.com-00000001 ", " RT=1 ") in new stack

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

Executing [[email protected]:7] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

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

Executing [[email protected]:9] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?MacroExit() ") in new stack

Executing [[email protected]:10] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?ChanSpy(VIRTUAL/100,q) ") in new stack

Executing [[email protected]: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 [[email protected]: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 [[email protected]: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 [[email protected]: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 [[email protected]: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 [[email protected]: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 [[email protected]: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 [[email protected]:18] Gosub (" SIP/203078.tenios.com-00000001 ", " sub-record-check,s,1(exten,100,dontcare) ") in new stack

Executing [[email protected]:1] GotoIf (" SIP/203078.tenios.com-00000001 ", " 13?initialized ") in new stack

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

Executing [[email protected]:10] NoOp (" SIP/203078.tenios.com-00000001 ", " Recordings initialized ") in new stack

Executing [[email protected]:11] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(ARG3=dontcare) ") in new stack

Executing [[email protected]:12] Set (" SIP/203078.tenios.com-00000001 ", " REC_POLICY_MODE_SAVE= ") in new stack

Executing [[email protected]:13] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(REC_STATUS=NO) ") in new stack

Executing [[email protected]:14] GotoIf (" SIP/203078.tenios.com-00000001 ", " 5?checkaction ") in new stack

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

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

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

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

Executing [[email protected]:2] Set (" SIP/203078.tenios.com-00000001 ", " CALLTYPE=external ") in new stack

Executing [[email protected]:3] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(CALLTYPE=) ") in new stack

Executing [[email protected]:4] Set (" SIP/203078.tenios.com-00000001 ", " CALLEE=dontcare ") in new stack

Executing [[email protected]:5] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(CALLEE=dontcare) ") in new stack

Executing [[email protected]:6] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?callee ") in new stack

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

Executing [[email protected]:11] Gosub (" SIP/203078.tenios.com-00000001 ", " recordcheck,1(dontcare,external,100) ") in new stack

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

Executing [[email protected]:2] Goto (" SIP/203078.tenios.com-00000001 ", " dontcare ") in new stack

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

Executing [[email protected]:3] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [[email protected]:12] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [[email protected]:19] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?macrodial ") in new stack

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

Executing [[email protected]:25] GosubIf (" SIP/203078.tenios.com-00000001 ", " 0?clrheader,1() ") in new stack

Executing [[email protected]:26] Macro (" SIP/203078.tenios.com-00000001 ", " dial-one,1,HhTtr,100 ") in new stack

Executing [[email protected]:1] Set (" SIP/203078.tenios.com-00000001 ", " DEXTEN=100 ") in new stack

Executing [[email protected]:2] Set (" SIP/203078.tenios.com-00000001 ", " __CRM_SOURCE=+491603774112 ") in new stack

Executing [[email protected]:3] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(__EXTTOCALL=100) ") in new stack

Executing [[email protected]:4] Set (" SIP/203078.tenios.com-00000001 ", " DIALSTATUS_CW= ") in new stack

Executing [[email protected]:5] GosubIf (" SIP/203078.tenios.com-00000001 ", " 1?screen,1() ") in new stack

Executing [[email protected]:1] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?memory ") in new stack

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

Executing [[email protected]:3] Set (" SIP/203078.tenios.com-00000001 ", " __SCREEN=nomemory ") in new stack

Executing [[email protected]:4] Set (" SIP/203078.tenios.com-00000001 ", " __SCREEN_EXTEN=100 ") in new stack

Executing [[email protected]:5] Set (" SIP/203078.tenios.com-00000001 ", " ARG2=HhTtrp ") in new stack

Executing [[email protected]:6] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [[email protected]:6] GosubIf (" SIP/203078.tenios.com-00000001 ", " 0?cf,1() ") in new stack

Executing [[email protected]:7] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?skip1 ") in new stack

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

Executing [[email protected]:10] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?nodial ") in new stack

Executing [[email protected]:11] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?continue ") in new stack

Executing [[email protected]:12] Set (" SIP/203078.tenios.com-00000001 ", " EXTHASCW=ENABLED ") in new stack

Executing [[email protected]:13] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?next1:cwinusebusy ") in new stack

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

Executing [[email protected]:25] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?next3:continue ") in new stack

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

Executing [[email protected]:27] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?nodial ") in new stack

Executing [[email protected]:28] GosubIf (" SIP/203078.tenios.com-00000001 ", " 1?dstring,1():dlocal,1() ") in new stack

Executing [[email protected]:1] Set (" SIP/203078.tenios.com-00000001 ", " DSTRING= ") in new stack

Executing [[email protected]:2] Set (" SIP/203078.tenios.com-00000001 ", " DEVICES=100 ") in new stack

Executing [[email protected]:3] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Return() ") in new stack

Executing [[email protected]:4] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Set(DEVICES=00) ") in new stack

Executing [[email protected]:5] Set (" SIP/203078.tenios.com-00000001 ", " LOOPCNT=1 ") in new stack

Executing [[email protected]:6] Set (" SIP/203078.tenios.com-00000001 ", " ITER=1 ") in new stack

Executing [[email protected]:7] Set (" SIP/203078.tenios.com-00000001 ", " THISDIAL=VIRTUAL/100 ") in new stack

Executing [[email protected]:8] GotoIf (" SIP/203078.tenios.com-00000001 ", " 1?docheck ") in new stack

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

Executing [[email protected]:14] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?skipset ") in new stack

Executing [[email protected]:15] Set (" SIP/203078.tenios.com-00000001 ", " DSTRING=VIRTUAL/100& ") in new stack

Executing [[email protected]:16] Set (" SIP/203078.tenios.com-00000001 ", " ITER=2 ") in new stack

Executing [[email protected]:17] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?begin ") in new stack

Executing [[email protected]:18] ExecIf (" SIP/203078.tenios.com-00000001 ", " 0?Return() ") in new stack

Executing [[email protected]:19] Set (" SIP/203078.tenios.com-00000001 ", " DSTRING=VIRTUAL/100 ") in new stack

Executing [[email protected]:20] Return (" SIP/203078.tenios.com-00000001 ", “”) in new stack

Executing [[email protected]:29] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?nodial ") in new stack

Executing [[email protected]:30] GotoIf (" SIP/203078.tenios.com-00000001 ", " 0?skiptrace ") in new stack

Executing [[email protected]:31] GosubIf (" SIP/203078.tenios.com-00000001 ", " 1?ctset,1():ctclear,1() ") in new stack

Executing [[email protected]: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.