TIMEOUT(absolute) is not working


#1

Hello sir
i set the TIMEOUT(absolute) in my AGI . i generate the call form asterisk and i play music after the given time out its not hang up can any one give me any idea why ?

also i can generate more then one call from cli mode via agi


#2

Can you show console output that confirms your AGI set this? As well is your AGI properly handling a hangup in that case?


#3

Hi, I hope you are well.
I set the variable value but not working as below:

$agi->set_variable(“TIMEOUT(absolute)”, 30);
CLI display the hanguptime but not working.

Please see the image:

N.B. I have played the “/var/lib/asterisk/moh/macroform-cold_day” file after answering the call. The call is not being hanged up until the file played.

Please help.

Thanks.


#4

It seems you re using phpagi class , wrong way to set the timeout using this class


#5

$agi is an object of phpagi class. Object can be called anytime to use the class.


#6

What He is trying to say is that you are using the wrong command, try with EXEC


#7

Hi,
I hope you are well.

I am using the command:
originate Local/number@from-sip extension @from-sip

Call generate with no problem.

But $agi->set_variable(“TIMEOUT(absolute)”, 30); is not working
Though $agi->set_variable(“ERROR”, 123); is working fine.

Please help me.

Thanks.


#8

The correct syntax is SET VARIABLE <* variablename* > <* value *> , so you should provide a variable name TIMEOUT(absolute) it is a function not a variable. There are others method to set the timeout using this class like exec_absolutetimeout () or use

set_autohangup ()
Cause the channel to automatically hangup at $time seconds in the future.


#9

Whilst I’m not certain that this is the case for AGI, in most cases Asterisk actually uses the same, low level, code as the Set application, so will happily accept an LV context function call where it would accept the name of a variable.

Is it possible that the class library doesn’t like the parentheses?

(LV = left value, and indicates something that can be on the left of an assignment.)


#10

inside the set_variable function, the syntax is “SET VARIABLE <* variablename* > <* value *>” as you have written.

set_variable is a PHP function created by PHPAGI.

So, on a marginal edge, I can say:

The command “SET VARIABLE TIMEOUT(absolute) 30” is not working.
Please help.

Thanks.


#11

Have you try one of the above ?


#12

I have used this function: CLI shows:

WARNING[1603]: res_agi.c:2503 handle_exec: Could not find application (AbsoluteTimeout)


#13

Show your agi code please.


#14

$dialStr = “IAX2/” . $rtip[‘mac’] . ‘/’ . $number;
$dialRoute = $number . ‘@’ . $rtip[‘ip’] . ‘:’ . $rtip[‘port’];

$agi = new AGI();
$agi->set_variable(“CALLID”, $callid);
$agi->set_variable(“DIALSTR”, $dialStr);
$agi->set_variable(“ROUTE”, $dialRoute);
$agi->exec_absolutetimeout($maxduration);

$agi->verbose("\033[32m Dial Pattern:" . $dialStr . “. \033[0m”);
$agi->verbose("\033[32m Dial Route:" . $dialRoute . “. \033[0m”);
$agi->verbose("\033[32m Authentication: Access Granted. \033[0m");


#15

It seems to be fine, make sure the $maxduration value is set

http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI.html#exec_absolutetimeout


#16

Hi,
I hope you are well.
I have tried $agi->exec_absolutetimeout($maxduration); by several values directly without variable like
$agi->exec_absolutetimeout(30); or
$agi->exec_absolutetimeout(45); or
$agi->exec_absolutetimeout(60); etc.
But all attempts are failed.

Please help me the actual reason to fail.

Thanks.