get_code
get_code($wt_wait); - get activation code from SMS.
The function accepts parameters as input:
$wt_wait – wait *10 seconds.
After testing, the function returns the result of its work to the script :
true – the operation was successfully performedfalse – the operation was not completed
The resulting code itself can be obtained from the smsactivate->codevariable. However, if your text message is not parsed correctly, use the smsactivate->answervariable for parsing.
The smsactivate->answer variable can be:
STATUS_OK:$code - code received (where $code is the activation code)
STATUS_WAIT_CODE - waiting for SMS
STATUS_WAIT_RETRY:$lastcode - waiting for the code to be updated (where $lastcode is the last, failed code)
STATUS_WAIT_RESEND - waiting for SMS to be sent again (the software must click re-send SMS and change the status to 6)
STATUS_CANCEL - activation canceled
Possible error:
NO_ACTIVATION - activation id does not exist
ERROR_SQL - SQL server error
BAD_KEY - invalid API key
BAD_ACTION - Invalid action