Answers.Body: <p>I use Twilio, but had this problem too. I found what i believe to be a bug in Civi's mailing code (which also handles sms'es).
  In the function <code>create</code> in <code>CRM/Mailing/BAO/Mailing.php</code> on line 1755, <code>getRecipients</code> are called without the last argument <code>$mode</code>, and <code>getRecipients</code> are executed as if it's an email and not an SMS. I added a check to see if it's and sms, and added the extra argument, and it worked for me:</p>
  
  <pre><code>  // Populate the recipients.
    if (empty($params['_skip_evil_bao_auto_recipients_'])) {
      // check if it's an sms
      $mode = $mailing-&gt;sms_provider_id ? 'sms' : NULL;
      self::getRecipients($job-&gt;id, $mailing-&gt;id, NULL, NULL, TRUE, $mailing-&gt;dedupe_email, $mode);
    }
  </code></pre>
  
  <p>Read more at the <a href="https://issues.civicrm.org/jira/browse/CRM-17331" rel="nofollow">issue I filed here.</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-07T10:24:52.900Z
Answers.LastActivityDate: 2015-10-07T10:24:52.900Z
Answers.UserDisplayName: Anders Iversen
Answers.Body: <p>You probably have to determine in which extension your error is, the SMS API or the Clickatell part. The SMS API is an extension, which you can find here: <a href="https://github.com/CiviCooP/org.civicoop.smsapi" rel="nofollow">https://github.com/CiviCooP/org.civicoop.smsapi</a></p>
  
  <p>It is probably a good idea to raise your issue in GitHub so the developers and maintainers are aware of it. According to the documentation the extension works with CiviCRM 4.5 and has not been upgraded to version 4.6. You can either ask the developers/maintainers if they already have any plans to upgrade the extension (and fix your error). Alternative is to upgrade the extension yourself if you can?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-17T05:26:10.687Z
Answers.Text: Can you see if an activity was recorded for the contact? If so, the API action in itself is OK but the actual sending of the SMS is not correct. The problem is then probably in the Clickatell part.
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-17T21:33:35.753Z
Answers.Text: No activity recorded when I look under mailing report activity and set it for outbound sms.  However, when I change the date range for the last 2 years it doesn't show any either and they were working.
Answers.UserDisplayName: user21507
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-17T05:20:34.450Z
Answers.LastActivityDate: 2015-06-17T05:20:34.450Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>SMS API version 1.2 &amp; Clickatell version 2 extensions were added.  Clickatell was set as an SMS Provider.  Clickatell was working with version 1 of the extension and 4.5.8 of civicrm.</p>
  
  <p>When sending the sms, there is no indication of a failure, it just never gets sent.</p>
  
  <p>Log file output - 2015-06-16 21:30:02   Send Scheduled SMS<br>
  Entity: Job Action: process_sms
  Summary
  Finished execution of Send Scheduled SMS with result: Success (a:0:{})
  Details</p>
  
  <p>Parameters parsed (and passed to API method): 
  a:1:{s:7:"version";i:3;}</p>
  
  <p>Full message: 
  Finished execution of Send Scheduled SMS with result: Success (a:0:{})</p>
  
  <pre><code>LOG FILE-
  Jun 16 22:45:02  [info] $INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishing scheduled jobs execution.' )  = #0 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(608): CRM_Core_Error::backtrace("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...", TRUE)
  #1 /home/depot/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(2380): CRM_Core_Error::debug_query("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...")
  #2 /home/depot/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject-&gt;_query("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...")
  #3 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(450): DB_DataObject-&gt;insert()
  #4 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/JobManager.php(237): CRM_Core_DAO-&gt;save()
  #5 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/JobManager.php(87): CRM_Core_JobManager-&gt;logEntry("Finishing scheduled jobs execution.")
  #6 /home/depot/public_html/drupal/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager-&gt;execute(FALSE)
  #7 /home/depot/public_html/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  #8 /home/depot/public_html/drupal/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  #9 /home/depot/public_html/drupal/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel-&gt;run("job", "execute", (Array:2), NULL)
  #10 /home/depot/public_html/drupal/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc(1533): civicrm_api("job", "execute", (Array:2))
  #11 [internal function](): drush_civicrm_api("job.execute", "auth=0")
  #12 /usr/bin/drush-4.x/includes/command.inc(131): call_user_func_array("drush_civicrm_api", (Array:2))
  #13 /usr/bin/drush-4.x/includes/command.inc(836): _drush_invoke_args("civicrm-api", (Array:2), "civicrm")
  #14 [internal function](): drush_command("job.execute", "auth=0")
  #15 /usr/bin/drush-4.x/includes/command.inc(236): call_user_func_array("drush_command", (Array:2))
  #16 /usr/bin/drush-4.x/drush.php(101): drush_dispatch((Array:22))
  #17 /usr/bin/drush-4.x/drush.php(41): drush_main()
  #18 {main}
  </code></pre>
  
