1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/asterisk/asterisk.patch.xfersips Mon Apr 27 12:19:05 2009 +0200 1.3 @@ -0,0 +1,36 @@ 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 2009-04-24 00:48:57.000000000 +0200 1.7 ++++ channels/chan_sip.c 2009-04-24 00:49:21.000000000 +0200 1.8 +@@ -18771,6 +18771,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 host */ 1.13 + static int sip_sipredirect(struct sip_pvt *p, const char *dest) 1.14 + { 1.15 + char *cdest; 1.16 +@@ -18780,7 +18781,7 @@ 1.17 + cdest = ast_strdupa(dest); 1.18 + 1.19 + extension = strsep(&cdest, "@"); 1.20 +- host = strsep(&cdest, ":"); 1.21 ++ host = strsep(&cdest, ":"); /* MSvB: Could begin with '@' if SIPS */ 1.22 + port = strsep(&cdest, ":"); 1.23 + if (ast_strlen_zero(extension)) { 1.24 + ast_log(LOG_ERROR, "Missing mandatory argument: extension\n"); 1.25 +@@ -18813,7 +18814,13 @@ 1.26 + } 1.27 + } 1.28 + 1.29 +- ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s%s%s>", extension, host, port ? ":" : "", port ? port : ""); 1.30 ++ if (host && *host == '@') { 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%s%s>", extension, host + 1, port ? ":" : "", port ? port : ""); 1.33 ++ } 1.34 ++ else 1.35 ++ ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s%s%s>", extension, host, port ? ":" : "", port ? port : ""); 1.36 ++ 1.37 + transmit_response_reliable(p, "302 Moved Temporarily", &p->initreq); 1.38 + 1.39 + sip_scheddestroy(p, SIP_TRANS_TIMEOUT); /* Make sure we stop send this reply. */