projects
/
lcr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
487bd4b
)
fixup
backup2
author
Andreas Eversberg
<jolly@eversberg.eu>
Sat, 2 Dec 2017 12:04:58 +0000
(13:04 +0100)
committer
Andreas Eversberg
<jolly@eversberg.eu>
Sat, 2 Dec 2017 12:04:58 +0000
(13:04 +0100)
sip.cpp
patch
|
blob
|
history
sip.h
patch
|
blob
|
history
diff --git
a/sip.cpp
b/sip.cpp
index
d8b1124
..
c3a4f00
100644
(file)
--- a/
sip.cpp
+++ b/
sip.cpp
@@
-103,7
+103,6
@@
Psip::Psip(int type, char *portname, struct port_settings *settings, struct inte
add_work(&p_s_delete, delete_event, this, 0);
p_s_handle = 0;
p_s_magic = 0;
add_work(&p_s_delete, delete_event, this, 0);
p_s_handle = 0;
p_s_magic = 0;
- memset(&p_s_auth_nonce, 0, sizeof(p_s_auth_nonce));
memset(&p_s_rtp_fd, 0, sizeof(p_s_rtp_fd));
memset(&p_s_rtcp_fd, 0, sizeof(p_s_rtcp_fd));
memset(&p_s_rtp_sin_local, 0, sizeof(p_s_rtp_sin_local));
memset(&p_s_rtp_fd, 0, sizeof(p_s_rtp_fd));
memset(&p_s_rtcp_fd, 0, sizeof(p_s_rtcp_fd));
memset(&p_s_rtp_sin_local, 0, sizeof(p_s_rtp_sin_local));
@@
-1736,7
+1735,8
@@
static void i_register(struct sip_inst *inst, int status, char const *phrase, nu
authorization = sip->sip_authorization;
status = check_authorization(authorization, "REGISTER", inst->auth_user, inst->auth_password, inst->auth_realm, inst->auth_nonce, &auth_text);
if (status == 401) {
authorization = sip->sip_authorization;
status = check_authorization(authorization, "REGISTER", inst->auth_user, inst->auth_password, inst->auth_realm, inst->auth_nonce, &auth_text);
if (status == 401) {
- generate_nonce(inst->auth_nonce);
+ if (!inst->auth_nonce[0])
+ generate_nonce(inst->auth_nonce);
SPRINT(auth_str, "Digest realm=\"%s\", nonce=\"%s\", algorithm=MD5, qop=\"auth\"", inst->auth_realm, inst->auth_nonce);
}
} else {
SPRINT(auth_str, "Digest realm=\"%s\", nonce=\"%s\", algorithm=MD5, qop=\"auth\"", inst->auth_realm, inst->auth_nonce);
}
} else {
@@
-1748,7
+1748,6
@@
static void i_register(struct sip_inst *inst, int status, char const *phrase, nu
if (status == 200) {
SCPY(inst->remote_peer, uri);
if (status == 200) {
SCPY(inst->remote_peer, uri);
- inst->auth_nonce[0] = '\0';
}
sip_trace_header(NULL, inst->interface_name, "RESPOND", DIRECTION_OUT);
}
sip_trace_header(NULL, inst->interface_name, "RESPOND", DIRECTION_OUT);
@@
-1857,7
+1856,8
@@
void Psip::i_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag
authorization = sip->sip_proxy_authorization;
status = check_authorization(authorization, "INVITE", inst->auth_user, inst->auth_password, inst->auth_realm, inst->auth_nonce, &auth_text);
if (status == 407) {
authorization = sip->sip_proxy_authorization;
status = check_authorization(authorization, "INVITE", inst->auth_user, inst->auth_password, inst->auth_realm, inst->auth_nonce, &auth_text);
if (status == 407) {
- generate_nonce(inst->auth_nonce);
+ if (!inst->auth_nonce[0])
+ generate_nonce(inst->auth_nonce);
SPRINT(auth_str, "Digest realm=\"%s\", nonce=\"%s\", algorithm=MD5, qop=\"auth\"", inst->auth_realm, inst->auth_nonce);
}
} else {
SPRINT(auth_str, "Digest realm=\"%s\", nonce=\"%s\", algorithm=MD5, qop=\"auth\"", inst->auth_realm, inst->auth_nonce);
}
} else {
@@
-1868,8
+1868,10
@@
void Psip::i_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag
end_trace();
if (status == 200) {
end_trace();
if (status == 200) {
- inst->auth_nonce[0] = '\0';
} else {
} else {
+ sip_trace_header(this, inst->interface_name, "INVITE", DIRECTION_IN);
+ end_trace();
+
sip_trace_header(this, inst->interface_name, "RESPOND", DIRECTION_OUT);
add_trace("respond", "value", "%d", status);
add_trace("reason", NULL, "peer invited");
sip_trace_header(this, inst->interface_name, "RESPOND", DIRECTION_OUT);
add_trace("respond", "value", "%d", status);
add_trace("reason", NULL, "peer invited");
diff --git
a/sip.h
b/sip.h
index
b3537e5
..
1e13aee
100644
(file)
--- a/
sip.h
+++ b/
sip.h
@@
-40,7
+40,6
@@
class Psip : public Port
struct lcr_work p_s_delete;
nua_handle_t *p_s_handle;
nua_magic_t *p_s_magic;
struct lcr_work p_s_delete;
nua_handle_t *p_s_handle;
nua_magic_t *p_s_magic;
- char p_s_auth_nonce[64];
struct lcr_timer p_s_invite_option_timer; /* time to send OPTION to invite transaction */
int p_s_invite_direction; /* DIRECTION_* of invite */
int p_s_rtp_bridge; /* bridge RTP instead of having a local RTP peer */
struct lcr_timer p_s_invite_option_timer; /* time to send OPTION to invite transaction */
int p_s_invite_direction; /* DIRECTION_* of invite */
int p_s_rtp_bridge; /* bridge RTP instead of having a local RTP peer */