Originate call problem PHPAGI

Hi.
Currently, I’m connected to a SIP Provider and my connection, extension.conf, sip.conf is OK. Also I can make outbound calls with call files without any error.
But when I try to originate a call with a php file using PHPAGI, I get Response = Error
Message = Originate failed and also “487 request terminated”. Strangely, the phone rings only once and stops.
I know that PHPAGI AMI connection is correctly established. So, what can be my problem?

Thanks.

AFAIK 487 is sent after you request CANCEL for an on going request.
For example, you call somebody, their side starts ringing and you hangup.

Did you try tracing the SIP messages to see what’s going on?