[asterisk-commits] mnicholson: branch 1.4 r299198 - /branches/1.4/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 20 21:00:49 UTC 2010


Author: mnicholson
Date: Mon Dec 20 15:00:44 2010
New Revision: 299198

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=299198
Log:
Remove changes to via processing that were not supposed to go into the last commit.

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=299198&r1=299197&r2=299198
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Mon Dec 20 15:00:44 2010
@@ -4947,69 +4947,6 @@
 	return p;
 }
 
-/*!
- * \brief Parse a Via header
- *
- * \note This function does not parse all of the elmentes of the via header at
- * this time.
- *
- * VIA syntax. RFC 3261 section 25.1
- * Via               =  ( "Via" / "v" ) HCOLON via-parm *(COMMA via-parm)
- * via-parm          =  sent-protocol LWS sent-by *( SEMI via-params )
- * via-params        =  via-ttl / via-maddr
- *                   / via-received / via-branch
- *                   / via-extension
- * via-ttl           =  "ttl" EQUAL ttl
- * via-maddr         =  "maddr" EQUAL host
- * via-received      =  "received" EQUAL (IPv4address / IPv6address)
- * via-branch        =  "branch" EQUAL token
- * via-extension     =  generic-param
- * sent-protocol     =  protocol-name SLASH protocol-version
- *                   SLASH transport
- * protocol-name     =  "SIP" / token
- * protocol-version  =  token
- * transport         =  "UDP" / "TCP" / "TLS" / "SCTP"
- *                   / other-transport
- * sent-by           =  host [ COLON port ]
- * ttl               =  1*3DIGIT ; 0 to 255
- */
-static void get_viabranch(char *via, char **sent_by, char **branch)
-{
-	char *tmp;
-
-	if (sent_by) {
-		*sent_by = NULL;
-	}
-	if (branch) {
-		*branch = NULL;
-	}
-	if (ast_strlen_zero(via)) {
-		return;
-	}
-
-	/* chop off sent-protocol */
-	strsep(&via, " \t\r\n");
-	if (ast_strlen_zero(via)) {
-		return;
-	}
-
-	/* chop off sent-by */
-	via = ast_skip_blanks(via);
-	*sent_by = strsep(&via, "; \t\r\n");
-	if (ast_strlen_zero(via)) {
-		return;
-	}
-
-	/* now see if there is a branch parameter in there */
-	if (branch && (tmp = strstr(via, "branch="))) {
-		/* find the branch ID */
-		via = ast_skip_blanks(tmp + 7);
-
-		/* chop off the branch parameter */
-		*branch = strsep(&via, "; \t\r\n");
-	}
-}
-
 /*! \brief Connect incoming SIP message to current dialog or create new dialog structure
 	Called by handle_request, sipsock_read */
 static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *sin, const int intended_method)
@@ -6612,7 +6549,6 @@
 {
 	char newto[256];
 	const char *ot;
-	char *via, *sent_by;
 
 	init_resp(resp, msg);
 	copy_via_headers(p, resp, req, "Via");
@@ -6655,13 +6591,6 @@
 	} else if (!ast_strlen_zero(p->our_contact) && resp_needs_contact(msg, p->method)) {
 		add_header(resp, "Contact", p->our_contact);
 	}
-
-	via = ast_strdupa(get_header(req, "Via"));
-	get_viabranch(via, &sent_by, NULL);
-	if (!ast_strlen_zero(sent_by)) {
-		set_destination(p, sent_by);
-	}
-
 	return 0;
 }
 




More information about the asterisk-commits mailing list