aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-06 17:18:35 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-06 17:18:35 +0000
commit1975038c4831c42a5732568cedb5334262d882d5 (patch)
tree5d730a715af8ff4d0d8af37984dda234ae505dbc /channels
parente17d56ebe89b6916e7849c182654224a8a4348cc (diff)
Merged revisions 173967-173968 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r173967 | file | 2009-02-06 13:14:15 -0400 (Fri, 06 Feb 2009) | 4 lines Some clients do not put the call-id for replaces at the beginning, so support it being anywhere in the string. (closes issue #14350) Reported by: fhackenberger ........ r173968 | file | 2009-02-06 13:15:01 -0400 (Fri, 06 Feb 2009) | 2 lines Remove a debug message I put in by accident. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173974 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c81
1 files changed, 39 insertions, 42 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 98a3a75c1..365bd5b63 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -12450,49 +12450,46 @@ static int get_refer_info(struct sip_pvt *transferer, struct sip_request *outgoi
}
/* Check for arguments in the refer_to header */
- if ((ptr = strchr(refer_to, '?'))) { /* Search for arguments */
- *ptr++ = '\0';
- if (!strncasecmp(ptr, "REPLACES=", 9)) {
- char *to = NULL, *from = NULL;
-
- /* This is an attended transfer */
- referdata->attendedtransfer = 1;
- ast_copy_string(referdata->replaces_callid, ptr+9, sizeof(referdata->replaces_callid));
- ast_uri_decode(referdata->replaces_callid);
- if ((ptr = strchr(referdata->replaces_callid, ';'))) /* Find options */ {
- *ptr++ = '\0';
- }
-
- if (ptr) {
- /* Find the different tags before we destroy the string */
- to = strcasestr(ptr, "to-tag=");
- from = strcasestr(ptr, "from-tag=");
- }
-
- /* Grab the to header */
- if (to) {
- ptr = to + 7;
- if ((to = strchr(ptr, '&')))
- *to = '\0';
- if ((to = strchr(ptr, ';')))
- *to = '\0';
- ast_copy_string(referdata->replaces_callid_totag, ptr, sizeof(referdata->replaces_callid_totag));
- }
-
- if (from) {
- ptr = from + 9;
- if ((to = strchr(ptr, '&')))
- *to = '\0';
- if ((to = strchr(ptr, ';')))
- *to = '\0';
- ast_copy_string(referdata->replaces_callid_fromtag, ptr, sizeof(referdata->replaces_callid_fromtag));
- }
-
- if (!sip_cfg.pedanticsipchecking)
- ast_debug(2, "Attended transfer: Will use Replace-Call-ID : %s (No check of from/to tags)\n", referdata->replaces_callid );
- else
- ast_debug(2, "Attended transfer: Will use Replace-Call-ID : %s F-tag: %s T-tag: %s\n", referdata->replaces_callid, referdata->replaces_callid_fromtag ? referdata->replaces_callid_fromtag : "<none>", referdata->replaces_callid_totag ? referdata->replaces_callid_totag : "<none>" );
+ if ((ptr = strcasestr(refer_to, "replaces="))) {
+ char *to = NULL, *from = NULL;
+
+ /* This is an attended transfer */
+ referdata->attendedtransfer = 1;
+ ast_copy_string(referdata->replaces_callid, ptr+9, sizeof(referdata->replaces_callid));
+ ast_uri_decode(referdata->replaces_callid);
+ if ((ptr = strchr(referdata->replaces_callid, ';'))) /* Find options */ {
+ *ptr++ = '\0';
+ }
+
+ if (ptr) {
+ /* Find the different tags before we destroy the string */
+ to = strcasestr(ptr, "to-tag=");
+ from = strcasestr(ptr, "from-tag=");
+ }
+
+ /* Grab the to header */
+ if (to) {
+ ptr = to + 7;
+ if ((to = strchr(ptr, '&')))
+ *to = '\0';
+ if ((to = strchr(ptr, ';')))
+ *to = '\0';
+ ast_copy_string(referdata->replaces_callid_totag, ptr, sizeof(referdata->replaces_callid_totag));
}
+
+ if (from) {
+ ptr = from + 9;
+ if ((to = strchr(ptr, '&')))
+ *to = '\0';
+ if ((to = strchr(ptr, ';')))
+ *to = '\0';
+ ast_copy_string(referdata->replaces_callid_fromtag, ptr, sizeof(referdata->replaces_callid_fromtag));
+ }
+
+ if (!sip_cfg.pedanticsipchecking)
+ ast_debug(2, "Attended transfer: Will use Replace-Call-ID : %s (No check of from/to tags)\n", referdata->replaces_callid );
+ else
+ ast_debug(2, "Attended transfer: Will use Replace-Call-ID : %s F-tag: %s T-tag: %s\n", referdata->replaces_callid, referdata->replaces_callid_fromtag ? referdata->replaces_callid_fromtag : "<none>", referdata->replaces_callid_totag ? referdata->replaces_callid_totag : "<none>" );
}
if ((ptr = strchr(refer_to, '@'))) { /* Separate domain */