Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
9c828b17
Commit
9c828b17
authored
Jun 03, 2010
by
jehan
Browse files
enable tcp transport
parent
4fed6f59
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
5 deletions
+46
-5
coreapi/linphonecore.c
coreapi/linphonecore.c
+21
-3
coreapi/private.h
coreapi/private.h
+3
-0
coreapi/sal_eXosip2.c
coreapi/sal_eXosip2.c
+13
-2
m4/exosip.m4
m4/exosip.m4
+9
-0
No files found.
coreapi/linphonecore.c
View file @
9c828b17
...
...
@@ -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 p
ort %i seems already in use ! Cannot initialize."
,
port
);
char
*
msg
=
ortp_strdup_printf
(
"
P
ort %i seems already in use ! Cannot initialize."
,
port
);
ms_warning
(
msg
);
lc
->
vtable
.
display_warning
(
lc
,
msg
);
ms_free
(
msg
);
...
...
coreapi/private.h
View file @
9c828b17
...
...
@@ -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
...
...
coreapi/sal_eXosip2.c
View file @
9c828b17
...
...
@@ -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
);
...
...
m4/exosip.m4
View file @
9c828b17
...
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment