add: if (calculate_hooks(_d) < 0) { LOG(L_ERR, "dlg_new_resp_uac(): Error while calculating hooks\n"); return -2; }
context: static inline int dlg_new_resp_uac(dlg_t* _d, struct sip_msg* _m){	int code;	     /*	      * Dialog is in DLG_NEW state, we will copy remote	      * target URI, remote tag if present, and route-set 	      * if present. And we will transit into DLG_CONFIRMED 	      * if the response was 2xx and to DLG_DESTROYED if the 	      * request was a negative final response.	      */	code = _m->first_line.u.reply.statuscode;	if (code < 200) {		     /* A provisional response, do nothing, we could		      * update remote tag and route set but we will do that		      * for a positive final response anyway and I don't want		      * bet on presence of these fields in provisional responses		      *		      * Send a request to jan@iptel.org if you need to update		      * the structures here		      */	} else if ((code >= 200) && (code < 299)) {		     /* A final response, update the structures and transit		      * into DLG_CONFIRMED		      */		if (response2dlg(_m, _d) < 0) return -1;		_d->state = DLG_CONFIRMED;	} else {		     /* 		      * A negative final response, mark the dialog as destroyed		      * Again, I do not update the structures here becuase it		      * makes no sense to me, a dialog shouldn't be used after		      * it is destroyed		      */		_d->state = DLG_DESTROYED;		     /* Signalize the termination with positive return value */		return 1;	}	return 0;}