Sms gateway and API configuration

i am exploring new areas of Gibbon as i am about to finish the basic school setting and importing data.

one thing i want to test is if can ingegrate with out local bulk sms provider. as the provider obviously not list, what are the steps i can explore to start testing or this require deep development? i am about to receive API documentation from them but egger to know if i can do it from my side.

regards

Hi @alkindy It’s not too complex, with a little tinkering you may be able to get it to work. The SMS system is using the matthewbdaly/sms-client, which under the hood makes an HTTP api call using Guzzle to an API endpoint, and returns the result. Each provider has a different SMS driver file, since the endpoint and variable names will be different for each API. It’s mostly a matter of figuring out what your SMS API looks like, and then creating a driver for it. There will be at least one core file to change, src/Comms/SMS.php to add your driver to the constructor, and your new driver would go in the src/Comms/Drivers folder. If you get it working, feel free to PR your changes and we can include it in the core.

thank you @sandra for the support, i had a go to understand what you mentioned. and here is my humble under of the work to be done:

  1. I need to create a driver specifically for my sms provider. the file to be located at src/Comms/Drivers. i had a look at the example of the file that is there.

  2. I need to include this file in the src/Comms/SMS.php.

  3. I need to modify the modify the file in the module ‘System Admin’ thirdpartySettings.php so that the option of my provider to appear on the UI.

now for the implementation and after understanding the provider API and it is a simple one. there are 3 parameters beside the msg need to be include:

  • senderID
  • username
  • password

the names of these parameters are different than those already defined by other providers, so i think i have to define them in the database?!!!

in short i have to implement the function with what i understood and hope it works, so please correct my understanding if anything wrong or missing and wish me a good luck :slight_smile:

Regards

P.S: i tried the API using the provider postman package and it worked, but i noticed it has more than one POSt type.

{
“BankCode”: “XXXXXXX”,
“BankPWD”: “XXXXXXX”,
“senderID”: “Sender ID”,
“MsgText”: “This Message from Send Message Method”,
“MobileNo”: “XXXXXXXX”
}

===========

{
“BankCode”: “XXXXXXXX”,
“BankPWD”: “XXXXXXXX”,
“senderID”: “SMS Sender ID”,
“CampName”: “This is a Test Campaign”,
“MsgText”: “Test Message from Campaign Method”,
“MobilesNo”: [
{
“MobileNo”: “XXXXXXXXX”
},
{
“MobileNo”: “XXXXXXXXX”
}
]
}

=======================

{

“BankCode”: “Username”,
“BankPWD”: “Password”,
“senderID”:“SMS Sender”,
“CampName”:“This is a Test Campaign”,
“messages”:[
{“MobileNo”:“96898023140”,“MsgText”:“Test message 1”},
{“MobileNo”:“96894559377”,“MsgText”:“Test message 2”},
{“MobileNo”:“96898023140”,“MsgText”:“Test message 3”}
]

}

===============================

so witch one is more sutable one you think for Gibbon implementation use cases?

sorry for long post

Hi @alkindy I think the second option would work best, as it can send one message to multiple numbers, and this is the way Gibbon will pass the data to the driver, with a message string and a list of phone numbers.

Best of luck! We have a Slack channel for Gibbon developers, if you’d like to join feel free to email support@gibbonedu.org. It’s a pretty quiet channel, but it can be helpful if you have specific coding questions.

1 Like