mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
add both sip and ftp bind address
This commit is contained in:
parent
0b7ff73bca
commit
3d1f284525
3 changed files with 12 additions and 8 deletions
|
|
@ -555,7 +555,7 @@ static void transfer_already_assigned_payload_types(SalMediaDescription *old, Sa
|
|||
}
|
||||
|
||||
static const char *linphone_call_get_bind_ip_for_stream(LinphoneCall *call, int stream_index){
|
||||
const char *bind_ip=call->af==AF_INET6 ? "::0" : "0.0.0.0";
|
||||
const char *bind_ip = lp_config_get_string(call->core->config,"rtp","bind_address",call->af==AF_INET6 ? "::0" : "0.0.0.0"); ;
|
||||
|
||||
if (stream_index<2 && call->media_ports[stream_index].multicast_ip[0]!='\0'){
|
||||
if (call->dir==LinphoneCallOutgoing){
|
||||
|
|
@ -611,7 +611,8 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
|
|||
md->nb_streams=(call->biggestdesc ? call->biggestdesc->nb_streams : 1);
|
||||
|
||||
strncpy(md->addr,call->localip,sizeof(md->addr));
|
||||
strncpy(md->username,linphone_address_get_username(addr),sizeof(md->username));
|
||||
if (linphone_address_get_username(addr)) /*might be null in case of identity without userinfo*/
|
||||
strncpy(md->username,linphone_address_get_username(addr),sizeof(md->username));
|
||||
if (subject) strncpy(md->name,subject,sizeof(md->name));
|
||||
|
||||
if (call->params->down_bw)
|
||||
|
|
|
|||
|
|
@ -2239,7 +2239,7 @@ int _linphone_core_apply_transports(LinphoneCore *lc){
|
|||
Sal *sal=lc->sal;
|
||||
const char *anyaddr;
|
||||
LCSipTransports *tr=&lc->sip_conf.transports;
|
||||
|
||||
const char* listening_address;
|
||||
/*first of all invalidate all current registrations so that we can register again with new transports*/
|
||||
__linphone_core_invalidate_registers(lc);
|
||||
|
||||
|
|
@ -2249,24 +2249,27 @@ int _linphone_core_apply_transports(LinphoneCore *lc){
|
|||
anyaddr="0.0.0.0";
|
||||
|
||||
sal_unlisten_ports(sal);
|
||||
|
||||
listening_address = lp_config_get_string(lc->config,"sip","bind_address",anyaddr);
|
||||
|
||||
if (lc->tunnel && linphone_tunnel_sip_enabled(lc->tunnel) && linphone_tunnel_get_activated(lc->tunnel)){
|
||||
if (sal_listen_port(sal,anyaddr,tr->udp_port,SalTransportUDP,TRUE)!=0){
|
||||
transport_error(lc,"udp+tunnel",tr->udp_port);
|
||||
}
|
||||
}else{
|
||||
if (tr->udp_port!=0){
|
||||
if (sal_listen_port(sal,anyaddr,tr->udp_port,SalTransportUDP,FALSE)!=0){
|
||||
if (sal_listen_port(sal,listening_address,tr->udp_port,SalTransportUDP,FALSE)!=0){
|
||||
transport_error(lc,"udp",tr->udp_port);
|
||||
}
|
||||
}
|
||||
if (tr->tcp_port!=0){
|
||||
if (sal_listen_port (sal,anyaddr,tr->tcp_port,SalTransportTCP,FALSE)!=0){
|
||||
if (sal_listen_port (sal,listening_address,tr->tcp_port,SalTransportTCP,FALSE)!=0){
|
||||
transport_error(lc,"tcp",tr->tcp_port);
|
||||
}
|
||||
}
|
||||
if (linphone_core_sip_transport_supported(lc,LinphoneTransportTls)){
|
||||
if (tr->tls_port!=0){
|
||||
if (sal_listen_port (sal,anyaddr,tr->tls_port,SalTransportTLS,FALSE)!=0){
|
||||
if (sal_listen_port (sal,listening_address,tr->tls_port,SalTransportTLS,FALSE)!=0){
|
||||
transport_error(lc,"tls",tr->tls_port);
|
||||
}
|
||||
}
|
||||
|
|
@ -2327,7 +2330,7 @@ int linphone_core_set_sip_transports(LinphoneCore *lc, const LCSipTransports * t
|
|||
/**
|
||||
* Retrieves the port configuration used for each transport (udp, tcp, tls).
|
||||
* A zero value port for a given transport means the transport
|
||||
* is not used. A value of LC_SIP_TRANSPORT_RANDOM (-1) means the port is to be choosen randomly by the system.
|
||||
* is not used. A value of LC_SIP_TRANSPORT_RANDOM (-1) means the port is to be chosen randomly by the system.
|
||||
* @ingroup network_parameters
|
||||
**/
|
||||
int linphone_core_get_sip_transports(LinphoneCore *lc, LCSipTransports *tr){
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ over the internet. It has a gtk+ and console interface.
|
|||
Summary: Development libraries for linphone
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: ortp-devel = @ORTP_VERSION@
|
||||
Requires: ortp-devel = 1:@ORTP_VERSION@
|
||||
Requires: mediastreamer-devel = @MS2_VERSION@
|
||||
Requires: glib2-devel
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue