# IP authorization and user authentication
route[AUTH] {
#!ifdef WITH_AUTH
#!ifdef WITH_IPAUTH
if((!is_method("REGISTER")) && allow_source_address()) {
# source IP allowed
return;
}
#!endif
if (is_method("REGISTER") || from_uri==myself) {
xlog("LOG_LOCAL3","L_INFO","authentication request from domain=$ad realm=$ar username=$Au sourceIP=$si agentHeader=$ua");
# authenticate requests
if (!auth_check("$fd", "subscriber", "1")) {
auth_challenge("$fd", "0");
exit;
}
# user authenticated - remove auth header
if(!is_method("REGISTER|PUBLISH"))
consume_credentials();
xlog("LOG_LOCAL3","L_INFO","authentication successful"); <============== At this point can I assume authentication is successful ??
}
# if caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (from_uri!=myself && uri!=myself) {
sl_send_reply("403","Not relaying");
exit;
}
#!endif
return;
}Kindly look into the snippet above. The bold lettered one. At that point can I assume authentication is successful ??On Mon, Jul 22, 2019 at 5:58 PM E. Schmidbauer <eschmidbauer@gmail.com> wrote:you should be doing some sort of authentication and then saving the user's registration data.add a route to fire an event when the registration data is saved.or even better IMO would be to use an event queue like mqueue and rtimer to push events into a queue and process them with rtimer and evapi_______________________________________________On Mon, Jul 22, 2019 at 7:46 AM Anuran Barman <anuranbarman@gmail.com> wrote:But it does not tell me if thats a successful register. I can make the user online but may be the request fails as credentials are wrong. So the REGISTER is not successful. How can I handle that?_______________________________________________On Mon, 22 Jul 2019 at 5:14 PM, David Villasmil <david.villasmil.work@gmail.com> wrote:Just as you do is_method(“INVITE”) you can do is_method(“REGISTER”) after that you can check the EXPIRE, if it is zero then it is an UN-REGISTER.--On Mon, 22 Jul 2019 at 12:35, E. Schmidbauer <eschmidbauer@gmail.com> wrote:here is a good example of how you can use evapi in kamailio:http://kb.asipto.com/kamailio:k43-async-sip-routing-nodejs#evapi_processing
here is a good example of how you can implement it with a go app:_______________________________________________On Mon, Jul 22, 2019 at 7:18 AM Anuran Barman <anuranbarman@gmail.com> wrote:It seems like this module is useful for making the connection/message flow. But that I need when I have the events of Register and unregister. How to get the events from this module?_______________________________________________On Mon, Jul 22, 2019 at 3:51 PM Anuran Barman <anuranbarman@gmail.com> wrote:Though I have already a NodeJS server running, I will try the evapi module. If there are some tutorial/Wiki on how to do this please share that with me. That will be great help.On Mon, Jul 22, 2019 at 3:39 PM E. Schmidbauer <eschmidbauer@gmail.com> wrote:I would recommend using `evapi` for something like thisYou could build a small go app that connects via evapi and send/receive events to/from kamailio._______________________________________________On Mon, Jul 22, 2019 at 3:07 AM Anuran Barman <anuranbarman@gmail.com> wrote:Hi,_______________________________________________I am integrating Kamailio into my application. I want to hook to the successful REGISTER and unregister event into Kamailio into my application. For now, I am able to hook into INVITE event and can hit my server to send a email to the callee user that user X is calling you. The way I am doing is by thisif (is_method("INVITE")) {
xlog("LOG_LOCAL3","L_INFO","invite came ($fU) ($tU)");
$var(res) = http_connect("sipnodejsserver", "/","text/plain","src_user:$fU,dst_user:$tU" ,"$avp(route)");
xlog("LOG_LOCAL3","L_INFO","request sent $avp(route) $var(res)");
setflag(FLT_ACC); # do accounting
}I need to show into my application that their SIP phone is online or not. How can I hook into this?
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users