如何通过STK AT指令确认Airtel GSM卡的充值请求?
It looks like you’re already in the main STK menu for your Airtel SIM (from the AT+STGI=25 output). First, let’s decode those hex strings to make sense of the menu options—they’re UTF-16BE encoded:
- Index 0: "Airtel Live!"
- Index 1: "Easy Charge" (this is the option you need for recharge)
- Index 2: "Easy VAS"
- Index 3: "Easy Bill Pay"
- Index 4: "Whats new?"
To complete the recharge confirmation, follow these actionable steps:
Step 1: Select the "Easy Charge" Menu Option
Send the AT+STGR command to choose the recharge menu. The syntax is AT+STGR=<menu_id>,<item_index>. Here, the menu ID is 25 and "Easy Charge" is at index 1:
AT+STGR=25,1
You’ll get an OK response, followed by a proactive command notification like +STIN:1 (meaning a new STK prompt is waiting).
Step 2: Retrieve the Next Proactive Command
Use AT+STGI=? to list available pending commands, then read the specific prompt with AT+STGI=<command_id>. This will show you the next step—usually asking for your recharge amount or PIN.
Step 3: Submit Your Recharge Details
Once you see the input prompt, use the AT+STGS command to send your data. The input must be encoded as UTF-16BE hex. For example, if entering a recharge amount of 100:
AT+STGS=6,"003100300030"
(The length value is twice the number of characters, since each UTF-16BE character takes 2 bytes.)
Step 4: Confirm the Recharge
After submitting your details, the SIM will show a confirmation prompt (e.g., "Confirm recharge of 100? Yes/No"). Use AT+STGR again to select the "Yes" option (typically index 0):
AT+STGR=<new_menu_id>,0
Replace <new_menu_id> with the menu ID returned in the confirmation prompt’s +STGI output.
Key Tips:
- Always wait for
OKresponses or+STINnotifications before sending the next command. - If you get errors like
ERRORor+CME ERROR, double-check your command syntax and ensure your input is correctly encoded. - Airtel SIMs might have minor menu variations, so adjust indices based on your actual
+STGIoutput.
内容的提问来源于stack exchange,提问作者Anto sujesh

