From cd8c467f7c202fab9df143009d3cb9b6903f0280 Mon Sep 17 00:00:00 2001 From: mnicholson Date: Mon, 20 Dec 2010 21:00:44 +0000 Subject: Remove changes to via processing that were not supposed to go into the last commit. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@299198 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_sip.c | 71 ----------------------------------------------------- 1 file changed, 71 deletions(-) (limited to 'channels') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5953d1a61..46027f6bf 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4947,69 +4947,6 @@ static struct sip_pvt *sip_alloc(ast_string_field callid, struct sockaddr_in *si 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 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg { 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 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg } 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; } -- cgit v1.2.3