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
9cb68a7d
Commit
9cb68a7d
authored
Feb 19, 2013
by
Yann Diorcet
Browse files
Disable ping options when uPnP is working
parent
3694186a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
coreapi/linphonecall.c
coreapi/linphonecall.c
+15
-8
coreapi/linphonecore.c
coreapi/linphonecore.c
+16
-8
No files found.
coreapi/linphonecall.c
View file @
9cb68a7d
...
...
@@ -508,14 +508,21 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
call
->
core
=
lc
;
if
(
lc
->
sip_conf
.
ping_with_options
){
/*the following sends an option request back to the caller so that
we get a chance to discover our nat'd address before answering.*/
call
->
ping_op
=
sal_op_new
(
lc
->
sal
);
from_str
=
linphone_address_as_string_uri_only
(
from
);
sal_op_set_route
(
call
->
ping_op
,
sal_op_get_network_origin
(
op
));
sal_op_set_user_pointer
(
call
->
ping_op
,
call
);
sal_ping
(
call
->
ping_op
,
linphone_core_find_best_identity
(
lc
,
from
,
NULL
),
from_str
);
ms_free
(
from_str
);
#ifdef BUILD_UPNP
if
(
lc
->
upnp
!=
NULL
&&
linphone_core_get_firewall_policy
(
lc
)
==
LinphonePolicyUseUpnp
&&
linphone_upnp_context_get_state
(
lc
->
upnp
)
==
LinphoneUpnpStateOk
)
{
#else //BUILD_UPNP
{
#endif //BUILD_UPNP
/*the following sends an option request back to the caller so that
we get a chance to discover our nat'd address before answering.*/
call
->
ping_op
=
sal_op_new
(
lc
->
sal
);
from_str
=
linphone_address_as_string_uri_only
(
from
);
sal_op_set_route
(
call
->
ping_op
,
sal_op_get_network_origin
(
op
));
sal_op_set_user_pointer
(
call
->
ping_op
,
call
);
sal_ping
(
call
->
ping_op
,
linphone_core_find_best_identity
(
lc
,
from
,
NULL
),
from_str
);
ms_free
(
from_str
);
}
}
linphone_address_clean
(
from
);
...
...
coreapi/linphonecore.c
View file @
9cb68a7d
...
...
@@ -2605,15 +2605,23 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
}
if
(
call
->
dest_proxy
==
NULL
&&
lc
->
sip_conf
.
ping_with_options
==
TRUE
){
/*defer the start of the call after the OPTIONS ping*/
call
->
ping_replied
=
FALSE
;
call
->
ping_op
=
sal_op_new
(
lc
->
sal
);
sal_ping
(
call
->
ping_op
,
from
,
real_url
);
sal_op_set_user_pointer
(
call
->
ping_op
,
call
);
call
->
start_time
=
time
(
NULL
);
}
else
{
if
(
defer
==
FALSE
)
linphone_core_start_invite
(
lc
,
call
);
#ifdef BUILD_UPNP
if
(
lc
->
upnp
!=
NULL
&&
linphone_core_get_firewall_policy
(
lc
)
==
LinphonePolicyUseUpnp
&&
linphone_upnp_context_get_state
(
lc
->
upnp
)
==
LinphoneUpnpStateOk
)
{
#else //BUILD_UPNP
{
#endif //BUILD_UPNP
/*defer the start of the call after the OPTIONS ping*/
call
->
ping_replied
=
FALSE
;
call
->
ping_op
=
sal_op_new
(
lc
->
sal
);
sal_ping
(
call
->
ping_op
,
from
,
real_url
);
sal_op_set_user_pointer
(
call
->
ping_op
,
call
);
call
->
start_time
=
time
(
NULL
);
defer
=
TRUE
;
}
}
if
(
defer
==
FALSE
)
linphone_core_start_invite
(
lc
,
call
);
if
(
real_url
!=
NULL
)
ms_free
(
real_url
);
return
call
;
...
...
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