duanhemou9834 2019-02-17 14:00
浏览 46

如何从PHP向任何网络提供商发送USSD代码?

How can i send USSD code like *556# from php to any network provider like MTN,GLO or Airtel?

For instance, say I have two inputs where user can enter USSD code and Phone number. On getting to the server(PHP), the received code will be dialed on the received phone number and sent to the network provider. Is this possible?

  • 写回答

1条回答 默认 最新

  • dreamfly2016 2019-03-03 08:50
    关注

    I'm a bit late to answer this question, but just in case...

    I'm not 100% sure to understand your workflow, but basically, to dial USSD codes like *556# you need to be connected on the mobile network with a mobile device (like a usb modem) and a valid SIM card. USSD implementation in modems is, by my experience, quite partial: personally I'd used Huawei 180E modems but you may want to search the internet to find more recent references that implement USSD properly.

    For how to discuss with a mobile device, you might want to read this SO question/answer. Basically, your PHP code will open a serial connection on the modem, send some AT commands and wait for responses.

    I don't know your objectives, but obviously, it's one concurrent session of several seconds per modem, so this is not the right solution for a usage that requires even just one query per second. If this is the case, either your telco exposes some appropriate API you may query from outside or you may negotiate a direct integration with its platforms. In both cases, it won't be for free...

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?