Answers.Body: <p>When you say parameters do you mean http get/post parameters? You would just access those in your callback the usual way in php. Or see for example the callback function for clickatell</p>
  
  <p><a href="https://github.com/veda-consulting/org.civicrm.sms.clickatell/blob/master/org_civicrm_sms_clickatell.php" rel="nofollow noreferrer">https://github.com/veda-consulting/org.civicrm.sms.clickatell/blob/master/org_civicrm_sms_clickatell.php</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-12T19:38:19.247Z
Answers.Text: Yes, I mean GET parameters. My SMS provider does not use 'status' parameter necessary for the callback() method to fire.
Answers.UserDisplayName: Djordje Marjanovic
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-12T19:56:37.353Z
Answers.Text: Then in your inbound() function you could also branch and call callback() as necessary.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-12T18:39:41.780Z
Answers.LastActivityDate: 2017-12-12T18:39:41.780Z
Answers.UserDisplayName: Demerit
Body: <p>I am creating a new extension to add a new SMS provider. Since different parameters are passed during callback, I need to override run method of the CRM_SMS_Page_Callback class. Since it is a part of CRM Core, what is the best way to do it?</p>
  
  <blockquote>
    <p>sites/all/modules/civicrm/CRM/SMS/Page/Callback.php</p>
  </blockquote>
  
  <pre><code>class CRM_SMS_Page_Callback {
  
    public function run() {
      $provider = CRM_SMS_Provider::singleton($_REQUEST);
  
      if (array_key_exists('status', $_REQUEST)) {
        $provider-&gt;callback();
      }
      else {
        $provider-&gt;inbound();
      }
    }
  
  }
  </code></pre>
  
Tags: <civisms>
Title: CRM_SMS_Page_Callback run method override
ThreadText: # CRM_SMS_Page_Callback run method override
  
  (Asked by: username_0 on 2017-12-12)
  
  I am creating a new extension to add a new SMS provider. Since different parameters are passed during callback, I need to override run method of the CRM\_SMS\_Page\_Callback class. Since it is a part of CRM Core, what is the best way to do it?
  
  > sites/all/modules/civicrm/CRM/SMS/Page/Callback.php
  
  ```
  class CRM_SMS_Page_Callback {
  
    public function run() {
      $provider = CRM_SMS_Provider::singleton($_REQUEST);
  
      if (array_key_exists('status', $_REQUEST)) {
        $provider->callback();
      }
      else {
        $provider->inbound();
      }
    }
  
  }
  
  ```
  
  **Tags:** civisms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-12-12. Score: 0 | Accepted answer
  
  When you say parameters do you mean http get/post parameters? You would just access those in your callback the usual way in php. Or see for example the callback function for clickatell
  
  <https://github.com/veda-consulting/org.civicrm.sms.clickatell/blob/master/org_civicrm_sms_clickatell.php>
  
  > **Comments:**
  > **username_0**: Yes, I mean GET parameters. My SMS provider does not use 'status' parameter necessary for the callback() method to fire.  
  > **username_1**: Then in your inbound() function you could also branch and call callback() as necessary.  
  
  ---
  
  