CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Creating new sms provider
Pages: [1]

Author Topic: Creating new sms provider  (Read 1699 times)

qizhang

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: 7
  • MySQL version: 5.1.41
  • PHP version: 5.2
Creating new sms provider
October 07, 2012, 08:19:38 am
Hi,
I found that clickatell is the only supported sms provider in 4.2. Is there any way to creat new provider in my project? I tried to find a document for that but failed. Can anybody give any reference? Thanks in advance.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Creating new sms provider
October 07, 2012, 08:53:16 am

Might want to mimic the clickatell code and see what other changes you need to enable other SMS providers

pretty sure the code has been designed so other SMS providers can easily plug in similar to payment processors etc. However i dont think its currently documented. Ping us on IRC and we can help u get started. Would be great if you can document it while u r working on it

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

qizhang

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: 7
  • MySQL version: 5.1.41
  • PHP version: 5.2
Re: Creating new sms provider
October 08, 2012, 08:20:28 am
Donald,
Thanks a lot for your response. It is a good idea to refer to the existing clickatell provider implementation.
I took a look at the source code today, a good news is there is only one file(it looks like at least) to define the clickatell provider: civicrm/CRM/SMS/Provider/Clickatell.php. Looking into this file and its parent class CRM_SMS_Provider(civicrm/CRM/SMS/Provider.php), I got some questions to implement a SMS provider:
1. To add a new SMS provider, is it enough to create a new class extends CRM_SMS_Provider and put it to the same location with Clickatell.php?
2. The "send" method is defined as abstract in CRM_SMS_Provider so it must be implemented in Clickatell. However, some other methods defined in Clickatell are not abstract, like authenticate, callback, inbound. These methods are called in which class? Is there any information which method I have to define in my provider?

Thanks in advance for your information. I will put all information together into one document after I created my SMS provider.

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Creating new sms provider
October 08, 2012, 08:28:22 pm
Quote
1. To add a new SMS provider, is it enough to create a new class extends CRM_SMS_Provider and put it to the same location with Clickatell.php?

Yes

Quote
2. The "send" method is defined as abstract in CRM_SMS_Provider so it must be implemented in Clickatell. However, some other methods defined in Clickatell are not abstract, like authenticate, callback, inbound. These methods are called in which class? Is there any information which method I have to define in my provider?

Authentication though not mandatory, can happen during initialization / creation of object, as it happens with clickatell.

Send method should be enough for testing or starting with a new provider.

Callback is used for receiving errors or status updates on the messages already sent.

Inbound is used for handling messages replies.

So callback & inbound i would say are optional to start with. And you can come back to them when advanced options are to be considered.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

qizhang

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: 7
  • MySQL version: 5.1.41
  • PHP version: 5.2
Re: Creating new sms provider
October 29, 2012, 01:12:10 am
hi,
I created a new Class for my SMS provider and put it to the same location with Clickatell.php, however, it is not show up in the SMS provider dropdown list in setting SMS provider page. What should I do to add a new option there? Do I need to follow the normal extension installation steps for a SMS Provider?

Thanks

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Creating new sms provider
October 29, 2012, 02:44:40 am
Quote
however, it is not show up in the SMS provider dropdown list in setting SMS provider page

There should be an option group named - "SMS Provider Internal Name". You will have to add another option there to make your provider listed.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Creating new sms provider
October 31, 2012, 03:54:43 pm
Who are you using as your new provider?
« Last Edit: October 31, 2012, 07:14:20 pm by bpmccain »

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Creating new sms provider
October 31, 2012, 07:15:15 pm
I have a very basic (send only) implementation for Twilio up and running now. I'm going to clean it up and submit it for future releases (or would this be an extension?)

mmikitka

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
Re: Creating new sms provider
April 19, 2013, 07:46:12 pm
I successfully configured the Twilio extension in 4.3 via the following steps:

1) Prepare your environment for extensions: wiki.civicrm.org/confluence/display/CRMDOC43/Extensions

2) Install the twilio SMS provider extension: civicrm.org/extensions/twilio-sms-provider

3) Follow the SMS configuration steps as per wiki.civicrm.org/confluence/display/CRMDOC43/Setting+up+a+SMS+Provider+for+CiviSMS

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Creating new sms provider

This forum was archived on 2017-11-26.