Get status of call (PHP: agi_manager)

I would like to know if anyone have an idea to get status of line with AGI_asteriskManager.

I have write a script that it return a response after a call but it’s a transmition with a transmittor and then he don’t answer.Then the response by the originate is always error - originate failed.

I would like to have the status of the line :
1 = Other end has hungup
2 = Local ring
3 = Remote end is ringing
4 = Remote end has answered
5 = Remote end is busy
6 = Make it go off hook
7 = Line is off hook
8 = Congestion (circuits busy)

thanks a lot for response or idea

a programmer despair

Since this is a common task for annoy-dialers there is a lot information in the web, you can try google. You can do thus via the manager not need to use call files with local channels.

i have checkon google if it’s so easely i don’t need to ask question to this forum.

i don’t want to use the normal manager because i need to init a call to test more than one device and then i want to write a script that he verify many transmittor and take the status of the call and sav it into a BDD

thx a lot

i have forgot to say that the script go turn with CRON to verify all issuers every 5 min it’s why i want to write a script

when i do a call i have

array(2) {
string(5) “Error”
string(16) “Originate failed”

and i have into my debug consol

== Manager ‘laurent’ logged on from
== Using SIP RTP CoS mark 5
– Got SIP response 480 “Temporarily Not Available” back from
> Channel SIP/ovh-simple-00000002 was never answered.
== Manager ‘laurent’ logged off from

i would like get the value response 480 into my script

I don’t know if that want to help but it’s my script:


<?php require_once('/var/lib/asterisk/agi-bin/phpagi-asmanager.php'); $number = '0032476976021'; $asm = new AGI_AsteriskManager(); if($asm->connect("localhost","laurent","123")) { $call = $asm->send_request('Originate', array('Channel'=>"SIP/$number@ovh-simple", 'Context'=>'default', 'Exten'=>'6633552244', 'Priority'=>1, 'Callerid'=>0033972451870)); if($call==null){ exit(1); } /* récup d'information sur une commande */ $info = $asm->send_request('Command', array('Command'=>'sip show channels')); var_dump($info); $asm->disconnect(); }else{ exit(1); } exit(0); ?>

i send request to call a peripherique and i need to receive the:
– Got SIP response 480 “Temporarily Not Available” back from

reponse into my script

plz if anyone have an idea, or a piste of solution! i go to surch but if i don’t know what i search :cry: because i’m a litlle lost and i try to find a solution but i don’t find a good idea…