diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2a0e128652e5380408f6e33a097680c24c5a7926..2751094cb0753c9ee5e96e8c26c0ac81e9512123 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -23648,6 +23648,13 @@ static int handle_request_register(struct sip_pvt *p, struct sip_request *req, s { enum check_auth_result res; + /* If this is not the intial request, and the initial request isn't + * a register, something screwy happened, so bail */ + if (p->initreq.headers && p->initreq.method != SIP_REGISTER) { + ast_log(LOG_WARNING, "Ignoring spurious REGISTER with Call-ID: %s\n", p->callid); + return -1; + } + /* Use this as the basis */ copy_request(&p->initreq, req); if (sipdebug)