如何使用PHP绑定USSD收发器

时间:2018-11-15 08:19:51

标签: php smpp ussd pdu

在分享我的问题之前,我一直在尝试使用SMPP协议实现USSD,我将讨论到目前为止已经取得的成就:

  1. 我已经能够通过VPN成功连接到电信公司
  2. 我已经能够启动SMPP连接并返回Response_Code'0'的适当响应,即'OK'
  3. 分别用command_id'0x00000001','0x00000009','0x00000002'绑定接收器,收发器和发送器,它们都返回预期的Response_Code,即“ OK”。

但是以下是我的问题:

  1. 我希望能够绑定,并且当用户拨打USSD短代码时,他们应该至少能够看到“ Hello World”
  2. 成功绑定“收发器”后,无法实现“ submit_sm”
  3. 我当前的代码实现方式是使用SMPP发送SMS,该SMS运行良好,但希望有另一种方法,例如$ tx-> runUSSD()代替$ tx-> sendSMS()

下面是我的代码,我相信使用此代码我应该能够做到,但是由于研究工作压力很大,我已经阅读并阅读了很多东西,但无法使其正常工作:

transciever.php

UIStackView

smpp.php

<?php
    print "<pre>";
        require_once "./smpp.php";
        $tx=new SMPP('Ip Address',Port);
        $tx->debug=true;
        $tx->addr_npi=1;
        print "open status: ".$tx->state."\n";
        $tx->bindTransceiver("system_id","password");
        $tx->sms_source_addr_npi=0;
        $tx->sms_source_addr_ton=5;
        $tx->sms_dest_addr_ton=1;
        $tx->sms_dest_addr_npi=1;

        $status = $tx->sendSMS("Hello","08023828392","Hello World");
        $tx->close();
        unset($tx);
        echo $status;
    print "</pre>";
?>

我希望收到你们的来信。 预先谢谢你。

0 个答案:

没有答案
相关问题