Module: sip-router
Branch: ser_modules
Commit: ee6eee271dceec6e1d4d581edd389687697ccdc7
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ee6eee2…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Tue Jul 14 07:36:51 2009 +0000
presence_b2b: fix from & to header access
Access the parsed part of a From or To header only if non-zero
and/or parse_from_header() returned success.
---
modules_s/presence_b2b/euac_funcs.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules_s/presence_b2b/euac_funcs.c b/modules_s/presence_b2b/euac_funcs.c
index 04313c9..b147ffa 100644
--- a/modules_s/presence_b2b/euac_funcs.c
+++ b/modules_s/presence_b2b/euac_funcs.c
@@ -34,8 +34,10 @@ events_uac_t *find_euac_nolock(struct sip_msg *m)
parse_from_header(m);
memset(&id, 0, sizeof(id));
- if (m->to) id.loc_tag = ((struct to_body*)m->to->parsed)->tag_value;
- if (m->from) id.rem_tag = ((struct to_body*)m->from->parsed)->tag_value;
+ if (m->to && m->to->parsed)
+ id.loc_tag = ((struct to_body*)m->to->parsed)->tag_value;
+ if (parse_from_header(m)==0 && m->from->parsed)
+ id.rem_tag = ((struct to_body*)m->from->parsed)->tag_value;
if (m->callid) id.call_id = m->callid->body;
uac = (events_uac_t*)ht_find(&euac_internals->ht_confirmed, &id);