[asterisk-dev] Using a timer in chan_sip (classic one) ?

Pavel Troller patrol at sinus.cz
Thu Sep 19 07:41:03 CDT 2013


Hi!
  I'm writing a custom patch to chan_sip.c. Its purpose is to receive some
events through INFO messages (in principle, they are kind of a hookflash
event), count them, and when they stop arriving, send out a DTMF digit
towards the PBX (yes, it's intended as a pulse dialing emulation for
cheap gateways like SPA 2102, which don't implement real pulse dialing
reception).
  I've done most of the trivial work - wrote an extension to the
handle_request_info() function to receive these events, increment the
"pulse" counter and properly reply with 200 Ok to the peer. Now I need
help with the timer - I have to fire/reset a timer everytime such a message
arrives, and when it times out (no more "pulses" coming), the timeout
should trigger my routine, which will send the DTMF digit (I know how to
accomplish this) and reset the counter back to zero. This timer shouldn't
interfere with any other possible timers running for the session (Session
timers etc.). An advice pointing to a code sample, which does something
similar, would be enough.
  WIth regards, Pavel





More information about the asterisk-dev mailing list