osip-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [osip-dev] Is osip_kill_transaction_callback called for all transact


From: Manuel Argüelles
Subject: Re: [osip-dev] Is osip_kill_transaction_callback called for all transactions?
Date: Thu, 21 Feb 2013 09:14:56 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Aymeric,

Thank for your promptly reply, yes, you are absolutely right, I just wasn't
waiting enough for the timeout to fire up.

Regards

On Thu, Feb 21, 2013 at 12:23:36PM +0100, Aymeric Moizard wrote:
> Hi Manuel,
> 
> If you receive an answer for NOTIFY (nist_snd_23456xx), you will see that:
> 1/ TIMER J is started
> 2/ state is converted to NIST_COMPLETED
> 
> If you are using reliable transport (TCP or TLS) you will have an immediate
> TIMER J being fired: thus, osip_nist_timeout_j_event will be called and the
> OSIP_NIST_KILL_TRANSACTION will happen.
> 
> If you are using unreliable transport (UDP), you will have TIMER J being
> fired later: (64 * DEFAULT_T1 = 32 seconds)
> 
> Thus, the osip_nist_timeout_j_event will be called and the
> OSIP_NIST_KILL_TRANSACTION but only after 32 seconds.
> 
> Hope I'm right?
> 
> Regards
> Aymeric
> 
> 2013/2/20 Manuel Argüelles <address@hidden>
> 
> > Hello everyone,
> >
> > This is my first message to the list, I have been using osip for a while
> > and
> > recently found what it seems to be memory leaks due to transactions not
> > destroyed.
> >
> > In my client I have registered callbacks with
> > osip_set_kill_transaction_callback
> > for OSIP_IST_KILL_TRANSACTION, OSIP_ICT_KILL_TRANSACTION,
> > OSIP_NICT_KILL_TRANSACTION and OSIP_NIST_KILL_TRANSACTION.
> >
> > Inside this callback (it is the same for the 4 of them), I call
> > osip_remove_transaction() and if succeed, the transaction is added to a
> > list
> > which elements are freed with osip_transaction_free() at the end of the
> > main
> > loop. I don't call osip_transaction_free() inside the callback since I read
> > somewhere that it shouldn't be done, is this still valid?
> >
> > The problem at the moment is with NOTIFY messages, I receive the NOTIFY,
> > build a
> > transaction for it, then build a response with OK and reply.
> >
> > This is a NIST and looks like the callback for OSIP_NIST_KILL_TRANSACTION
> > never
> > gets called.
> >
> > I fired gdb and this is what I got just before exiting:
> >
> >  osip_ict_transactions = {nb_elt = 0, node = 0x0},
> >  osip_ist_transactions = {nb_elt = 0, node = 0x0},
> >  osip_nict_transactions = {nb_elt = 0, node = 0x0},
> >  osip_nist_transactions = {nb_elt = 1, node = 0x7ffff0010220}
> >
> > Just one NIST transaction, which has:
> >
> >  transactionid = 6, transactionff = 0x7ffff0010190, topvia =
> > 0x7ffff000df20,
> >  from = 0x7ffff000e860, to = 0x7ffff000e890, callid = 0x7ffff000dae0,
> >  cseq = 0x7ffff000db40, orig_request = 0x7ffff000d670, last_response =
> > 0x7ffff00102b0,
> >  ack = 0x0, state = NIST_COMPLETED, birth_time = 1361370609,
> > completed_time = 0,
> >  in_socket = 0, out_socket = 0, config = 0x7ba610, ctx_type = NIST,
> > ict_context = 0x0,
> >  ist_context = 0x0, nict_context = 0x0, nist_context = 0x7ffff000dba0,
> > [...]
> >
> > The state is NIST_COMPLETED, shouldn't OSIP_NIST_KILL_TRANSACTION be
> > called by now?
> >
> > orig_request holds the NOTIFY sip message, last_response holds the OK.
> >
> > I have also been checking osip source code (I'm using version 3.3.0), and
> > it
> > seems that in nist_fsm.c OSIP_NIST_KILL_TRANSACTION callback is only
> > called for
> > timeouts and transport error.
> >
> > Do I need to call osip_remove_transaction() outside the
> > kill_transaction_callbacks? if so where? currently I only have it there and
> > inside callback for OSIP_ICT_STATUS_TIMEOUT and OSIP_NICT_STATUS_TIMEOUT
> > (which
> > I'm not 100% sure if it is correct).
> >
> > I also tried checking linphone source code which is supposed to use osip2,
> > but
> > it uses some higher level library (eXosip?) that I really don't want to
> > use...
> >
> > So I'll really appreciate if someone can give me some hints about the
> > correct
> > use and handling of transactions or point me to source code that uses
> > osip2 and
> > address this issues...
> >
> > Thanks,
> >
> > --
> > Paco
> >
> >
> > _______________________________________________
> > osip-dev mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/osip-dev
> >
> 
> 
> 
> -- 
> Antisip - http://www.antisip.com

-- 
Paco




reply via email to

[Prev in Thread] Current Thread [Next in Thread]