# Africa's Talking SMS & USSD Project
This project demonstrates sending SMS and creating a USSD service using **Africa's Talking API** in Python.
---
## System Flow
### 1. SMS Flow
1. User triggers an SMS via the Python script (`send_sms.py`).
2. The script sends the message using Africa's Talking SMS API.
3. Africa's Talking returns a response containing:
- Message ID
- Status (`Success` / `Failed`)
- Cost
4. User receives the message on their phone (delivery may be affected by carrier filters).
5. Logs or database can be used to record sent messages for tracking.
**Example Output:**
---
### 2. USSD Flow
1. User dials the USSD code provided by Africa's Talking.
2. The `ussd1.php` script receives POST requests from the Africa's Talking gateway.
3. Menu logic determines the response:
- `CON` for intermediate menus (user can reply)
- `END` for final responses (session ends)
4. Example options implemented:
- **1. Check Fee Balance** → Returns balance dynamically from database
- **2. Register Course** → Confirms registration
5. All requests are logged in `logs.txt`.
**Example Output:**
---
### 3. Logging & Storage
- **File Logging:** All incoming USSD requests and SMS are logged in `logs.txt`: