ast_log(LOG_WARNING,"Huh? Not a SIP header (%s)?\n",c);
return-1;
}
@ -7336,7 +7336,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
of=get_in_brackets(from);
if(ast_strlen_zero(p->exten)){
t=uri2;
if(!strncmp(t,"sip:",4))
if(!strncasecmp(t,"sip:",4))
t+=4;
ast_copy_string(p->exten,t,sizeof(p->exten));
t=strchr(p->exten,'@');
@ -7347,7 +7347,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme
}
/* save the URI part of the From header */
ast_copy_string(p->from,of,sizeof(p->from));
if(strncmp(of,"sip:",4)){
if(strncasecmp(of,"sip:",4)){
ast_log(LOG_NOTICE,"From address missing 'sip:', using it anyway\n");
}else
of+=4;
@ -11354,8 +11354,24 @@ static int handle_request_register(struct sip_pvt *p, struct sip_request *req, i
ast_verbose("Using latest REGISTER request as basis request\n");
copy_request(&p->initreq,req);
check_via(p,req);
if((res=register_verify(p,sin,req,e,ignore))<0)
ast_log(LOG_NOTICE,"Registration from '%s' failed for '%s' - %s\n",get_header(req,"To"),ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr),(res==-1)?"Wrong password":(res==-2?"Username/auth name mismatch":"Not a local SIP domain"));
if((res=register_verify(p,sin,req,e,ignore))<0){
constchar*error;
switch(res){
case-1:error="Wrong password";
break;
case-2:error="Username/auth name mismatch";
break;
case-3:error="Not a local SIP domain";
break;
case-4:error="ACL error (permit/deny)";
break;
case-5:error="Peer is not supposed to register";
break;
default:error="Unknown error";
break;
}
ast_log(LOG_NOTICE,"Registration from '%s' failed for '%s' - %s\n",get_header(req,"To"),ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr),error);
}
if(res<1){
/* Destroy the session, but keep us around for just a bit in case they don't