2007/8/29, Aleksander Piotrowski <[EMAIL PROTECTED]>: > i'm curious if it's possible to call my own callback function once particular > timer timesout? in my own application, i've got private structure that > is used to store internal state of sip call.
> i see the following message "nta: timer D fired, terminate > INVITE (88082665)" on stdout and i'd like to clean up my private structure > in such case, ie. once INVITE doesn't reach it's destination. You can clean your private structure and destroy the nta_outgoing_t client transaction already when the first 300-699 response is received. NTA keeps an internal reference to the transaction and starts the timer D. The server will retransmit the 300-699 response until it receives an ACK. When nta receives such a retransmission nta can resend ACK because it still has the reference to the outgoing client transaction in hash. When the timer D fires the internal reference is released and the transaction is removed from the hash tables. The 2XX response to INVITE is handled in different way. Instead of storing the invite client transaction in the hash table, the ACK transaction is kept there for the duration of timer K (same as D). The INVITE transaction can be destroyed immediately after sending the ACK, and ACK transaction catches the retransmitted 2XX responses (and retransmits ACK requests just like INVITE transaction does in 300-699 case). There is the brown paper bag bug (#1750691) related to this: http://sourceforge.net/tracker/index.php?func=detail&aid=1750691&group_id=143636&atid=756076 After the ACK timed out and a retransmitted 200 Ok was received, NTA silently sent an ACK and BYE message terminating the dialog without bothering to report the incident to application. This was made worse by the fact that ACK was destroyed by a 5 second timer, not 32 second timer. The timer B takes care of case when no response to INVITE is received. When it fires, NTA generates a 408 response message and the normal outgoing callback is called. See documentation of NTATAG_TIMEOUT_408() and nta_msg_is_internal(). However, the timer B is active only before a preliminary response is received. After the preliminary response is received, the timer C is activated. The RFC 3261 says that timer C is active in proxies only, and it has been previously left up to the application to implement. The latest NTA code in darcs have it, however, and you can activate it on your user-agent with the tag NTATAG_TIMER_C(185000) given to nta_agent_create(). -- Pekka.Pessi mail at nokia.com ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel