rem: error:
add: LOG(L_CRIT,"BUG:cpl-c:failed_reply: we shouldn't be here!!!!!\n"); exit:
context: static void reply_callback( struct cell* t, int type, struct tmcb_params* ps){	struct cpl_interpreter *intr = (struct cpl_interpreter*)(*(ps->param));	struct location        *loc  = 0;	int rez;	if (intr==0) {		LOG(L_WARN,"WARNING:cpl-c:reply_callback: param=0 for callback %d,"			" transaction=%p \n",type,t);		return;	}	if (type&TMCB_RESPONSE_OUT) {		/* the purpose of the final reply is to trash down the interpreter		 * structure! it's the safest place to do that, since this callback		 * it's called only once per transaction for final codes (>=200) ;-) */		if (ps->code>=200) {			DBG("DEBUG:cpl-c:final_reply: code=%d  -------------->\n"				" --------------------------> final reply received\n",			ps->code);			/* CPL interpretation done, call established -> destroy */			free_cpl_interpreter( intr );			/* set to zero the param callback*/			*(ps->param) = 0;		}		return;	} else if (!type&TMCB_ON_FAILURE) {		LOG(L_ERR,"BUG:cpl-c:reply_callback: unknown type %d\n",type);		goto error;	}	DBG("DEBUG:cpl-c:negativ_reply: ------------------------------>\n"		" ---------------------------------> negativ reply received\n");	intr->flags |= CPL_PROXY_DONE;	intr->msg = ps->req;	/* if it's a redirect-> do I have to added to the location set ? */	if (intr->proxy.recurse && (ps->code)/100==3) {		DBG("DEBUG:cpl-c:negativ_reply: recurse level %d processing..\n",				intr->proxy.recurse);		intr->proxy.recurse--;		/* get the locations from the Contact */		add_contacts_to_loc_set( ps->rpl, &(intr->loc_set));		switch (intr->proxy.ordering) {			case SEQUENTIAL_VAL:				/* update the last_to_proxy to last location from set */				if (intr->proxy.last_to_proxy==0) {					/* the pointer went through entire old set -> set it to the					 * updated set, from the beginning  */					if (intr->loc_set==0)						/* the updated set is also empty -> proxy ended */						break;					intr->proxy.last_to_proxy = intr->loc_set;				}				while(intr->proxy.last_to_proxy->next)					intr->proxy.last_to_proxy=intr->proxy.last_to_proxy->next;				break;			case PARALLEL_VAL:				/* push the whole new location set to be proxy */				intr->proxy.last_to_proxy = intr->loc_set;				break;			case FIRSTONLY_VAL:				intr->proxy.last_to_proxy = 0;				break;		}	}	/* the current proxing failed -> do I have another location to try ?	 * This applyes only for SERIAL forking or if RECURSE is set */	if (intr->proxy.last_to_proxy) {		/* continue proxying */		DBG("DEBUG:cpl-c:failed_reply: resuming proxying....\n");		switch (intr->proxy.ordering) {			case PARALLEL_VAL:				/* I get here only if I got a 3xx and RECURSE in on ->				 * forward to all location from location set */				intr->proxy.last_to_proxy = 0;				cpl_proxy_to_loc_set(intr->msg,&(intr->loc_set),intr->flags );				break;			case SEQUENTIAL_VAL:				/* place a new brach to the next location from loc. set*/				loc = remove_first_location( &(intr->loc_set) );				/*print_location_set(intr->loc_set);*/				/* update (if necessary) the last_to_proxy location  */				if (intr->proxy.last_to_proxy==loc)					intr->proxy.last_to_proxy = 0;				cpl_proxy_to_loc_set(intr->msg,&loc,intr->flags );				break;			default:				LOG(L_CRIT,"BUG:cpl_c:failed_reply: unexpected ordering found "					"when continuing proxying (%d)\n",intr->proxy.ordering);				goto error;		}	} else {		/* done with proxying.... -> process the final response */		DBG("DEBUG:cpl-c:failed_reply:final_reply: got a final %d\n",ps->code);		intr->ip = 0;		if (ps->code==486 || ps->code==600) {			/* busy response */			intr->ip = intr->proxy.busy;		} else if (ps->code==408) {			/* request timeout -> no response */			intr->ip = intr->proxy.noanswer;		} else if (((ps->code)/100)==3) {			/* redirection */			/* add to the location list all the addresses from Contact */			add_contacts_to_loc_set( ps->rpl, &(intr->loc_set));			print_location_set( intr->loc_set );			intr->ip = intr->proxy.redirect;		} else {			/* generic failure */			intr->ip = intr->proxy.failure;		}		if (intr->ip==0)			intr->ip = (intr->proxy.default_)?				intr->proxy.default_:DEFAULT_ACTION;		if (intr->ip!=DEFAULT_ACTION)			intr->ip = get_first_child( intr->ip );		if( intr->ip==DEFAULT_ACTION)			rez = run_default(intr);		else			rez = cpl_run_script(intr);		switch ( rez ) {			case SCRIPT_END:			case SCRIPT_TO_BE_CONTINUED:				return;			case SCRIPT_RUN_ERROR:			case SCRIPT_FORMAT_ERROR:				goto error;			default:				LOG(L_CRIT,"BUG:cpl-c:failed_reply: improper rezult %d\n",					rez);				goto error;		}	}error:	/* in case of error the default response choosed by ser at the last	 * proxying will be forwarded to the UAC */	free_cpl_interpreter( intr );	/* set to zero the param callback*/	*(ps->param) = 0;	return;}