SMS中的非拉丁符号(PHP,SMPP)

时间:2015-07-22 08:19:36

标签: php sms sms-gateway smpp

我尝试通过PHP,SMPP协议发送短信,并且必须使用Net_SMPP库。我的代码:

$smsc = new Net_SMPP_Client('xxx.xxx.xxx.xxx', xxxx);

// Make the TCP connection first
$smsc->connect();

// Now bind to the SMSC. bind() and unbind() return the response PDU.
$resp = $smsc->bind(array(
    'system_id' => '*****',
    'password' => '*******',
    'system_type' => ''
));
$message = "Привет!";
$message=iconv("utf-8", "UCS-2", $message);
$message=bin2hex ($message);

$ssm = Net_SMPP::PDU('submit_sm', array(
    'source_addr_ton'   => NET_SMPP_TON_ALNUM,
    'dest_addr_ton'     => NET_SMPP_TON_INTL,
    'source_addr'       => 'AnyName',
    'destination_addr' => '7**********',
    'short_message'     => $message,
    'dest_addr_npi' => 0x01,
    'data_coding' => NET_SMPP_ENCODING_ISO10646 //UCS2 coding
));
$smsc->sendPDU($ssm);

但是通过电话传来制动编码的信息(所谓的foursquares)。

因此,默认情况下更改data_coding

'data_coding' => NET_SMPP_ENCODING_DEFAULT

给出消息" 1f04400438043204350442042100" (我的消息的十六进制代码)。

我出了什么问题?

1 个答案:

答案 0 :(得分:1)

解决!

Global.asax