How to determine return application return value from ami?

i have made a little php script which uses chan_mobile to send sms.

fputs($oSocket, "Action: Originate\r\n");
fputs($oSocket, "Channel: Local/111@aadummy\r\n");
fputs($oSocket, "Application: MobileSendSMS\r\n");
fputs($oSocket, "Data: XGSMGate,".$strExten.",".$strMsg."\r\n");

in certain situations the sms can’t be sent (i.e. when phone is busy).
These errors are logged in the logfile, but now is my question:

In above code i’ve provided a wrong channel (XGSMGate instead of GSMGate) which generates following error in logfile:

       > Launching MobileSendSMS(XGSMGate,z,) on Local/111@aadummy-98cd;1
[Feb  7 21:55:16] ERROR[7325]: chan_mobile.c:469 mbl_sendsms_exec: NULL Message to be sent -- SMS will not be sent.

Is there a possibility to obtain this status from my PHP script, or at least to discover that the action went wrong?

I’ve searched for a solution for a couple of days but i’m not getting anywhere.