add: global_msg_id=backup_msgid;
context: void on_negative_reply( struct cell* t, struct sip_msg* msg, 	int code, void *param ){	int act_ret;	struct sip_msg faked_msg;	enum route_mode backup_mode;	/* nobody cares about a negative transaction -- ok, return */	if (!t->on_negative) {		DBG("DBG: on_negative_reply: no on_negative\n");		return;	}	DBG("DBG: on_negative_reply processed for transaction %p\n", t);	/* create faked environment  -- uri rewriting stuff needs the	   original uri	*/#ifdef _OBSOLETED	memset( &faked_msg, 0, sizeof( struct sip_msg ));	faked_msg.flags=t->uas.request->flags;		/* original URI doesn't change -- feel free to refer to shmem */	faked_msg.first_line.u.request.uri=		t->uas.request->first_line.u.request.uri;#else    /*      on_negative_reply faked msg now copied from shmem msg (as opposed     to zero-ing) -- more "read-only" actions (exec in particular) will      work from reply_route as they will see msg->from, etc.; caution,      rw actions may append some pkg stuff to msg, which will possibly be      never released (shmem is released in a single block)    */	memcpy( &faked_msg, t->uas.request, sizeof(struct sip_msg));#endif	/* new_uri can change -- make a private copy */	if (t->uas.request->new_uri.s!=0 && t->uas.request->new_uri.len!=0) {		faked_msg.new_uri.s=pkg_malloc(t->uas.request->new_uri.len+1);		if (!faked_msg.new_uri.s) return;		faked_msg.new_uri.len=t->uas.request->new_uri.len;		memcpy( faked_msg.new_uri.s, t->uas.request->new_uri.s, 			faked_msg.new_uri.len);		faked_msg.new_uri.s[faked_msg.new_uri.len]=0;	} else { faked_msg.new_uri.s=0; faked_msg.new_uri.len=0; }	/* if we set msg_id to something different from current's message       id, the first t_fork will properly clean new branch URIs	*/	faked_msg.id=t->uas.request->id-1;	backup_mode=rmode;	rmode=MODE_ONREPLY_REQUEST;	act_ret=run_actions(reply_rlist[t->on_negative], &faked_msg );	rmode=backup_mode;	if (act_ret<0) {		LOG(L_ERR, "on_negative_reply: Error in do_action\n");	}#ifdef _OBSOLETED	/* this didn't work becaue URI is a part of shmem "monoblock";	   I could split it but it does not seem to be worth the	   effor	*/	/* project changes in faked message back to shmem copy */	t->uas.request->flags=faked_msg.flags;	if (faked_msg.new_uri.s) {		t->uas.request->new_uri.s=shm_resize(t->uas.request->new_uri.s,			faked_msg.new_uri.len);		if (!t->uas.request->new_uri.s) goto done;		memcpy(t->uas.request->new_uri.s, faked_msg.new_uri.s, 			faked_msg.new_uri.len );		t->uas.request->new_uri.len=faked_msg.new_uri.len;	}done:#endif	/* destroy faked environment, new_uri in particular */	if (faked_msg.new_uri.s) pkg_free(faked_msg.new_uri.s);}