I am new to asterisk and php I hope this is where I should be.
Problem is when I do an outdial if the person I call hangs up I get DIALSTATUS and ANSWEREDTIME when I do get_variable. If the calling person hangs up I get blank data for these two fields.
In looking around I found someone who said If I get the SIGHUP single that I can get these variables, that he did it and it worked for DIALSTATUS.
I get the signal. My understanding is that when the caller hangs up all data is cleared for next call.
If anyone can help I would appreciate it.
#!/usr/bin/php -q
<?php declare(ticks = 1); ob_implicit_flush(true); function sig_handler($signo) { global $calldata; global $agi; global $mycard; global $Config; trigger_error('SIG_HANDLER', E_USER_NOTICE); $result = $agi->get_variable('HANGUPCAUSE'); $hangup_res = $result['data']; trigger_error('outdial(): HANGUPCAUSE = '.$hangup_res, E_USER_NOTICE); $res = $agi->get_variable('DIALSTATUS'); $dstatus = $res['data']; trigger_error('outdial(): DIALSTATUS = '.$dstatus, E_USER_NOTICE); $result = $agi->get_variable("ANSWEREDTIME"); $ans_time = $result['data']; trigger_error('outdial(): Answer Time = '.$ans_time, E_USER_NOTICE); exit(0); } require_once('pp_outdial.php'); require_once('pp_logging.php'); require_once('phpagi.php'); require_once('pp_defines.php'); require_once('pp_utils.php'); require_once('pp_speak_and_collect.php'); require_once('pp_calldata_class.php'); require_once('Card.class.php'); require_once('CardDatabase.class.php'); require_once('DB.class.php'); require_once('Country.class.php'); require_once('PrePaidCard.class.php'); require_once('pp_config.class.php'); global $calldata; global $agi; global $mycard; global $Config; pcntl_signal(SIGHUP, "sig_handler"); My MAIN CODE ?>If someone needs more if let me know
John