Answer the question
In order to leave comments, you need to log in
How to get USSD response in Asterisk?
Good day, I use the PHPAGI library to work with Asterisk, but I just can’t figure out how to get a response that comes in a couple of seconds, and not immediately.
I have this code that sends a ussd request.
include('phpagi.php');
$manager = new AGI_AsteriskManager();
$manager->connect();
$manager->Command('dongle ussd dongle0 *111#');
$manager->disconnect();
include('phpagi.php');
$manager = new AGI_AsteriskManager();
$manager->connect();
$result = $manager->Command('dongle ussd dongle0 *111#');
$manager->disconnect();
print_r($result);
Array
(
[data] => Privilege: Command
[dongle0] USSD queued for send with id 0x7f5754001a80
[Response] => Follows
)
Answer the question
In order to leave comments, you need to log in
You have [Response] => Follows returned . Try like this:
include('phpagi.php');
$manager = new AGI_AsteriskManager();
$manager->connect();
$manager->Command('dongle ussd dongle0 *111#');
$result = $manager->wait_response();
$manager->disconnect();
print_r($result);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question