asterisk/asterisk.patch.xfersips

changeset 311
263143ec0fb2
child 347
10bd406e1c51
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/asterisk/asterisk.patch.xfersips	Sun Mar 20 20:03:11 2011 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +Index: channels/chan_sip.c
     1.5 +diff -Nau channels/chan_sip.c.orig channels/chan_sip.c
     1.6 +--- channels/chan_sip.c.orig	2011-01-14 18:32:52.000000000 +0100
     1.7 ++++ channels/chan_sip.c	2011-03-13 14:32:58.000000000 +0100
     1.8 +@@ -27854,6 +27854,7 @@
     1.9 + \todo	Fix this function so that we wait for reply to the REFER and
    1.10 + 	react to errors, denials or other issues the other end might have.
    1.11 +  */
    1.12 ++/* MSvB: Paramater dest may be SIPS encoded, having '@' before domain */
    1.13 + static int sip_sipredirect(struct sip_pvt *p, const char *dest)
    1.14 + {
    1.15 + 	char *cdest;
    1.16 +@@ -27862,7 +27863,7 @@
    1.17 + 	cdest = ast_strdupa(dest);
    1.18 + 	
    1.19 + 	extension = strsep(&cdest, "@");
    1.20 +-	domain = strsep(&cdest, ":");
    1.21 ++	domain = strsep(&cdest, ":");     /* MSvB: Could begin with '@' if SIPS */
    1.22 + 	if (ast_strlen_zero(extension)) {
    1.23 + 		ast_log(LOG_ERROR, "Missing mandatory argument: extension\n");
    1.24 + 		return 0;
    1.25 +@@ -27894,7 +27895,14 @@
    1.26 + 		}
    1.27 + 	}
    1.28 + 
    1.29 +-	ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s>", extension, domain);
    1.30 ++	if (domain && *domain == '@') {
    1.31 ++		ast_log(LOG_DEBUG, "Decoding TLS incapable Asterisk SIP URI to a standard SIPS URI before redirecting via 302 Moved Temporarily\n");
    1.32 ++		ast_string_field_build(p, our_contact, "Transfer <sips:%s@%s>", extension, domain);
    1.33 ++
    1.34 ++	}
    1.35 ++	else
    1.36 ++		ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s>", extension, domain);
    1.37 ++
    1.38 + 	transmit_response_reliable(p, "302 Moved Temporarily", &p->initreq);
    1.39 + 
    1.40 + 	sip_scheddestroy(p, SIP_TRANS_TIMEOUT);	/* Make sure we stop send this reply. */

mercurial