Hello Team,
Hope you are doing well.
I’m using Asterisk AMI to generate outbound call on User phone. My requirement is to hit specific API when user not pick incoming call / number seems to busy and Phone number is switched off.
I have below sample code
fputs($socket, “Action: Login\r\n”);
fputs($socket, “UserName: $user\r\n”);
fputs($socket, “Secret: $pass\r\n\r\n”);
$wrets=fgets($socket,128);
//echo $wrets;
fputs($socket, “Action: Originate\r\n” );
fputs($socket, “Channel: SIP/$calling_number$channel\r\n” );
fputs($socket, “Exten: $calling_number\r\n” );
fputs($socket, “Context: text-context\r\n” );
fputs($socket, “Priority: 1\r\n” );
fputs($socket, “Callerid: 1234567\r\n\r\n” );
fputs($socket, “WaitTime: 15\r\n” );
fputs($socket, “Variable: api=http://www.google.com\r\n\r\n”);
fputs($socket, “Async: true\r\n” );
$wrets=fgets($socket,128);
Need your help on this .