diff -r 73d852a30c9a -r 263143ec0fb2 asterisk/asterisk.patch.xfersips --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/asterisk/asterisk.patch.xfersips Sun Mar 20 20:03:11 2011 +0100 @@ -0,0 +1,37 @@ +Index: channels/chan_sip.c +diff -Nau channels/chan_sip.c.orig channels/chan_sip.c +--- channels/chan_sip.c.orig 2011-01-14 18:32:52.000000000 +0100 ++++ channels/chan_sip.c 2011-03-13 14:32:58.000000000 +0100 +@@ -27854,6 +27854,7 @@ + \todo Fix this function so that we wait for reply to the REFER and + react to errors, denials or other issues the other end might have. + */ ++/* MSvB: Paramater dest may be SIPS encoded, having '@' before domain */ + static int sip_sipredirect(struct sip_pvt *p, const char *dest) + { + char *cdest; +@@ -27862,7 +27863,7 @@ + cdest = ast_strdupa(dest); + + extension = strsep(&cdest, "@"); +- domain = strsep(&cdest, ":"); ++ domain = strsep(&cdest, ":"); /* MSvB: Could begin with '@' if SIPS */ + if (ast_strlen_zero(extension)) { + ast_log(LOG_ERROR, "Missing mandatory argument: extension\n"); + return 0; +@@ -27894,7 +27895,14 @@ + } + } + +- ast_string_field_build(p, our_contact, "Transfer ", extension, domain); ++ if (domain && *domain == '@') { ++ ast_log(LOG_DEBUG, "Decoding TLS incapable Asterisk SIP URI to a standard SIPS URI before redirecting via 302 Moved Temporarily\n"); ++ ast_string_field_build(p, our_contact, "Transfer ", extension, domain); ++ ++ } ++ else ++ ast_string_field_build(p, our_contact, "Transfer ", extension, domain); ++ + transmit_response_reliable(p, "302 Moved Temporarily", &p->initreq); + + sip_scheddestroy(p, SIP_TRANS_TIMEOUT); /* Make sure we stop send this reply. */