FastAgi fallback behavior

Hi,

I’m a little newbie in Asterisk, so if this is a simple question please excuse me.

I was trying to implement a way of having a fallback behavior in case of the FastAgi call fails.

I’ve read somewhere that this should work (referred as the N+100 solution):

[internal]
exten => 335,1,AGI(agi://some_null_server);
exten => 335,2,Verbose(1, “Agi call OK”);
exten => 335,102,Verbose(1, “Agi call NOK”);

In the CLI I have the following:

[Mar 11 16:45:49] ERROR[22681][C-00000028]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo(“some_null_server”, “(null)”, …): Name or service not known
[Mar 11 16:45:49] WARNING[22681][C-00000028]: res_agi.c:1517 launch_netscript: Unable to locate host ‘some_null_server’
“Agi call OK”

It seems like it’s not working.

I’m using asterinknow on CentOS:

[root@localhost asterisk]# asterisk -V
Asterisk 11.7.0

Thanks in advance.

Most applications only jump if you specify an option. Most of them set a variable to say if they worked.

Thanks for the tip.

I was able to obtain the behavior I wanted by checking the value of the AGISTATUS variable.

Here’s an example:

exten => 335, 1, Verbose(1, “Call Reaching Internal(355)”)
same => n, AGI(agi://some_null_server);
same => n, GotoIf($["${AGISTATUS}" = “SUCCESS”]?OK:NOK)
same => n(OK), Verbose(1, “Agi call OK”);
same => n(NOK), Verbose(1, “Agi call NOK”);

In the CLI I can see the following. It seems like is working fine

“Call Reaching Internal(355)”
[Mar 11 17:26:17] ERROR[22733][C-0000002e]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo(“some_null_server”, “(null)”, …): Name or service not known
[Mar 11 17:26:17] WARNING[22733][C-0000002e]: res_agi.c:1517 launch_netscript: Unable to locate host ‘some_null_server’
“Agi call NOK”

Thanks for the tip again. I just don’t understand where can I use the N + 101 behavior I saw in some asterisk forums.