Esempio n. 1
0
 /**
  * @brief set callback url
  **/
 function setcallbackurl($callback_url)
 {
     $tbsp = array();
     $tbsp["VERSION"] = $this->VERSION_STR;
     $tbsp["MODULE-VERSION"] = $this->module_version;
     if ($this->app_version) {
         $tbsp["APP-VERSION"] = $this->app_version;
     }
     $tbsp["COMMAND"] = "CALLBACK-URL";
     $tbsp["URL"] = $callback_url;
     if ($this->crypt == "MD5") {
         $tbsp["CRYPT-METHOD"] = "MD5";
     }
     $tbsp["AUTH-ID"] = $this->userid;
     $tbsp["AUTH-PASS"] = $this->passwd;
     $version = "Unknown";
     if (function_exists("phpversion")) {
         $version = phpversion();
     }
     $language = "PHP-" . $version;
     $tbsp["LANGUAGE"] = $language;
     if ($this->options) {
         $tbsp["OPTIONS"] = $this->options;
     }
     $cscp_str = coolsms::cscp_build(coolsms::tbsp_build($tbsp));
     fputs($this->sockfp, $cscp_str);
     $tbspstr = coolsms::cscp_read($this->sockfp);
     if (!$tbspstr) {
         $this->errmsg = "cscp_read error";
         $this->__write_log__("cscp_read error");
         return $tbsp;
     }
     $tbsp = coolsms::tbsp_parse($tbspstr);
     if (!$tbsp) {
         $this->errmsg = "tbsp_parse error";
         $this->__write_log__("tbsp_parse error");
         return $tbsp;
     }
     return $tbsp;
 }