From 25af2d71c863062868b8bda6cf83515a1935d27e Mon Sep 17 00:00:00 2001 From: Kevin Harwell Date: Wed, 12 Aug 2015 12:59:53 -0500 Subject: chan_sip.c: wrong peer searched in sip_report_security_event In chan_sip, after handling an incoming invite a security event is raised describing authorization (success, failure, etc...). However, it was doing a lookup of the peer by extension. This is fine for register messages, but in the case of an invite it may search and find the wrong peer, or a non existent one (for instance, in the case of call pickup). Also, if the peers are configured through realtime this may cause an unnecessary database lookup when caching is enabled. This patch makes it so that sip_report_security_event searches by IP address when looking for a peer instead of by extension after an invite is processed. ASTERISK-25320 #close Change-Id: I9b3f11549efb475b6561c64f0e6da1a481d98bc4 --- channels/chan_sip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'channels/chan_sip.c') 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) -- cgit v1.2.3