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));
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 {
if (status == 200) {
SCPY(inst->remote_peer, uri);
- inst->auth_nonce[0] = '\0';
}
sip_trace_header(NULL, inst->interface_name, "RESPOND", DIRECTION_OUT);
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 {
end_trace();
if (status == 200) {
- inst->auth_nonce[0] = '\0';
} 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");