komuw / naz

naz is an async SMPP client.
https://komuw.github.io/naz/
MIT License
39 stars 12 forks source link

implement SMPP timers that concern ESME #73

Open komuw opened 5 years ago

komuw commented 5 years ago

see; sections 2.9 and 7.2 of SMPP specification document v3.4

One of those timers is;

name: enquire_link_timer Action_on_expiration: An enquire_link request should be initiated. Description: This timer specifies the time lapse allowed between operations after which an SMPP entity should interrogate whether it’s peer still has an active session. This timer may be active on either communicating SMPP entity (i.e. SMSC or ESME).

We have already kind of implemented this timer: https://github.com/komuw/naz/blob/006790186d547da8132a89bfd385a6fc79a46cf3/naz/client.py#L60 Maybe change it's name from enquire_link_interval to enquire_link_timer so as to match SMPP spec document.

The other timers are:

  1. session_init_timer: This timer should be active on the SMSC.
    Action_on_expiration: The network connection should be terminated.
    Description: This timer specifies the time lapse allowed between a network connection being established and a bind_transmitter or bind_receiver request being sent to the SMSC.
    naz does not need to implement it.
  2. inactivity_timer: can be active on both ESME & SMSC.
    Action_on_expiration: The SMPP session should be dropped.
    Description: This timer specifies the maximum time lapse allowed between transactions, after which period of inactivity, an SMPP entity may assume that the session is no longer active.
    naz does not need to implement it.
  3. response_timer: can be active on both ESME & SMSC.
    Action_on_expiration: The entity which originated the SMPP Request may assume that Request has not been processed and should take the appropriate action for the particular SMPP operation.
    Description: This timer specifies the time lapse allowed between an SMPP request and the corresponding SMPP response.
    naz does not need to implement it.
komuw commented 5 years ago

So apart from enquire_link_timer which we have already implemented; naz does not need to implement the others.

But naz would need to honour them if they are set on the SMSC side. eg if naz knows the inactivity_timer on the SMSC side; naz could always send an enquire_link request every X seconds where X < inactivity_timer so as to prevent session from been dropped/closed.

komuw commented 5 years ago

I can't see any way that naz or any ESME would be able to know of the timers set on the SMSC side; the SMPP spec does not provide API's to query for these.

So there is nothing for naz todo here.

However if someone is using naz and their SMSC have informed them(out of band) of their(SMSC) timers; then they should comment on this issue and maybe then naz can provide a way for such a user to set those timers on naz and have naz respect them.

komuw commented 5 years ago

In other words, I'm deferring the implementation of this until such a time we get reports from actual people using naz that they need such a feature.