forked from mirrors/linphone-iphone
enable tcp transport
This commit is contained in:
parent
4fed6f5948
commit
9c828b1727
4 changed files with 46 additions and 5 deletions
|
|
@ -646,7 +646,18 @@ static void sip_config_read(LinphoneCore *lc)
|
|||
}
|
||||
linphone_core_enable_ipv6(lc,ipv6);
|
||||
port=lp_config_get_int(lc->config,"sip","sip_port",5060);
|
||||
linphone_core_set_sip_port(lc,port);
|
||||
|
||||
tmpstr=lp_config_get_string(lc->config,"sip","transport","udp");
|
||||
if (strcmp("udp",tmpstr) == 0 ) {
|
||||
lc->sip_conf.transport=SalTransportDatagram;
|
||||
} else if (strcmp("tcp",tmpstr) == 0) {
|
||||
lc->sip_conf.transport=SalTransportStream;
|
||||
} else {
|
||||
lc->sip_conf.transport=SalTransportDatagram;
|
||||
ms_warning("unsupported transport, using udp");
|
||||
}
|
||||
/*start listening on port*/
|
||||
linphone_core_set_sip_port(lc,port);
|
||||
|
||||
tmpstr=lp_config_get_string(lc->config,"sip","contact",NULL);
|
||||
if (tmpstr==NULL || linphone_core_set_primary_contact(lc,tmpstr)==-1) {
|
||||
|
|
@ -697,6 +708,11 @@ static void sip_config_read(LinphoneCore *lc)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
lc->sip_conf.sdp_200_ack=lp_config_get_int(lc->config,"sip","sdp_200_ack",0);
|
||||
|
||||
/*for tuning or test*/
|
||||
lc->sip_conf.sdp_200_ack=lp_config_get_int(lc->config,"sip","sdp_200_ack",0);
|
||||
|
|
@ -1482,9 +1498,11 @@ void linphone_core_set_sip_port(LinphoneCore *lc,int port)
|
|||
anyaddr="::0";
|
||||
else
|
||||
anyaddr="0.0.0.0";
|
||||
err=sal_listen_port (lc->sal,anyaddr,port, SalTransportDatagram,FALSE);
|
||||
|
||||
|
||||
err=sal_listen_port (lc->sal,anyaddr,port, lc->sip_conf.transport,FALSE);
|
||||
if (err<0){
|
||||
char *msg=ortp_strdup_printf("UDP port %i seems already in use ! Cannot initialize.",port);
|
||||
char *msg=ortp_strdup_printf("Port %i seems already in use ! Cannot initialize.",port);
|
||||
ms_warning(msg);
|
||||
lc->vtable.display_warning(lc,msg);
|
||||
ms_free(msg);
|
||||
|
|
|
|||
|
|
@ -242,6 +242,7 @@ struct _LinphoneFriend{
|
|||
bool_t inc_subscribe_pending;
|
||||
};
|
||||
|
||||
|
||||
typedef struct sip_config
|
||||
{
|
||||
char *contact;
|
||||
|
|
@ -261,6 +262,8 @@ typedef struct sip_config
|
|||
bool_t ping_with_options;
|
||||
bool_t auto_net_state_mon;
|
||||
unsigned int keepalive_period; /* interval in ms between keep alive messages sent to the proxy server*/
|
||||
SalTransport transport;
|
||||
|
||||
} sip_config_t;
|
||||
|
||||
typedef struct rtp_config
|
||||
|
|
|
|||
|
|
@ -314,6 +314,17 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
|
|||
bool_t ipv6;
|
||||
int proto=IPPROTO_UDP;
|
||||
|
||||
switch (tr) {
|
||||
case SalTransportDatagram:
|
||||
proto=IPPROTO_UDP;
|
||||
break;
|
||||
case SalTransportStream:
|
||||
proto= IPPROTO_TCP;
|
||||
break;
|
||||
default:
|
||||
ms_warning("unexpected proto, using datagram");
|
||||
}
|
||||
|
||||
if (ctx->running){
|
||||
eXosip_quit();
|
||||
eXosip_init();
|
||||
|
|
@ -325,8 +336,8 @@ int sal_listen_port(Sal *ctx, const char *addr, int port, SalTransport tr, int i
|
|||
ipv6=strchr(addr,':')!=NULL;
|
||||
eXosip_enable_ipv6(ipv6);
|
||||
|
||||
if (tr!=SalTransportDatagram || is_secure){
|
||||
ms_fatal("SIP over TCP or TLS or DTLS is not supported yet.");
|
||||
if (is_secure){
|
||||
ms_fatal("SIP over TLS or DTLS is not supported yet.");
|
||||
return -1;
|
||||
}
|
||||
err=eXosip_listen_addr(proto, addr, port, ipv6 ? PF_INET6 : PF_INET, 0);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,13 @@ AC_DEFUN([LP_SETUP_EXOSIP],[
|
|||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([LP_CHECK_OSIP2])
|
||||
|
||||
|
||||
case $target_os in
|
||||
*darwin*)
|
||||
OSIP_LIBS="$OSIP_LIBS -framework CoreFoundation -framework CFNetwork "
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl eXosip embeded stuff
|
||||
EXOSIP_CFLAGS="$OSIP_CFLAGS -DOSIP_MT "
|
||||
EXOSIP_LIBS="$OSIP_LIBS -leXosip2 "
|
||||
|
|
@ -12,6 +19,8 @@ CPPFLAGS="$OSIP_CFLAGS $CPPFLAGS"
|
|||
AC_CHECK_HEADER([eXosip2/eXosip.h], ,AC_MSG_ERROR([Could not find eXosip2 headers !]))
|
||||
CPPFLAGS=$CPPFLAGS_save
|
||||
|
||||
|
||||
|
||||
dnl check for eXosip2 libs
|
||||
LDFLAGS_save=$LDFLAGS
|
||||
LDFLAGS="$OSIP_LIBS $LDFLAGS"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue