Merged revisions 59081 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r59081 | file | 2007-03-20 23:25:48 -0400 (Tue, 20 Mar 2007) | 2 lines

Until we can do media level parsing for sendrecv/etc just use the first value found. This crept up when a phone was offered audio+video and returned an inactive video stream. chan_sip thought the phone said to put the person on hold but that was totally wrong. (issue #9319 reported by benbrown)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp 2007-03-21 03:27:58 +00:00
parent 7669c0ede7
commit 1d5be2d1c7

View file

@ -5082,7 +5082,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
int codec; int codec;
int destiterator = 0; int destiterator = 0;
int iterator; int iterator;
int sendonly = 0; int sendonly = -1;
int numberofports; int numberofports;
struct ast_rtp *newaudiortp, *newvideortp, *newtextrtp; /* Buffers for codec handling */ struct ast_rtp *newaudiortp, *newvideortp, *newtextrtp; /* Buffers for codec handling */
int newjointcapability; /* Negotiated capability */ int newjointcapability; /* Negotiated capability */
@ -5360,12 +5360,15 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
continue; continue;
} }
if (!strcasecmp(a, "sendonly")) { if (!strcasecmp(a, "sendonly")) {
if (sendonly == -1)
sendonly = 1; sendonly = 1;
continue; continue;
} else if (!strcasecmp(a, "inactive")) { } else if (!strcasecmp(a, "inactive")) {
if (sendonly == -1)
sendonly = 2; sendonly = 2;
continue; continue;
} else if (!strcasecmp(a, "sendrecv")) { } else if (!strcasecmp(a, "sendrecv")) {
if (sendonly == -1)
sendonly = 0; sendonly = 0;
continue; continue;
} else if (strlen(a) > 5 && !strncasecmp(a, "ptime", 5)) { } else if (strlen(a) > 5 && !strncasecmp(a, "ptime", 5)) {
@ -5641,7 +5644,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
ast_set_write_format(p->owner, p->owner->writeformat); ast_set_write_format(p->owner, p->owner->writeformat);
} }
if (sin.sin_addr.s_addr && !sendonly) { if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
ast_queue_control(p->owner, AST_CONTROL_UNHOLD); ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
/* Activate a re-invite */ /* Activate a re-invite */
ast_queue_frame(p->owner, &ast_null_frame); ast_queue_frame(p->owner, &ast_null_frame);
@ -5657,7 +5660,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
} }
/* Manager Hold and Unhold events must be generated, if necessary */ /* Manager Hold and Unhold events must be generated, if necessary */
if (sin.sin_addr.s_addr && !sendonly) { if (sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) { if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) {
append_history(p, "Unhold", "%s", req->data); append_history(p, "Unhold", "%s", req->data);
if (global_callevents) if (global_callevents)