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
belle-sip
Commits
4acde249
Commit
4acde249
authored
Dec 05, 2013
by
Ghislain MARY
Browse files
Add configuration to enable/disable DNS SRV resolution.
parent
deef6374
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
include/belle-sip/sipstack.h
include/belle-sip/sipstack.h
+4
-0
src/belle_sip_internal.h
src/belle_sip_internal.h
+1
-0
src/channel.c
src/channel.c
+4
-2
src/sipstack.c
src/sipstack.c
+9
-0
No files found.
include/belle-sip/sipstack.h
View file @
4acde249
...
...
@@ -52,6 +52,10 @@ BELLESIP_EXPORT int belle_sip_stack_get_dns_timeout(const belle_sip_stack_t *sta
BELLESIP_EXPORT
void
belle_sip_stack_set_dns_timeout
(
belle_sip_stack_t
*
stack
,
int
timeout
);
BELLESIP_EXPORT
unsigned
char
belle_sip_stack_dns_srv_enabled
(
const
belle_sip_stack_t
*
stack
);
BELLESIP_EXPORT
void
belle_sip_stack_enable_dns_srv
(
belle_sip_stack_t
*
stack
,
unsigned
char
enable
);
/**
* Can be used to simulate network transmission delays, for tests.
**/
...
...
src/belle_sip_internal.h
View file @
4acde249
...
...
@@ -499,6 +499,7 @@ struct belle_sip_stack{
int
resolver_send_error
;
/* used to simulate network error*/
int
dscp
;
char
*
dns_user_hosts_file
;
/* used to load additional hosts file for tests */
unsigned
char
dns_srv_enabled
;
};
belle_sip_hop_t
*
belle_sip_hop_new
(
const
char
*
transport
,
const
char
*
cname
,
const
char
*
host
,
int
port
);
...
...
src/channel.c
View file @
4acde249
...
...
@@ -745,8 +745,10 @@ static void channel_res_done(void *data, const char *name, struct addrinfo *ai_l
void
belle_sip_channel_resolve
(
belle_sip_channel_t
*
obj
){
channel_set_state
(
obj
,
BELLE_SIP_CHANNEL_RES_IN_PROGRESS
);
obj
->
resolver_ctx
=
belle_sip_stack_resolve
(
obj
->
stack
,
belle_sip_channel_get_transport_name_lower_case
(
obj
),
obj
->
peer_name
,
obj
->
peer_port
,
obj
->
lp
->
ai_family
,
channel_res_done
,
obj
);
//obj->resolver_ctx=belle_sip_stack_resolve_a(obj->stack, obj->peer_name, obj->peer_port, obj->lp->ai_family, channel_res_done, obj);
if
(
belle_sip_stack_dns_srv_enabled
(
obj
->
stack
))
obj
->
resolver_ctx
=
belle_sip_stack_resolve
(
obj
->
stack
,
belle_sip_channel_get_transport_name_lower_case
(
obj
),
obj
->
peer_name
,
obj
->
peer_port
,
obj
->
lp
->
ai_family
,
channel_res_done
,
obj
);
else
obj
->
resolver_ctx
=
belle_sip_stack_resolve_a
(
obj
->
stack
,
obj
->
peer_name
,
obj
->
peer_port
,
obj
->
lp
->
ai_family
,
channel_res_done
,
obj
);
if
(
obj
->
resolver_ctx
){
belle_sip_object_ref
(
obj
->
resolver_ctx
);
}
...
...
src/sipstack.c
View file @
4acde249
...
...
@@ -91,6 +91,7 @@ belle_sip_stack_t * belle_sip_stack_new(const char *properties){
stack
->
timer_config
.
T4
=
5000
;
stack
->
transport_timeout
=
30000
;
stack
->
dns_timeout
=
15000
;
stack
->
dns_srv_enabled
=
TRUE
;
stack
->
inactive_transport_timeout
=
3600
;
/*one hour*/
return
stack
;
}
...
...
@@ -111,6 +112,14 @@ void belle_sip_stack_set_dns_timeout(belle_sip_stack_t *stack, int timeout) {
stack
->
dns_timeout
=
timeout
;
}
unsigned
char
belle_sip_stack_dns_srv_enabled
(
const
belle_sip_stack_t
*
stack
)
{
return
stack
->
dns_srv_enabled
;
}
void
belle_sip_stack_enable_dns_srv
(
belle_sip_stack_t
*
stack
,
unsigned
char
enable
)
{
stack
->
dns_srv_enabled
=
enable
;
}
belle_sip_listening_point_t
*
belle_sip_stack_create_listening_point
(
belle_sip_stack_t
*
s
,
const
char
*
ipaddress
,
int
port
,
const
char
*
transport
){
belle_sip_listening_point_t
*
lp
=
NULL
;
if
(
strcasecmp
(
transport
,
"UDP"
)
==
0
)
{
...
...
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