Persistent socket/connection PHP for SMPP/SMS -


i need set persistent socket connection in php , not sure how achieve this. when send sms message a) open socket connection b) send message (via sms/smpp) , c) close socket connection

however need not open , close connection time. rather, require

- 2 persistent connections maintains connectivity smsc (sms centre) , reconnects when timeout occurs.  - 1 persistent connection reading sms , 1 sending sms. - automatic restart/recovery (i.e. when memory issues arise) - automatic looping act listener incoming events such receiving incoming delivery receipts , sms messages, 'ping' (enquire link) keep smpp connection alive. 

update: wondering if had achieved above using following: https://github.com/shaneharter/php-daemon

function pfsockopen seems have capabilities looking for. check out question - php pfsockopen in session.

===

a personal observation on implementation. assuming php code triggered incoming request , other times, smpp client inactive. may not quite suitable smpp few reasons:

  • smpp clients required send response pdu(s) inbound pdu receive smsc.
  • one of these pdu(s) enquire_link used keep connection alive. if smpp client fails return enquire_link_resp pdu, connection dropped. may experience more of these. using pfsockopen not solve problem.
  • if want offer delivery confirmation, smpp client must respond smsc.
  • if smpp client fails send response pdu pdu recieves smsc (if reads bytes pipe), smsc may resend of pdu(s). opens possible risks of creating unnecessary hit on smpp client machine.

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -