rem: if ( T->inbound_request->first_line.u.request.method_value==METHOD_INVITE ) { if ( T->outbound_request_isACKed[branch] ) {    udp_send( T->outbound_request[branch]->retr_buffer, T->outbound_request[branch]->bufflen, (struct sockaddr*)&(T->outbound_request[branch]->to) , sizeof(struct sockaddr_in) ); } else if (p_msg->first_line.u.reply.statusclass>2 ) {    DBG("DEBUG: t_on_reply_received: >=3xx reply to INVITE: send ACK\n"); if ( t_build_and_send_ACK( T , branch , p_msg )==-1) { LOG( L_ERR , "ERROR: t_on_reply_received: unable to send ACK\n" ); return 0; } } }
add: reset_timer( hash_table, &(rb->retr_timer));
context: int t_on_reply_received( struct sip_msg  *p_msg ){   unsigned int  branch,len;   struct sip_msg *clone;   int relay;   clone=NULL;   /* parse_headers( p_msg , HDR_EOH ); */ /*????*/   /* this might be good enough -- is not like with      generating own responses where I have to      parse all vias to copy them   /* if a reply received which has not all fields we might want to      have for stateul forwarding, give the stateless router      a chance for minimum routing   */   if ( parse_headers(p_msg, HDR_VIA1|HDR_VIA2|HDR_TO|HDR_CSEQ )==-1 ||        !p_msg->via1 || !p_msg->via2 || !p_msg->to || !p_msg->cseq )	return 1;   /* we use label-matching to lookup for T */   t_check( p_msg , &branch );   /* if no T found ->tell the core router to forward statelessly */   if ( T<=0 )      return 1;   DBG("DEBUG: t_on_reply_received: Original status =%d\n",T->status);   /* we were not able to process the response due to memory      shortage; simply drop it; hopefuly, we will have more      memory on the next try */   relay = t_should_relay_response( T , p_msg->first_line.u.reply.statuscode );   if (relay && !(clone=sip_msg_cloner( p_msg )))     return 0;   /* stop retransmission */   remove_from_timer( hash_table , (&(T->outbound_request[branch]->tl[RETRASMISSIONS_LIST])) , RETRASMISSIONS_LIST );   /* stop final response timer only if I got a final response */   if ( p_msg->first_line.u.reply.statusclass>1 )      remove_from_timer( hash_table , (&(T->outbound_request[branch]->tl[FR_TIMER_LIST])) , FR_TIMER_LIST );   /* if a got the first prov. response for an INVITE -> change FR_TIME_OUT to INV_FR_TIME_UT */   if ( !T->inbound_response[branch] && p_msg->first_line.u.reply.statusclass==1 && T->inbound_request->first_line.u.request.method_value==METHOD_INVITE )      insert_into_timer( hash_table , (&(T->outbound_request[branch]->tl[FR_TIMER_LIST])) , FR_TIMER_LIST , INV_FR_TIME_OUT);   /* get response for INVITE */   if ( T->inbound_request->first_line.u.request.method_value==METHOD_INVITE )   {       if ( T->outbound_request_isACKed[branch] )       {   /*retransmit*/           udp_send( T->outbound_request[branch]->retr_buffer, T->outbound_request[branch]->bufflen,             (struct sockaddr*)&(T->outbound_request[branch]->to) , sizeof(struct sockaddr_in) );       }       else if (p_msg->first_line.u.reply.statusclass>2 )       {   /*on a non-200 reply to INVITE*/           DBG("DEBUG: t_on_reply_received: >=3xx reply to INVITE: send ACK\n");           if ( t_build_and_send_ACK( T , branch , p_msg )==-1)           {               LOG( L_ERR , "ERROR: t_on_reply_received: unable to send ACK\n" );               return 0;           }       }   }   #ifdef FORKING   /* skipped for the moment*/   #endif   /* if the incoming response code is not reliable->drop it*/   if (!relay)	return 0;   /* restart retransmission if provisional response came for a non_INVITE -> retrasmit at RT_T2*/   if ( p_msg->first_line.u.reply.statusclass==1 && T->inbound_request->first_line.u.request.method_value!=METHOD_INVITE )   {      T->outbound_request[branch]->timeout_value = RETR_T2;      insert_into_timer( hash_table , (&(T->outbound_request[branch]->tl[RETRASMISSIONS_LIST])) , RETRASMISSIONS_LIST , RETR_T2 );   }   /*store the inbound reply - if there is a previous reply, replace it */   if ( T->inbound_response[branch] ) {      sip_msg_free( T->inbound_response[branch] ) ;      DBG("DEBUG: t_store_incoming_reply: previous inbound reply freed....\n");   }   T->inbound_response[branch] = clone;   if ( p_msg->first_line.u.reply.statusclass>=3 && p_msg->first_line.u.reply.statusclass<=5 )   {      if ( t_all_final(T) && relay_lowest_reply_upstream( T , p_msg )==-1 && clone )      {        T->inbound_response[branch]=NULL;        sip_msg_free( clone );        return -1;      }   }   else   {      if (push_reply_from_uac_to_uas( T , branch )==-1 && clone ) {	T->inbound_response[branch]=NULL;	sip_msg_free( clone );	return -1;      }   }   /* nothing to do for the ser core */   return 0;}