2017 © Pedro Peláez
 

library laravel-asterisk-notification-channel

Asterisk Notifications Driver

image

enniel/laravel-asterisk-notification-channel

Asterisk Notifications Driver

  • Friday, February 3, 2017
  • by enniel
  • Repository
  • 1 Watchers
  • 2 Stars
  • 217 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 14 % Grown

The README.md

Asterisk notification channel for Laravel 5.3

This package makes it easy to send notifications using Asterisk Manager Interface (AMI) and Asterisk Chan Dongle with Laravel 5.3., (*1)

Contents

Installation

You can install this package via composer:, (*2)

``` bash composer require laravel-notification-channels/asterisk, (*3)


Next add the service provider to your `config/app.php`: ```php ... 'providers' => [ ... NotificationChannels\Asterisk\AsteriskServiceProvider::class, ], ...

Setting up the Asterisk service

See enniel/ami documentation., (*4)

Usage

Now you can use the channel in your via() method inside the notification:, (*5)

``` php use NotificationChannels\Asterisk\AsteriskChannel; use NotificationChannels\Asterisk\AsteriskMessage; use Illuminate\Notifications\Notification;, (*6)

class ExampleNotification extends Notification { public function via($notifiable) { return [AsteriskChannel::class]; }, (*7)

public function toAsterisk($notifiable)
{
    return AsteriskMessage::create('message text');
}

}, (*8)



In order to let your Notification know which phone number you are targeting, add the `routeNotificationForAsterisk` method to your Notifiable model. **Important note**: Asterisk requires the recipients phone number to be in international format. For instance: 0031612345678 ```php public function routeNotificationForAsterisk() { return '0031612345678'; }

Available message methods

  • content('test'): Set message text.
  • device('modem1'): Set device for sending SMS message.

Testing

bash $ composer test, (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions