mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	Fix tag handling on CANCEL (and maybe others)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		@@ -1928,13 +1928,17 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, char *msg, int in
 | 
				
			|||||||
	ot = get_header(orig, "To");
 | 
						ot = get_header(orig, "To");
 | 
				
			||||||
	of = get_header(orig, "From");
 | 
						of = get_header(orig, "From");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!strstr(ot, "tag=")) {
 | 
						/* Add tag *unless* this is a CANCEL, in which case we need to send it exactly
 | 
				
			||||||
 | 
						   as our original request, including tag (or presumably lack thereof) */
 | 
				
			||||||
 | 
						if (!strstr(ot, "tag=") && strcasecmp(msg, "CANCEL")) {
 | 
				
			||||||
		/* Add the proper tag if we don't have it already.  If they have specified
 | 
							/* Add the proper tag if we don't have it already.  If they have specified
 | 
				
			||||||
		   their tag, use it.  Otherwise, use our own tag */
 | 
							   their tag, use it.  Otherwise, use our own tag */
 | 
				
			||||||
		if (strlen(p->theirtag))
 | 
							if (!p->outgoing && strlen(p->theirtag))
 | 
				
			||||||
			snprintf(newto, sizeof(newto), "%s;tag=%s", ot, p->theirtag);
 | 
								snprintf(newto, sizeof(newto), "%s;tag=%s", ot, p->theirtag);
 | 
				
			||||||
		else
 | 
							else if (p->outgoing)
 | 
				
			||||||
			snprintf(newto, sizeof(newto), "%s;tag=%08x", ot, p->tag);
 | 
								snprintf(newto, sizeof(newto), "%s;tag=%08x", ot, p->tag);
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
								snprintf(newto, sizeof(newto), "%s", ot);
 | 
				
			||||||
		ot = newto;
 | 
							ot = newto;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user