summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2008-07-30 20:24:40 +0000
committerMark Michelson <mmichelson@digium.com>2008-07-30 20:24:40 +0000
commit560475ba740d9b4dba066d8c6e65f6050f4c0d28 (patch)
tree46f94a456730c090f403d12a0af93bdd6fa3caeb
parent6787c68974a64f8f630b402086d19680d3d84680 (diff)
Fix the parsing of the "reason" parameter in the
Diversion: header. (closes issue #13195) Reported by: woodsfsg git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index af353db1a..9d2564d99 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11006,6 +11006,8 @@ static int get_rdnis(struct sip_pvt *p, struct sip_request *oreq)
if (ast_strlen_zero(tmp))
return 0;
+ params = strchr(tmp, ';');
+
exten = get_in_brackets(tmp);
if (!strncasecmp(exten, "sip:", 4)) {
exten += 4;
@@ -11017,7 +11019,7 @@ static int get_rdnis(struct sip_pvt *p, struct sip_request *oreq)
}
/* Get diversion-reason param if present */
- if ((params = strchr(tmp, ';'))) {
+ if (params) {
*params = '\0'; /* Cut off parameters */
params++;
while (*params == ';' || *params == ' ')