Print out AGI PHP script variable

I have a php script which uses AGI to set next variables

$agi->set_variable("TRUNKCIDOVERRIDE", $selected_callerid);
$agi->set_variable("CALLERID(all)", $selected_callerid);

When I make a call I see next logs

[2022-12-16 20:43:22] VERBOSE[1621][C-0000dbce] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/select-callerid.php
[2022-12-16 20:43:22] VERBOSE[1621][C-0000dbce] res_agi.c: <PJSIP/245-0000dbcd>AGI Script select-callerid.php completed, returning 0
[2022-12-16 20:43:22] VERBOSE[1621][C-0000dbce] pbx.c: Executing [[email protected]:7] ExecIf("PJSIP/245-0000dbcd", "0?AGI(select-callerid.php,51567567543)") in new stack
[2022-12-16 20:43:22] VERBOSE[1621][C-0000dbce] pbx.c: Executing [[email protected]:18] ExecIf("PJSIP/245-0000dbcd", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
[2022-12-16 20:43:22] VERBOSE[1621][C-0000dbce] pbx.c: Executing [[email protected]:19] ExecIf("PJSIP/245-0000dbcd", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
[2022-12-16 20:43:22] VERBOSE[1621][C-0000dbce] pbx.c: Executing [[email protected]:20] Set("PJSIP/245-0000dbcd", "CDR(outbound_cnum)=245") in new stack
[2022-12-16 20:43:22] VERBOSE[1621][C-0000dbce] pbx.c: Executing [[email protected]:21] Set("PJSIP/245-0000dbcd", "CDR(outbound_cnam)=245") in new stack

But unfortunately there is no information about those variables. Do I have any options to print them out?

Iā€™m using FreePBX 13.0.192.19

www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-CHP-9-SECT-5.html#asterisk-CHP-9-SECT-5.2

However note that FreePBX 13 is end of life.

1 Like

Unfortunately, this command does not add anything to log output. I still see the same behaviour.I tried to run:

asterisk -r
agi debug
// and then in another window
tail -f /var/log/asterisk/full

The proper command should be

asterisk -r
agi set debug on

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