Tags: <sms>
Title: SMS breaks when upgrading to version 2 of extension & 4.6.2 of CIVICRM
ThreadText: # SMS breaks when upgrading to version 2 of extension & 4.6.2 of CIVICRM
  
  (Asked by: username_0 on 2015-06-17)
  
  SMS API version 1.2 & Clickatell version 2 extensions were added.  Clickatell was set as an SMS Provider.  Clickatell was working with version 1 of the extension and 4.5.8 of civicrm.
  When sending the sms, there is no indication of a failure, it just never gets sent.
  Log file output - 2015-06-16 21:30:02   Send Scheduled SMS
  Entity: Job Action: process_sms
  Summary
  Finished execution of Send Scheduled SMS with result: Success (a:0:{})
  Details
  Parameters parsed (and passed to API method): 
  a:1:{s:7:"version";i:3;}
  Full message: 
  Finished execution of Send Scheduled SMS with result: Success (a:0:{})
  LOG FILE-
  Jun 16 22:45:02  [info] $INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishing scheduled jobs execution.' )  = #0 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(608): CRM_Core_Error::backtrace("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...", TRUE)
  #1 /home/depot/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(2380): CRM_Core_Error::debug_query("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...")
  #2 /home/depot/public_html/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_job_log (domain_id , description ) VALUES ( 1 , 'Finishin...")
  #3 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(450): DB_DataObject->insert()
  #4 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/JobManager.php(237): CRM_Core_DAO->save()
  #5 /home/depot/public_html/drupal/sites/all/modules/civicrm/CRM/Core/JobManager.php(87): CRM_Core_JobManager->logEntry("Finishing scheduled jobs execution.")
  #6 /home/depot/public_html/drupal/sites/all/modules/civicrm/api/v3/Job.php(99): CRM_Core_JobManager->execute(FALSE)
  #7 /home/depot/public_html/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_execute((Array:2))
  #8 /home/depot/public_html/drupal/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  #9 /home/depot/public_html/drupal/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("job", "execute", (Array:2), NULL)
  #10 /home/depot/public_html/drupal/sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc(1533): civicrm_api("job", "execute", (Array:2))
  #11 [internal function](): drush_civicrm_api("job.execute", "auth=0")
  #12 /usr/bin/drush-4.x/includes/command.inc(131): call_user_func_array("drush_civicrm_api", (Array:2))
  #13 /usr/bin/drush-4.x/includes/command.inc(836): _drush_invoke_args("civicrm-api", (Array:2), "civicrm")
  #14 [internal function](): drush_command("job.execute", "auth=0")
  #15 /usr/bin/drush-4.x/includes/command.inc(236): call_user_func_array("drush_command", (Array:2))
  #16 /usr/bin/drush-4.x/drush.php(101): drush_dispatch((Array:22))
  #17 /usr/bin/drush-4.x/drush.php(41): drush_main()
  #18 {main}
  
  **Tags:** sms
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-10-07. Score: 2
  
  I use Twilio, but had this problem too. I found what i believe to be a bug in Civi's mailing code (which also handles sms'es).
  In the function create in CRM/Mailing/BAO/Mailing.php on line 1755, getRecipients are called without the last argument $mode, and getRecipients are executed as if it's an email and not an SMS. I added a check to see if it's and sms, and added the extra argument, and it worked for me:
    // Populate the recipients.
    if (empty($params['_skip_evil_bao_auto_recipients_'])) {
      // check if it's an sms
      $mode = $mailing->sms_provider_id ? 'sms' : NULL;
      self::getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, $mailing->dedupe_email, $mode);
    }
  
  Read more at the issue I filed here.
  
  
  ---
  
  ### Answer by username_2 on 2015-06-17. Score: 0
  
  You probably have to determine in which extension your error is, the SMS API or the Clickatell part. The SMS API is an extension, which you can find here: <https://github.com/CiviCooP/org.civicoop.smsapi>
  
  It is probably a good idea to raise your issue in GitHub so the developers and maintainers are aware of it. According to the documentation the extension works with CiviCRM 4.5 and has not been upgraded to version 4.6. You can either ask the developers/maintainers if they already have any plans to upgrade the extension (and fix your error). Alternative is to upgrade the extension yourself if you can?
  
  > **Comments:**
  > **username_2**: Can you see if an activity was recorded for the contact? If so, the API action in itself is OK but the actual sending of the SMS is not correct. The problem is then probably in the Clickatell part.  
  > **username_0**: No activity recorded when I look under mailing report activity and set it for outbound sms.  However, when I change the date range for the last 2 years it doesn't show any either and they were working.  
  
  ---
  
  