osip-dev
[Top][All Lists]
Advanced

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

Re: [osip-dev] 101 Dialog Established


From: FEICHTER Christoph
Subject: Re: [osip-dev] 101 Dialog Established
Date: Wed, 14 Oct 2015 12:38:01 +0000

hi,

 

thanks for the fix for my fix !

I recognized my mem-leak right after I pressed ‘send’ ;-)

 

br,

christoph

 

From: Aymeric Moizard [mailto:address@hidden
Sent: Mittwoch, 14. Oktober 2015 13:35
To: FEICHTER Christoph
Cc: address@hidden
Subject: Re: [osip-dev] 101 Dialog Established

 

Hi Christoph,

 

Again, tks for reporting & your patch proposal: I have commited the change

with an additionnal line to avoid a memory leak with "answer" not being deallocated!

 

Here is the patch in the git:

 

 

Tks a lot again.

Aymeric

 

 

diff --git a/src/udp.c b/src/udp.c

index 5edb6cf..1f85599 100644

--- a/src/udp.c

+++ b/src/udp.c

@@ -460,13 +460,14 @@ _eXosip_process_new_invite (struct eXosip_t *excontext, osip_transaction_t * tra

   }

 

   i = _eXosip_dialog_init_as_uas (&jd, evt->sip, answer);

+  osip_message_free (answer);

   if (i != 0) {

     OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_ERROR, NULL, "eXosip: cannot create dialog!\n"));

     osip_list_add (&excontext->j_transactions, transaction, 0);

     osip_transaction_set_reserved2 (transaction, NULL);

-    osip_message_free (answer);

     return;

   }

+

   _eXosip_check_allow_header (jd, evt->sip);

 

   ADD_ELEMENT (jc->c_dialogs, jd);

@@ -474,12 +475,8 @@ _eXosip_process_new_invite (struct eXosip_t *excontext, osip_transaction_t * tra

   osip_transaction_set_reserved2 (transaction, jc);

   osip_transaction_set_reserved3 (transaction, jd);

 

-  evt_answer = osip_new_outgoing_sipmessage (answer);

-  evt_answer->transactionid = transaction->transactionid;

-

   _eXosip_update (excontext);

   jc->c_inc_tr = transaction;

-  osip_transaction_add_event (transaction, evt_answer);

 

   /* be sure the invite will be processed

      before any API call on this dialog */

 

 

2015-10-14 12:24 GMT+02:00 Aymeric Moizard <address@hidden>:


Le 14 oct. 2015 10:09 AM, "FEICHTER Christoph" <address@hidden> a écrit :

...

> > Yes... Seems to be. Usually, sending a 180 is made as soon as you receive the invite. That's most probably the reason why I've never hit the issue.
>
> that’s a poor excuse in my opinion.
> the 100 Trying comes from the next proxy and should turn off the retransmissions,
> whereas the 180 Ringing is sent by the callee.
> did you experience how long the 180 Ringing might take, if the callee is a gateway to a mobile network (GSM, UMTS, …) ?
> it can take a couple of seconds, until the 180 Ringing is sent.

I'm just explaining why i never hit the issue: in all my app, i'm sending *immediatly* a 180 when receiving an invite! So last_response contains the 180, immediately... Evaluated to 10ms max! ;)

> what do you suggest how to fix it ?

I will check your patch but it looks good: I don't think the 101 needs to be stored or process by the state machine because it's only there for dialog: I will check the code as I'm replying with my mobile...

Regards
Aymeric

> my first approach was the following (seems to work):
>
> static void
>
> _eXosip_process_new_invite (struct eXosip_t *excontext, osip_transaction_t * transaction, osip_event_t * evt)
>
> {
>
>   ...
>
>   ...
>
>   ...
>
>  
>
>   osip_transaction_set_reserved2 (transaction, jc);
>
>   osip_transaction_set_reserved3 (transaction, jd);
>
>  
>
>   //evt_answer = osip_new_outgoing_sipmessage (answer);
>
>   //evt_answer->transactionid = transaction->transactionid;
>
>  
>
>   _eXosip_update (excontext);
>
>   jc->c_inc_tr = transaction;
>
>   //osip_transaction_add_event (transaction, evt_answer);
>
>  
>
>   /* be sure the invite will be processed
>
>      before any API call on this dialog */
>
>   osip_ist_execute (excontext->j_osip);
>
>  
>
>   if (transaction->orig_request != NULL) {
>
>     _eXosip_report_call_event (excontext, EXOSIP_CALL_INVITE, jc, jd, transaction);
>
>   }
>
>  
>
>   _eXosip_wakeup (excontext);
>
> }
>
>  
>
> what do you think about this ?
>
> > Regards
> > Aymeric
>
> > br,
> > christoph
> >  
> >  
> >
> > _______________________________________________
> > osip-dev mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/osip-dev
> >



 

--


reply via email to

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