⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendsms.php

📁 gnu的专业网关smpp协议支持源代码。
💻 PHP
📖 第 1 页 / 共 2 页
字号:
      	  $fields['text'] .= "%87"; # <PARM> with attributes      	  $fields['text'] .= "%".$val; # NAME=	  if ( in_array($key, $params_with_attr) ) {	    if ($otadebug == 1) { $fields['text'].="&lt;value key=$key val=".$fields[$key]."&gt;"; }      	    $fields['text'] .= "%" . $fields[$key]; # VALUE=CODE	  } else {	    if ($otadebug == 1) { $fields['text'].="&lt;value key=$key val=".$fields[$key]."&gt;"; }      	    $fields['text'] .= "%11"; # VALUE=      	    $fields['text'] .= "%03". plusencode($fields[$key]) . "%00"; # STRING	  }      	  $fields['text'] .= "%01"; # </PARM>	}	$fields[$key] = "";      }      $fields['text'] .= "%01"; # </CHARACTERISTIC>    $fields['text'] .= "%01"; # </CHARACTERISTIC_LIST>    sendsms();  }  else if ( $mode == "WAPPUSHSI") {    $fields['text'] = "";    $fields['udh'] = "%06%05%04%0B%84%23%F0";    $MIME=urlencode("application/vnd.wap.sic");    $fields['text'] .= "%01";   # Transaction ID    $fields['text'] .= "%06";  # PDU Type (push)    $fields['text'] .= "%04";        # Headers Length (content-type + headers)    $fields['text'] .= "%03";        # Length of content type    $fields['text'] .= "%AE";      # Content-Type: application/vnd.wap.sic    $fields['text'] .= "%81";      # Charset    $fields['text'] .= "%EA";      # UTF-8    # End Headers        # see si_binary_output    $fields['text'] .= "%02";  # Version number (wbxml_version)    $fields['text'] .= "%05";  # Unknown Public Identifier (si_public_id)    $fields['text'] .= "%6A";  # charset= (sibxml->charset)    $fields['text'] .= "%00";  # String table length    $fields['text'] .= "%45"; # <si>      $fields['text'] .= "%C6"; # <indication...	$fields['text'] .= "%0b" . "%03" . $fields['url'] . "%00";	# href=$url	$fields['text'] .= "%11" . "%03" . rand(1,9)."@vodafone.pt" . "%00";	# si-id=	$fields['text'] .= "%08"; # action="signal-high"	$fields['text'] .= "%0A" . "%C3%07%20%01%10%21%20%02%23"; # created=	$fields['text'] .= "%10" . "%C3%04%20%02%06%30"; # valid=        $fields['text'] .= "%01"; # end indication params 	$fields['text'] .= "%03" . urlencode($fields['name']). "%00";      $fields['text'] .= "%01"; # </indication>    $fields['text'] .= "%01"; # </si>    $fields['name']="";    $fields['url']="";    sendsms();  }  else if ( $mode == "WAPPUSHSL") {    $fields['text'] = "";    $fields['udh'] = "%06%05%04%0B%84%23%F0";    $MIME=urlencode("application/vnd.wap.slc");    #$fields['text'] .= "%01";   # Transaction ID    #$fields['text'] .= "%06";  # PDU Type (push)    #$fields['text'] .= "%04";        # Headers Length (content-type + headers)    #$fields['text'] .= "%03";       # length of content type    #$fields['text'] .= "%B0";      # Content-Type: application/vnd.wap.slc    #$fields['text'] .= "%81";      # Charset    #$fields['text'] .= "%EA";      # UTF-8    $fields['text'] .= "%01";   # Transaction ID    $fields['text'] .= "%06";  # PDU Type (push)    $fields['text'] .= "%1B";        # Headers Length (content-type + headers)    $fields['text'] .= "%1A";       # length of content type    $fields['text'] .= $MIME."%00";      # Content-Type: application/vnd.wap.slc    $fields['text'] .= "%81";      # Charset    $fields['text'] .= "%EA";      # UTF-8    # End Headers        # see si_binary_output    $fields['text'] .= "%02";  # Version number (wbxml_version)    $fields['text'] .= "%06";  # Unknown Public Identifier (si_public_id)    $fields['text'] .= "%6A";  # charset= (sibxml->charset)    $fields['text'] .= "%00";  # String table length    $fields['text'] .= "%85"; # <sl>      $fields['text'] .= "%0b"; # action="signal-high"      $fields['text'] .= "%08" . "%03" . $fields['url'] . "%00";	# href=$url    $fields['text'] .= "%01"; # </si>    $fields['name']="";    $fields['url']="";    sendsms();  }  else if ( $mode == "SIEMENS") {    $fields['coding'] = "2";    #print_r($mmc_file_raw);exit;    #move_uploaded_file($mmc_file_raw, "/tmp/siemens.tmp");    $h=fopen($mmc_file_raw, "rb");    $file = fread($h, filesize($mmc_file_raw));    fclose($h);    $file_size = strlen($file);    #$file = join("", file($mmc_file_raw));    #print strlen($file); exit;    $file = join("", unpack("H*", $file));    $file = preg_replace("/(..)/", "%$1", $file);    $max_size = 140 - 22 - 3 - strlen($mmc_file_name);    $file_type = $fields['mmc_file_type'];    $file_name = $fields['mmc_file_name'];    $fields['mmc_file'] = "";    $fields['mmc_file_type'] = "";    $fields['mmc_file_name'] = "";    $count = 0;     $max = ceil( $file_size / $max_size);    $packet_size = $max_size;    $object_size = sprintf("%08X", $file_size);    $object_size = "%". substr($object_size, 6, 2).  "%". substr($object_size, 4, 2).  "%". substr($object_size, 2, 2).  "%". substr($object_size, 0, 2);    print "max=$max, packetsize=$packet_size, objectsize=$object_size; file_size: ".$file_size."<p>";    while ($count < $max) {	    if ( $count == $max - 1 ) { # Last Packet	    	$packet_size = $file_size % $max_size;	    }    	    $fields['text'] = "";	    $fields['text'] .= "//SEO";	    $fields['text'] .= "%01"; # Version 1	    $fields['text'] .= "%". sprintf("%02X", $packet_size % 256). "%". sprintf("%02X", floor($packet_size / 256)); # Data Size on this message	    $fields['text'] .= "%00%00%00%00"; # Reference	    $fields['text'] .= "%". sprintf("%02X", ($count+1) % 256). "%". sprintf("%02X", floor(($count+1) / 256)); # Packet Number	    $fields['text'] .= "%". sprintf("%02X", $max % 256). "%". sprintf("%02X", floor($max / 256)); # Max Packets	    $fields['text'] .= $object_size; # Object Size	    $fields['text'] .= "%". sprintf("%02X", strlen($mmc_file_type)). $mmc_file_type; # Object Type	    $fields['text'] .= "%". sprintf("%02X", strlen($mmc_file_name)). $mmc_file_name; # Object File Name	    $fields['text'] .= substr($file, $count * $max_size * 3, $packet_size * 3);	    #print $fields['text']. "<br>";	    #$debug = 1;	    sendsms();	    $count++;    }  }  else {  	sendsms();  }  function sendsms (){  	global $fields, $debug, $kannel;	  $fields['mode'] = "";	  reset($fields);	  while(list($k,$v) = each($fields)) {	    if ( $v != "" ) {	      $string .= "&$k=$v";	    }	  }	    	  print ($debug ? "[DEBUG]" : "" )."Getting $string<br>";	  if ( !$debug ) { $result = @file("http://".$kannel['host'].":".$kannel['port']."/sendsms?user=".$kannel['user']."&pass=".$kannel['pass']."&".$string); }	  print_r( $result);  }  function plusencode($string) {	return preg_replace("/\+/", "%2B", $string);  }?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -