DownloadSMS Library
This is a PHP library for interacting with SMS functionality using Gammu.
Table of Contents
Installation
Requirements
-
Runs on PHP 5.6 or above
-
Recomended PHP 7 or above
-
Gammu installed and configured
-
Clone the repository:
git clone https://github.com/your-username/sms-library.git
-
Install the library dependencies using Composer:
composer install
## Usage
### Initialize the SMS object
use SMS\SMS;
$sms = new SMS('/path/to/gammu', '/path/to/config', 'section_name'); ### Send an SMS
$number = '+1234567890';
$message = 'Hello, World!';
$response = '';
$sms->send($number, $message, $response);
if ($response) { echo "SMS sent successfully!\n";
} else { echo "Failed to send SMS.\n";
} ### Delete an SMS
$folder = 'inbox';
$start = 1;
$stop = 10;
$response = '';
$sms->delete($folder, $start, $stop, $response);
if ($response) { echo "SMS deleted successfully!\n";
} else { echo "Failed to delete SMS.\n";
} ### Get SMS Messages
$messages = $sms->getMessages();
// Process and display the messages
foreach ($messages as $folder => $messageList) { foreach ($messageList as $messageId => $message) {
// Process individual message data
}
} ### Get Phonebook Contacts
$contacts = $sms->getPhoneBook();
// Process and display the contacts
foreach ($contacts as $index => $contact) { // Process individual contact data
} ## Features
- Send SMS messages
- Delete SMS messages
- Retrieve SMS messages
- Access phonebook contacts
## Contributing
Contributions are welcome! Here's how you can contribute:
1. Fork the repository.
2. Create a new branch.
3. Make your changes.
4. Test your changes.
5. Submit a pull request.
|