From asterisk-dev Thu Sep 19 12:41:03 2013 From: Pavel Troller Date: Thu, 19 Sep 2013 12:41:03 +0000 To: asterisk-dev Subject: [asterisk-dev] Using a timer in chan_sip (classic one) ? Message-Id: <20130919124102.GA28909 () tangens ! sinus ! cz> X-MARC-Message: https://marc.info/?l=asterisk-dev&m=137959447925002 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 -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev