[ previous ] [ next ] [ threads ]
 To :  "yate@v..." <yate@v...>
 From :  Rodrigo Ricardo Passos <rodrigopassos@g...>
 Subject :  Help with auth.user
 Date :  Mon, 23 Dec 2013 13:09:07 -0200
Hi all,

I'm write a custom authentication script, integrated with application of 
mine company.
I have an invite message with username after deny the first request on 
the call.route message, but in auth.user on the invite method, the 
invite can't be reject.
The authentication inside the second INVITE,  are treated in the 
user.auth like the REGISTER method. If I change the password to test and 
drop the invite request, the second invite can't be ignored. Follow my 
user.auth using inside the invite method:

                     case "user.auth": {
                         if 
(currentEvent.params.get("method").equals("REGISTER")) {
                             String userAuth = 
currentEvent.params.get("username");
                             Yate.output("Login User: " + 
currentEvent.params.get("username"));
                             if (userAuth == null) {
                                 currentEvent.handled = false;
                                 try {
Yate.acknowledge(currentEvent);
                                 } catch (Exception ex) {
                                     Yate.output("Exception error: " + 
ex.getMessage());
                                 }
                             } else {
                                 Yate.output("Event Auth: " + currentEvent);
                                 currentEvent.retVal = 
ossSessionRemote.uacAuthUser(currentEvent.params.get("username"), 
currentEvent.params.get("ip_host"));
                                 currentEvent.handled = true;
                                 try {
Yate.acknowledge(currentEvent);
                                 } catch (Exception ex) {
                                     Yate.output("Exception error: " + 
ex.getMessage());
                                 }
                             }
                         } else if 
(currentEvent.params.get("method").equals("INVITE")) {
                             int statusUas = 
ossSessionRemote.checkUasPrerouting(currentEvent.params.get("ip_host"));
                             if (statusUas == 1) {
                                 authStatus = 1;
                                 currentEvent.handled = true;
                                 try {
Yate.acknowledge(currentEvent);
                                 } catch (Exception ex) {
                                     Yate.output("Exception error: " + 
ex.getMessage());
                                 }
                             } else {
                                 Yate.output("User AUTH INVITE: " + 
currentEvent);
                                 if (currentEvent.params.get("username") 
!= null) {
                                     authStatus = 1;
                                     Yate.output("User Accept: " + 
currentEvent.params.get("username"));
                                     currentEvent.retVal = 
ossSessionRemote.uacAuthUser(currentEvent.params.get("username"), 
currentEvent.params.get("ip_host"));
                                     currentEvent.handled = true;
                                     try {
Yate.acknowledge(currentEvent);
                                     } catch (Exception ex) {
                                         Yate.output("Exception error: " 
+ ex.getMessage());
                                     }
                                 } else {
                                     currentEvent.retVal = "-";
                                     currentEvent.handled = true;
                                     try {
Yate.acknowledge(currentEvent);
                                     } catch (Exception ex) {
                                         Yate.output("Exception error: " 
+ ex.getMessage());
                                     }
                                 }
                             }
                         } else {
                             Yate.output("Outro user.auth: " + 
currentEvent);
                             currentEvent.retVal = "-";
                             currentEvent.handled = true;
                             try {
                                 Yate.acknowledge(currentEvent);
                             } catch (Exception ex) {
                                 Yate.output("Exception error: " + 
ex.getMessage());
                             }
                         }
                         break;
                     }

The method 
ossSessionRemote.uacAuthUser(currentEvent.params.get("username"), 
currentEvent.params.get("ip_host")) return the password to Yate. This 
method to register the user is ok. If an wrong password is sent, the 
user can't register in Yate.

If the password isn't the same of sent by the user client, the invite 
method  had to be rejected in the auth.user, but this it doesn't occurs. 
Where the invite with wrong password will be rejected?
Could you help me with this issue?

Regards,

Rodrigo