[sr-dev] appending a new branch in route block

Juha Heinanen jh at tutpro.com
Sun May 16 15:47:14 CEST 2010


Juha Heinanen writes:

> is this how it is supposed to be?  if so, looks like i there is a bug in
> next_gw() in that it should clear the previous branch before adding a
> new one in case the previous branch was not consumed by t_relay?

i tried that by adding clear_branches() call before append_branch():

static int next_gw(...
...
	/* Subsequent invocation in route block or any invocation in
         * failure route block => clear possible unconsumed branches and
	 * append a new one. */
	clear_branches();
	uri_str.s = r_uri;
	uri_str.len = r_uri_len;
	LM_INFO("appending branch <%.*s>\n", uri_str.len, uri_str.s);
	if (append_branch(_m, &uri_str, 0, 0, Q_UNSPECIFIED, 0, 0) == -1) {
	    LM_ERR("when appending branch <%.*s>\n", uri_str.len, uri_str.s);
	    return -1;
	}

but still, syslog shows that the first branch is still in the
destination set:

  if (!next_gw()) { /* tries to append the next gw as a new branch */
    xlog("L_WARN", "No more gws\n");
    send_reply("503", "Service not available");
    exit;
  };
  xlog("found next gw <$ds>\n")

May 16 16:40:24 localhost /usr/sbin/sip-proxy[12343]: INFO: lcr [lcr_mod.c:1951]: appending branch <sip:00358407058055 at lohi.tutpro.com:5060>
May 16 16:40:24 localhost /usr/sbin/sip-proxy[12343]: ERROR: found next gw <Contact: sip:00358407058055 at sars.tutpro.com;transport=tcp,sip:00358407058055 at lohi.tutpro.com:5060>

what it is that i'm missing here?

-- juha



More information about the sr-dev mailing list