This is a PHP library for interacting with SMS functionality using Gammu.
- 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
use SMS\SMS;
$sms = new SMS('/path/to/gammu', '/path/to/config', 'section_name');
$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";
}
$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";
}
$messages = $sms->getMessages();
// Process and display the messages
foreach ($messages as $folder => $messageList) {
foreach ($messageList as $messageId => $message) {
// Process individual message data
}
}
$contacts = $sms->getPhoneBook();
// Process and display the contacts
foreach ($contacts as $index => $contact) {
// Process individual contact data
}
- Send SMS messages
- Delete SMS messages
- Retrieve SMS messages
- Access phonebook contacts
Contributions are welcome! Here's how you can contribute:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Test your changes.
- Submit a pull request.