- fix: no audio with some UAs that do not include a

Contact header in ACK messages (which is compliant).
This commit is contained in:
Thomas Ries
2005-10-09 14:19:25 +00:00
parent 60f8c0c6b8
commit 2311cca685
4 changed files with 21 additions and 10 deletions
+2
View File
@@ -1,6 +1,8 @@
0.5.12
======
9-Oct-2005: - Expiration timeout is now taken from the REGISTER response
- fix: no audio with some UAs that do not include a
Contact header in ACK messages (which is compliant).
1-Oct-2005: - [1278537] Read proxy_auth_pwfile after config file is read
- [1278591] Proxy-Authenticate header not included in response
- process empty Contact header (means "query registrations")
+18 -8
View File
@@ -271,11 +271,11 @@ int proxy_request (sip_ticket_t *ticket) {
/* check for incoming request */
} else if (MSG_IS_INVITE(request)) {
/* Rewrite the body */
sts = proxy_rewrite_invitation_body(request, DIR_INCOMING);
sts = proxy_rewrite_invitation_body(ticket, DIR_INCOMING);
} else if (MSG_IS_ACK(request)) {
/* Rewrite the body */
sts = proxy_rewrite_invitation_body(request, DIR_INCOMING);
sts = proxy_rewrite_invitation_body(ticket, DIR_INCOMING);
}
break;
@@ -320,9 +320,9 @@ int proxy_request (sip_ticket_t *ticket) {
/* if an INVITE, rewrite body */
if (MSG_IS_INVITE(request)) {
sts = proxy_rewrite_invitation_body(request, DIR_OUTGOING);
sts = proxy_rewrite_invitation_body(ticket, DIR_OUTGOING);
} else if (MSG_IS_ACK(request)) {
sts = proxy_rewrite_invitation_body(request, DIR_OUTGOING);
sts = proxy_rewrite_invitation_body(ticket, DIR_OUTGOING);
}
/* if this is CANCEL/BYE request, stop RTP proxying */
@@ -767,7 +767,7 @@ int proxy_response (sip_ticket_t *ticket) {
if ((MSG_IS_STATUS_1XX(response)) ||
(MSG_IS_STATUS_2XX(response))) {
if (configuration.rtp_proxy_enable == 1) {
sts = proxy_rewrite_invitation_body(response, DIR_INCOMING);
sts = proxy_rewrite_invitation_body(ticket, DIR_INCOMING);
}
/* negative - stop a possibly started RTP stream */
} else if ((MSG_IS_STATUS_4XX(response)) ||
@@ -849,7 +849,7 @@ int proxy_response (sip_ticket_t *ticket) {
if ((MSG_IS_STATUS_1XX(response)) ||
(MSG_IS_STATUS_2XX(response))) {
/* This is an outgoing response, therefore an outgoing stream */
sts = proxy_rewrite_invitation_body(response, DIR_OUTGOING);
sts = proxy_rewrite_invitation_body(ticket, DIR_OUTGOING);
/* megative - stop a possibly started RTP stream */
} else if ((MSG_IS_STATUS_4XX(response)) ||
(MSG_IS_STATUS_5XX(response)) ||
@@ -978,7 +978,8 @@ int proxy_response (sip_ticket_t *ticket) {
* STS_SUCCESS on success
* STS_FAILURE on error
*/
int proxy_rewrite_invitation_body(osip_message_t *mymsg, int direction){
int proxy_rewrite_invitation_body(sip_ticket_t *ticket, int direction){
osip_message_t *mymsg=ticket->sipmsg;
osip_body_t *body;
sdp_message_t *sdp;
struct in_addr map_addr, addr_sess, addr_media, outside_addr, inside_addr;
@@ -1204,6 +1205,8 @@ if (configuration.debuglevel)
* 1) User part of Contact header
* 2) Host part of Contact header (will be different
* between internal UA and external UA)
* 3) IP address of sender (also different between
* internal and external UA)
*/
if (!osip_list_eol(mymsg->contacts, 0))
cont_url = ((osip_contact_t*)(mymsg->contacts->node->element))->url;
@@ -1211,7 +1214,14 @@ if (configuration.debuglevel)
client_id=cont_url->username;
if (client_id == NULL) client_id=cont_url->host;
}
if (client_id == NULL) {
static char from_string[HOSTNAME_SIZE];
char *tmp;
tmp=utils_inet_ntoa(ticket->from.sin_addr);
strncpy(from_string, tmp, HOSTNAME_SIZE-1);
from_string[HOSTNAME_SIZE-1]='\0';
client_id=tmp;
}
/*
* do we have a 'c=' item on media level?
-1
View File
@@ -544,7 +544,6 @@ int rtp_relay_start_fwd (osip_call_id_t *callid, char *client_id,
i2 < (num_ports + prev_used_port - configuration.rtp_port_low + 1);
i2++) {
i = (i2%num_ports) + configuration.rtp_port_low;
DEBUGC(DBCLASS_RTP,"&&&& I=%i, i2=%i",i,i2);
/* only allow even port numbers */
if ((i % 2) != 0) continue;
+1 -1
View File
@@ -136,7 +136,7 @@ int register_set_expire(sip_ticket_t *ticket); /*X*/
/* proxy.c */
int proxy_request (sip_ticket_t *ticket); /*X*/
int proxy_response (sip_ticket_t *ticket); /*X*/
int proxy_rewrite_invitation_body(osip_message_t *m, int direction); /*X*/
int proxy_rewrite_invitation_body(sip_ticket_t *ticket, int direction); /*X*/
int proxy_rewrite_request_uri(osip_message_t *mymsg, int idx); /*X*/
/* route_preprocessing.c */