projects
/
lcr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ef08f12
)
fixup
author
Andreas Eversberg
<jolly@eversberg.eu>
Sat, 2 Dec 2017 11:10:14 +0000
(12:10 +0100)
committer
Andreas Eversberg
<jolly@eversberg.eu>
Sat, 2 Dec 2017 11:10:14 +0000
(12:10 +0100)
sip.cpp
patch
|
blob
|
history
diff --git
a/sip.cpp
b/sip.cpp
index
aa28f59
..
d3bcf8a
100644
(file)
--- a/
sip.cpp
+++ b/
sip.cpp
@@
-1855,7
+1855,7
@@
void Psip::i_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag
if (inst->auth_realm[0]) {
authorization = sip->sip_proxy_authorization;
status = check_authorization(authorization, "INVITE", inst->auth_user, inst->auth_password, inst->auth_realm, p_s_auth_nonce, &auth_text);
if (inst->auth_realm[0]) {
authorization = sip->sip_proxy_authorization;
status = check_authorization(authorization, "INVITE", inst->auth_user, inst->auth_password, inst->auth_realm, p_s_auth_nonce, &auth_text);
- if (status == 40
1
) {
+ if (status == 40
7
) {
generate_nonce(p_s_auth_nonce);
SPRINT(auth_str, "Digest realm=\"%s\", nonce=\"%s\", algorithm=MD5, qop=\"auth\"", inst->auth_realm, p_s_auth_nonce);
}
generate_nonce(p_s_auth_nonce);
SPRINT(auth_str, "Digest realm=\"%s\", nonce=\"%s\", algorithm=MD5, qop=\"auth\"", inst->auth_realm, p_s_auth_nonce);
}
@@
-1868,6
+1868,16
@@
void Psip::i_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag
if (status == 200) {
p_s_auth_nonce[0] = '\0';
if (status == 200) {
p_s_auth_nonce[0] = '\0';
+ } else {
+ sip_trace_header(this, inst->interface_name, "RESPOND", DIRECTION_OUT);
+ add_trace("respond", "value", "%d", status);
+ add_trace("reason", NULL, "peer registers");
+ end_trace();
+
+ nua_respond(nh, status, auth_text, SIPTAG_CONTACT(sip->sip_contact), TAG_IF(auth_str[0], SIPTAG_WWW_AUTHENTICATE_STR(auth_str)), TAG_END());
+// nua_handle_destroy(nh);
+// inst->register_handle = NULL;
+ return;
}
sip_trace_header(this, inst->interface_name, "Payload received", DIRECTION_NONE);
}
sip_trace_header(this, inst->interface_name, "Payload received", DIRECTION_NONE);
@@
-2217,6
+2227,12
@@
void Psip::r_invite(int status, char const *phrase, nua_t *nua, nua_magic_t *mag
add_trace("respond", "value", "%d", status);
end_trace();
add_trace("respond", "value", "%d", status);
end_trace();
+ if (status == 401 || status == 407) {
+ PDEBUG(DEBUG_SIP, "Invite challenge received\n");
+ challenge(inst, this, status, phrase, nua, magic, nh, hmagic, sip, tags);
+ return;
+ }
+
/* connect audio */
if (status == 183 || (status >= 200 && status <= 299)) {
int ret;
/* connect audio */
if (status == 183 || (status >= 200 && status <= 299)) {
int ret;
@@
-2391,7
+2407,6
@@
static void sip_callback(nua_event_t event, int status, char const *phrase, nua_
struct sip_inst *inst = (struct sip_inst *) magic;
class Port *port;
class Psip *psip = NULL;
struct sip_inst *inst = (struct sip_inst *) magic;
class Port *port;
class Psip *psip = NULL;
- int rc;
PDEBUG(DEBUG_SIP, "Event %d from SIP stack received (handle=%p)\n", event, nh);
if (!nh)
PDEBUG(DEBUG_SIP, "Event %d from SIP stack received (handle=%p)\n", event, nh);
if (!nh)
@@
-2480,14
+2495,6
@@
static void sip_callback(nua_event_t event, int status, char const *phrase, nua_
return;
}
return;
}
- switch (status) {
- case 401:
- case 407:
- rc = challenge(inst, psip, status, phrase, nua, magic, nh, hmagic, sip, tags);
- if (rc >= 0)
- return;
- }
-
switch (event) {
case nua_r_set_params:
PDEBUG(DEBUG_SIP, "setparam response\n");
switch (event) {
case nua_r_set_params:
PDEBUG(DEBUG_SIP, "setparam response\n");