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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Source vs. Target contact of Inbound SMS activities
Pages: [1]

Author Topic: Source vs. Target contact of Inbound SMS activities  (Read 582 times)

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Source vs. Target contact of Inbound SMS activities
February 16, 2015, 05:58:37 am
Good afternoon everyone.

We're looking at using a special SMS line from Clickatell ("tagged VMN", see here) that allows us to add extra digits to the end of the number. We will be able to add extra digits to the sender ID on our outbound messages, that will look to the contact like a longer-than-usual number. When the contact replies, we will see the long number they replied to and know exactly who their reply is aimed at. It's a bit like adding an extension number on a voice call. (What I'm about to say may also be useful to organisations who want to have multiple inbound SMS lines for their various staff/departments even with normal-length numbers.)

Inbound e-mail already allows this concept- an e-mail that hits a configured Email-to-Activity account is attached to all its recipients as target contacts, and the sender of the e-mail as a source contact. Our staff use this by BCC-ing an Email-to-Activity account when they communicate with contacts, creating a record in Civi. The source contact on an inbound e-mail is the sender of the e-mail, and the targets are all the recipients.

Inbound SMS allows this too- an SMS provider extension can pass the 'To' number, as well as the 'From' number, to CRM_SMS_Provider::processInbound(). If the 'To' number (our number) is not passed (as the Clickatell extension currently doesn't, but it's not a difficult addition), the source and target contacts on the Inbound SMS activity are set to the same contact, the contact who sent us the message. If the SMS provider extension does pass the 'To' number, however, the Inbound SMS is created with the source and target the opposite way round to how other communication activities are recorded. That is, the recipient (us) is recorded as the source contact and the sender (the remote contact) is recorded as the target. The code looks to have been this way in all branches since Civi moved from svn to git.

Is there any particular reason why Inbound SMS arranges the source and target the opposite way to Inbound Email, and has anyone run into this as an issue before?

Thanks,
David

Code from CRM_SMS_Provider::processInbound():
Code: [Select]
      $activityParams = array(
        'source_contact_id' => $toContactID,
        'target_contact_id' => $fromContactID,
        'activity_type_id' => $activityTypeID,
        'activity_date_time' => date('YmdHis'),
        'status_id' => $actStatusIDs['Completed'],
        'details' => $body,
        'phone_number' => $from
      );
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

sandeepmohanty

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: Drupal 7.32
  • MySQL version: 5.5.40
  • PHP version: 5.3.10
Re: Source vs. Target contact of Inbound SMS activities
March 18, 2015, 03:25:50 am
Hi,
   I am using civicrm version 4.4.6 in drupal 7. I am using Clickatell civicrm extension for sending sms. I configured in CiviCRM » Administer CiviCRM » SMS Provider section showing in attached screenshot. But when i am sending sms to a user in civicrm profile,,, it is showing error "Err : 144 Can't route message" . Tell me where it is wrong in my setting ??

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Source vs. Target contact of Inbound SMS activities
March 18, 2015, 03:35:38 am
Does the number you are sending to belong to a country that your Clickatell account allows you to send to? Is the contact's phone number recorded in international format including the country code? (eg. 447700123456 for UK)
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

sandeepmohanty

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: Drupal 7.32
  • MySQL version: 5.5.40
  • PHP version: 5.3.10
Re: Source vs. Target contact of Inbound SMS activities
March 18, 2015, 03:51:02 am
Quote from: DaveFF on March 18, 2015, 03:35:38 am
Does the number you are sending to belong to a country that your Clickatell account allows you to send to? Is the contact's phone number recorded in international format including the country code? (eg. 447700123456 for UK)


Ohh i just now added +91 which is the country code for India and sms sent successfully to that number.

Thanks

sandeepmohanty

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.5.3
  • CMS version: Drupal 7.32
  • MySQL version: 5.5.40
  • PHP version: 5.3.10
Re: Source vs. Target contact of Inbound SMS activities
March 18, 2015, 03:52:07 am
Hi DaveFF
  I am using civicrm in drupal for church management. I am facing one problem suppose one Member Filled the online membership form and when he will submit that webform.... He will get an Alert i.e. Your membership recived.  . Like that Suppose in contibution section How each church member will get SMS Alert ...individual contribution amount they contributed for church. Please Give me solution how to fix it ???

sivani

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5
Re: Source vs. Target contact of Inbound SMS activities
March 18, 2015, 10:41:12 pm
Hi,
  I am using clickatell civi extension in civicrm 4.4.6. I am using Drupal7 as cms. As sending sms is an activity in civicrm so i want to use sending sms activity in webform. In drupal (by using civicrm-webform integation) webform >> civicrm tab activity section outbound sms activity is there. How sending sms is working through Webform ?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Source vs. Target contact of Inbound SMS activities

This forum was archived on 2017-11-26.