У меня заработала корректно только такая строчка:
exten => s,n,ExecIf($["${CHANNEL}" = "${CHANNEL(hangupsource)}"]?Set(HANGUPSOURCE=caller):Set(HANGUPSOURCE=called))
Иначе ...
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1495 op_div: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1375 op_negate: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1375 op_negate: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1353 op_minus: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1353 op_minus: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected $end, expecting '-' or '!' or '(' or '<token>'; Input:
PJSIP/***PBX---PJSIP---**PBX-0000059e =
^
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to
https://wiki.asterisk.org/wiki/display/ ... +Variables
-- Executing [s@macro-hangupcall:11] ExecIf("PJSIP/***PBX---PJSIP---CC-PBX-0000059e", "0?Set(HANGUPSOURCE=caller):Set(HANGUPSOURCE=called)") in new stack
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1495 op_div: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1375 op_negate: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1375 op_negate: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1353 op_minus: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.y:1353 op_minus: non-numeric argument
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected $end, expecting '-' or '!' or '(' or '<token>'; Input:
PJSIP/***PBX---PJSIP---CC-PBX-0000059e =
^
[2022-06-29 00:30:33] WARNING[18171][C-000005f6]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to
https://wiki.asterisk.org/wiki/display/ ... +Variables