summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-04-06 21:49:24 +0000
committerOlle Johansson <oej@edvina.net>2006-04-06 21:49:24 +0000
commit4ded41daa5fffbbfa985c66d9705da53307e514e (patch)
tree841ec92f4af0c19a253edc2fd52a78a10a522974
parent965394e4c2c81ecceffb0a0769160e4d12919a74 (diff)
Cosmetic update for outbound REFERs
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 627770634..68c8b94fd 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5705,7 +5705,8 @@ static int transmit_refer(struct sip_pvt *p, const char *dest)
char *of, *c;
char referto[256];
- if (ast_test_flag(&p->flags[0], SIP_OUTGOING))
+ /* Are we transfering an inbound or outbound call? */
+ if (ast_test_flag(&p->flags[0], SIP_OUTGOING))
of = get_header(&p->initreq, "To");
else
of = get_header(&p->initreq, "From");
@@ -5729,16 +5730,26 @@ static int transmit_refer(struct sip_pvt *p, const char *dest)
snprintf(referto, sizeof(referto), "<sip:%s>", dest);
}
+ add_header(&req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
+
/* save in case we get 407 challenge */
ast_string_field_set(p, refer_to, referto);
ast_string_field_set(p, referred_by, p->our_contact);
reqprep(&req, p, SIP_REFER, 0, 1);
add_header(&req, "Refer-To", referto);
+ add_header(&req, "Allow", ALLOWED_METHODS);
+ add_header(&req, "Supported", SUPPORTED_EXTENSIONS);
if (!ast_strlen_zero(p->our_contact))
add_header(&req, "Referred-By", p->our_contact);
add_blank_header(&req);
return send_request(p, &req, 1, p->ocseq);
+
+ /*! \todo In theory, we should hang around and wait for a reply, before
+ returning to the dial plan here. Don't know really how that would
+ affect the transfer() app or the pbx, but, well, to make this
+ useful we should have a STATUS code on transfer().
+ */
}
/*! \brief Send SIP INFO dtmf message, see Cisco documentation on cisco.com */