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
6757edcd
Commit
6757edcd
authored
Sep 24, 2010
by
jehan
Browse files
add registration error cause
parent
87c480fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
coreapi/callbacks.c
View file @
6757edcd
...
...
@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "private.h"
#include "mediastreamer2/mediastream.h"
static
void
register_failure
(
SalOp
*
op
,
SalError
error
,
SalReason
reason
,
const
char
*
details
);
static
void
linphone_connect_incoming
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
){
if
(
lc
->
ringstream
!=
NULL
){
...
...
@@ -426,6 +427,9 @@ static void auth_requested(SalOp *h, const char *realm, const char *username){
sal_op_authenticate
(
h
,
&
sai
);
ai
->
usecount
++
;
}
else
{
if
(
ai
&&
ai
->
works
==
FALSE
)
{
register_failure
(
h
,
SalErrorFailure
,
SalReasonForbidden
,
_
(
"Authentication failure"
));
}
if
(
lc
->
vtable
.
auth_info_requested
)
lc
->
vtable
.
auth_info_requested
(
lc
,
realm
,
username
);
}
...
...
@@ -446,6 +450,7 @@ static void register_success(SalOp *op, bool_t registered){
char
*
msg
;
cfg
->
registered
=
registered
;
linphone_proxy_config_set_error
(
cfg
,
LinphoneErrorNone
);
linphone_proxy_config_set_state
(
cfg
,
registered
?
LinphoneRegistrationOk
:
LinphoneRegistrationCleared
,
registered
?
"Registration sucessful"
:
"Unregistration done"
);
if
(
lc
->
vtable
.
display_status
){
...
...
@@ -473,6 +478,11 @@ static void register_failure(SalOp *op, SalError error, SalReason reason, const
lc
->
vtable
.
display_status
(
lc
,
msg
);
ms_free
(
msg
);
}
if
(
error
==
SalErrorFailure
&&
reason
==
SalReasonForbidden
)
{
linphone_proxy_config_set_error
(
cfg
,
LinphoneErrorBadCredentials
);
}
else
if
(
error
==
SalErrorNoResponse
)
{
linphone_proxy_config_set_error
(
cfg
,
LinphoneErrorNoResponse
);
}
linphone_proxy_config_set_state
(
cfg
,
LinphoneRegistrationFailed
,
details
);
}
...
...
coreapi/linphonecore.h
View file @
6757edcd
...
...
@@ -218,7 +218,7 @@ LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
const
char
*
linphone_call_get_refer_to
(
const
LinphoneCall
*
call
);
bool_t
linphone_call_has_transfer_pending
(
const
LinphoneCall
*
call
);
int
linphone_call_get_duration
(
const
LinphoneCall
*
call
);
const
LinphoneCallParams
linphone_call_get_current_params
(
const
LinphoneCall
*
call
);
LinphoneCallParams
linphone_call_get_current_params
(
const
LinphoneCall
*
call
);
void
linphone_call_enable_camera
(
LinphoneCall
*
lc
,
bool_t
enabled
);
bool_t
linphone_call_camera_enabled
(
const
LinphoneCall
*
lc
);
LinphoneError
linphone_call_get_error
(
const
LinphoneCall
*
call
);
...
...
coreapi/private.h
View file @
6757edcd
...
...
@@ -192,7 +192,7 @@ void linphone_core_stop_waiting(LinphoneCore *lc);
int
linphone_core_start_invite
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
,
LinphoneProxyConfig
*
dest_proxy
);
void
linphone_core_start_pending_refered_calls
(
LinphoneCore
*
lc
);
extern
SalCallbacks
linphone_sal_callbacks
;
void
linphone_proxy_config_set_error
(
LinphoneProxyConfig
*
cfg
,
LinphoneError
error
);
struct
_LinphoneProxyConfig
{
...
...
@@ -216,6 +216,7 @@ struct _LinphoneProxyConfig
bool_t
dial_escape_plus
;
void
*
user_data
;
time_t
deletion_date
;
LinphoneError
error
;
};
struct
_LinphoneAuthInfo
...
...
coreapi/proxy.c
View file @
6757edcd
...
...
@@ -829,5 +829,11 @@ LinphoneRegistrationState linphone_proxy_config_get_state(const LinphoneProxyCon
}
return
NULL
;
}
LinphoneError
linphone_proxy_config_get_error
(
const
LinphoneProxyConfig
*
cfg
)
{
return
cfg
->
error
;
}
void
linphone_proxy_config_set_error
(
LinphoneProxyConfig
*
cfg
,
LinphoneError
error
)
{
cfg
->
error
=
error
;
}
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