diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-03 20:06:38 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-05-03 20:06:38 +0000 |
commit | da5692207a0f2842e57b13acbdbca911c708ba30 (patch) | |
tree | 98d99ae24df697782a6524127b180f87dd5f3a11 /channels | |
parent | 68694468d87f26b862115ad727d6a4f3db190ed8 (diff) |
Don't update route once it's set (bug #1491)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2876 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 30a40a0df..623659910 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -253,6 +253,7 @@ static struct sip_pvt { char refer_contact[AST_MAX_EXTENSION];/* Place to store Contact info from a REFER extension */ struct sip_pvt *refer_call; /* Call we are referring */ struct sip_route *route; /* Head of linked list of routing steps (fm Record-Route) */ + int route_persistant; /* Is this the "real" route? */ char remote_party_id[256]; char from[256]; char context[AST_MAX_EXTENSION]; @@ -3747,10 +3748,19 @@ static void build_route(struct sip_pvt *p, struct sip_request *req, int backward int len; char *rr, *contact, *c; + /* Once a persistant route is set, don't fool with it */ + if (p->route && p->route_persistant) { + ast_log(LOG_DEBUG, "build_route: Retaining previous route: <%s>\n", p->route->hop); + return; + } + if (p->route) { free_old_route(p->route); p->route = NULL; } + + p->route_persistant = backwards; + /* We build up head, then assign it to p->route when we're done */ head = NULL; tail = head; /* 1st we pass through all the hops in any Record-Route headers */ |