--- modules/tm/README 2003/02/03 22:43:54 1.1 +++ modules/tm/README 2003/02/03 22:48:29 @@ -107,6 +107,14 @@ turned it off for a transaction (like acc does to avoid unaccounted transactions due to expired timer) +Name: sticky_relay_to +Type: int (boolean) +Default: 0 (FALSE) +Desc: if set, in conjunction with t_on_negative() and t_relay_to() + it causes all branches appended in reply_route[] + block(s) to be forwarded to the same proxy as original + request. + Exported Functions: ------------------- --- modules/tm/t_funcs.c 2003/02/03 14:08:42 1.1 +++ modules/tm/t_funcs.c 2003/02/03 22:43:35 @@ -41,6 +41,7 @@ #include "config.h" #include "t_stats.h" +int sticky_relay_to = 0; /* ----------------------------------------------------- */ @@ -257,6 +258,11 @@ */ t=get_t(); t->local=replicate; + if (proxy != NULL && sticky_relay_to != 0) { + t->sticky_proxy = 1; + t->proxy = *proxy; + t->proxy.next = NULL; + } /* INVITE processing might take long, partcularly because of DNS look-ups -- let upstream know we're working on it */ --- modules/tm/t_funcs.h 2003/02/03 22:41:32 1.1 +++ modules/tm/t_funcs.h 2003/02/03 22:41:56 @@ -59,6 +59,7 @@ struct cell; extern int noisy_ctimer; +extern int sticky_relay_to; /* send a private buffer: utilize a retransmission structure --- modules/tm/h_table.h.orig Mon Nov 11 23:34:54 2002 +++ modules/tm/h_table.h Mon Feb 3 16:08:30 2003 @@ -225,6 +227,10 @@ #endif /* has the transaction been scheduled to die? */ enum kill_reason kr; + + /* "Sticky" proxy */ + int sticky_proxy; + struct proxy_l proxy; }cell_type; --- modules/tm/t_reply.c.orig Tue Oct 22 00:24:43 2002 +++ modules/tm/t_reply.c Mon Feb 3 16:20:00 2003 @@ -223,8 +236,10 @@ /* look if the callback introduced new branches ... */ init_branch_iterator(); if (next_branch(&dummy)) { + struct proxy_l *proxy = Trans->sticky_proxy ? + &Trans->proxy : NULL; if (t_forward_nonack(Trans, Trans->uas.request, - (struct proxy_l *) 0 ) <0) { + proxy ) <0) { /* error ... behave as if we did not try to add a new branch */ *should_store=0; --- modules/tm/tm.c.orig Tue Oct 22 00:24:43 2002 +++ modules/tm/tm.c Tue Feb 4 00:41:07 2003 @@ -195,7 +200,8 @@ "retr_timer1p3", "retr_timer2", "noisy_ctimer", - "uac_from" + "uac_from", + "sticky_relay_to" }, (modparam_t[]) { /* variable types */ INT_PARAM, /* fr_timer */ @@ -208,6 +214,7 @@ INT_PARAM, /* retr_timer2 */ INT_PARAM, /* noisy_ctimer */ STR_PARAM, /* uac_from */ + INT_PARAM, /* sticky_relay_to */ }, (void *[]) { /* variable pointers */ &(timer_id2timeout[FR_TIMER_LIST]), @@ -219,9 +226,10 @@ &(timer_id2timeout[RT_T1_TO_3]), &(timer_id2timeout[RT_T2]), &noisy_ctimer, - &uac_from + &uac_from, + &sticky_relay_to }, - 11, /* Number of module paramers */ + 12, /* Number of module paramers */ mod_init, /* module initialization function */ (response_function) t_on_reply,