diff options
author | Olle Johansson <oej@edvina.net> | 2011-09-19 13:57:26 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2011-09-19 13:57:26 +0000 |
commit | 1ec4cb8ea01a1a0bf0b31fd3ee0f4c0a284976b8 (patch) | |
tree | e94d78ec9377aca075cb96de1ee81e3f5c6b105f | |
parent | d9306c4087472a27432c4531df2cdaf53cd9aed8 (diff) |
Merged revisions 336502 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10
................
r336502 | oej | 2011-09-19 15:38:53 +0200 (Mån, 19 Sep 2011) | 12 lines
Merged revisions 336501 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r336501 | oej | 2011-09-19 15:33:50 +0200 (Mån, 19 Sep 2011) | 5 lines
Add diversion header to a 302 redirect response if we have diversion data
(closes issue ASTERISK-18143)
patch by oej
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 89e3e4120..d7d46f54a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1342,6 +1342,7 @@ static struct sip_auth *find_realm_authentication(struct sip_auth_container *cre /*--- Misc functions */ static void check_rtp_timeout(struct sip_pvt *dialog, time_t t); static int reload_config(enum channelreloadreason reason); +static void add_diversion_header(struct sip_request *req, struct sip_pvt *pvt); static int expire_register(const void *data); static void *do_monitor(void *data); static int restart_monitor(void); @@ -10373,6 +10374,11 @@ static int __transmit_response(struct sip_pvt *p, const char *msg, const struct add_cc_call_info_to_response(p, &resp); } + /* If we are sending a 302 Redirect we can add a diversion header if the redirect information is set */ + if (!strncmp(msg, "302", 3)) { + add_diversion_header(&resp, p); + } + /* If we are cancelling an incoming invite for some reason, add information about the reason why we are doing this in clear text */ if (p->method == SIP_INVITE && msg[0] != '1') { |