How to get SIPCALLID after Dial to SIP channel with AGI PHP?

Hi. All.

I hope you understand what I’m asking. I’m not good at English.

I’ve been served outbound call service to multiple users.

I’ve been tried to get SIPCALLID in php agi.
I could get it when users receive a call. But if not, I couldn’t get it.

To play voice message to user, I do like this.
Step 1. Originate to Local channel( Local/s@message ) with data(voice.php) parameter

  • When user receive a call, asterisk run voice.php and play voice message.

Step 2. extensions.ael
context sendmessage{
s => {

Step 3. In dial.php, Dial to SIP Channel (like SIP/
The source is the below.

$dialstr = “SIP/1710xxxxxx@” . $proxy;

	$myres = $agi->exec("Dial $dialstr|60");	
	$answeredtime = $agi->get_variable("ANSWEREDTIME");
	$this->answeredtime = $answeredtime['data'];            
	$dialstatus = $agi->get_variable("DIALSTATUS");
	$this->dialstatus = $dialstatus['data'];
	$trumpia -> debug( VERBOSE | WRITELOG, $agi, __FILE__, __LINE__, "dial status : " . $this->dialstatus);

when user receive a call, asterisk run voice.php(which I passed as parameters when originate, Step 1) and play voice message.
At this time, I can get SIPCALLID. Because voice.php is running on SIP channel.

BUT when user doesn’t receive a call, I cannot do anything with dial.php.
I thought that after Dial command in dial.php, dial.php lose a call control. Asterisk has it.
And after the call is disconnected(status No Answered), a call control didn’t come back into dial.php.

When CONGESTION or BUSY status, a call control came back into dial.php.
When ANSWERED or NO ANSWERED status, a call control didn’t come back into dial.php.

I tried to use h extension in my extensions.ael. It didn’t work.

Is there any way to get SIPCALLID even if user receive a call or not?
somebody help~