- new feature: can add ;rport to my own Via Headers
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
0.6.0
|
||||
=====
|
||||
24-May-2007: - new feature: can masquerade User-agent header
|
||||
- new feature: can add ;rport to my own Via Headers
|
||||
13-May-2007: - deal with locally running UAs on same host (inboud IF side)
|
||||
07-May-2007: - Client-ID in RTP proxy is derived from Client IP address.
|
||||
This should fix an issue with unexpectedly timing-out RTP
|
||||
|
||||
@@ -243,6 +243,20 @@ debug_port = 0
|
||||
#
|
||||
#ua_string = Siproxd-UA
|
||||
|
||||
######################################################################
|
||||
# Use ;rport in via header
|
||||
#
|
||||
# may be required in some cases where the remote SIP Registrat
|
||||
# uses asymmetric SIP signalling (you receive the SIP packets
|
||||
# from another <IP>:<port> combination than you send them to.
|
||||
# Default is disabled
|
||||
# 0 - do not add ;rport to via header
|
||||
# 1 - do add ;rport to INCOMING via header only
|
||||
# 2 - do add ;rport to OUTGOING via header only
|
||||
# 3 - do add ;rport to OUTGOING and INCOMING via headers
|
||||
#
|
||||
# use_rport = 0
|
||||
|
||||
######################################################################
|
||||
# Outbound proxy
|
||||
#
|
||||
|
||||
@@ -184,6 +184,7 @@ static int parse_config (FILE *configfile) {
|
||||
{ "pi_shortdial_akey", TYP_STRING, &configuration.pi_shortdial_akey },
|
||||
{ "pi_shortdial_entry", TYP_STRINGA,&configuration.pi_shortdial_entry },
|
||||
{ "ua_string", TYP_STRING, &configuration.ua_string },
|
||||
{ "use_rport", TYP_INT4, &configuration.use_rport },
|
||||
{0, 0, 0}
|
||||
};
|
||||
|
||||
|
||||
@@ -548,17 +548,31 @@ int sip_add_myvia (sip_ticket_t *ticket, int interface) {
|
||||
int sts;
|
||||
char branch_id[VIA_BRANCH_SIZE];
|
||||
char *myaddr;
|
||||
int add_rport=0;
|
||||
|
||||
if (get_interface_ip(interface, &addr) != STS_SUCCESS) {
|
||||
return STS_FAILURE;
|
||||
}
|
||||
|
||||
/* evaluate if we need to include an ;rport */
|
||||
/* incoming */
|
||||
if ((configuration.use_rport & 1) &&
|
||||
((ticket->direction==REQTYP_INCOMING) ||
|
||||
(ticket->direction==RESTYP_INCOMING)) ) {
|
||||
add_rport=1;
|
||||
} else if ((configuration.use_rport & 2) &&
|
||||
((ticket->direction==REQTYP_OUTGOING) ||
|
||||
(ticket->direction==RESTYP_OUTGOING)) ) {
|
||||
add_rport=1;
|
||||
}
|
||||
|
||||
sts = sip_calculate_branch_id(ticket, branch_id);
|
||||
|
||||
myaddr=utils_inet_ntoa(addr);
|
||||
sprintf(tmp, "SIP/2.0/UDP %s:%i;branch=%s",
|
||||
sprintf(tmp, "SIP/2.0/UDP %s:%i;branch=%s%s",
|
||||
myaddr, configuration.sip_listen_port,
|
||||
branch_id);
|
||||
branch_id,
|
||||
(add_rport)? ";rport":"");
|
||||
|
||||
DEBUGC(DBCLASS_BABBLE,"adding VIA:%s",tmp);
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ struct siproxd_config {
|
||||
char *pi_shortdial_akey;
|
||||
stringa_t pi_shortdial_entry;
|
||||
char *ua_string;
|
||||
int use_rport;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user