summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c4
-rw-r--r--channels/sip/include/security_events.h3
-rw-r--r--channels/sip/security_events.c5
3 files changed, 7 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 1f45339e4..bd3e31ee3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -28107,7 +28107,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as
res = handle_request_invite(p, req, addr, seqno, recount, e, nounlock);
if (res < 9) {
- sip_report_security_event(p, req, res);
+ sip_report_security_event(NULL, &p->recv, p, req, res);
}
switch (res) {
@@ -28146,7 +28146,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as
break;
case SIP_REGISTER:
res = handle_request_register(p, req, addr, e);
- sip_report_security_event(p, req, res);
+ sip_report_security_event(p->exten, NULL, p, req, res);
break;
case SIP_INFO:
if (req->debug)
diff --git a/channels/sip/include/security_events.h b/channels/sip/include/security_events.h
index cee2fa707..1d0f58b41 100644
--- a/channels/sip/include/security_events.h
+++ b/channels/sip/include/security_events.h
@@ -38,6 +38,7 @@ void sip_report_failed_challenge_response(const struct sip_pvt *p, const char *r
void sip_report_chal_sent(const struct sip_pvt *p);
void sip_report_inval_transport(const struct sip_pvt *p, const char *transport);
void sip_digest_parser(char *c, struct digestkeys *keys);
-int sip_report_security_event(const struct sip_pvt *p, const struct sip_request *req, const int res);
+int sip_report_security_event(const char *peer, struct ast_sockaddr *addr, const struct sip_pvt *p,
+ const struct sip_request *req, const int res);
#endif
diff --git a/channels/sip/security_events.c b/channels/sip/security_events.c
index 691c5bde1..9f5d94f97 100644
--- a/channels/sip/security_events.c
+++ b/channels/sip/security_events.c
@@ -270,7 +270,8 @@ void sip_report_inval_transport(const struct sip_pvt *p, const char *transport)
ast_security_event_report(AST_SEC_EVT(&inval_transport));
}
-int sip_report_security_event(const struct sip_pvt *p, const struct sip_request *req, const int res) {
+int sip_report_security_event(const char *peer, struct ast_sockaddr *addr, const struct sip_pvt *p,
+ const struct sip_request *req, const int res) {
struct sip_peer *peer_report;
enum check_auth_result res_report = res;
@@ -288,7 +289,7 @@ int sip_report_security_event(const struct sip_pvt *p, const struct sip_request
[K_LAST] = { NULL, NULL}
};
- peer_report = sip_find_peer(p->exten, NULL, TRUE, FINDPEERS, FALSE, 0);
+ peer_report = sip_find_peer(peer, addr, TRUE, FINDPEERS, FALSE, p->socket.type);
switch(res_report) {
case AUTH_DONT_KNOW: