External authentication
Now, I’m sure I’ve read about this somewhere, and now I need to do it, I can’t find it of course! Basically need to hand the user authentication off to another server, via https. Got this kind of thing working nicely in the dialplan using httapi, but can’t figure out how to do it for user registration? Needs to be real time, so exporting directory XML *to* FS isn’t going to do it. Any ideas?
Hi Rick, I use this library: https://github.com/soulhunter1987/freeswitch-curl to handle the real time user authentication vía http with the data into a mysql database. José David Jurado Alonso <josedavid@zennio.com> *Área de Desarrollo de Software de Alto Nivel* *Dpto. Ingeniería* Zennio Avance y Tecnología, S.L. C/ Rio Jarama,132 <https://maps.google.com/?q=C/+Rio+Jarama,132&entry=gmail&source=g>. Nave P-8.11 45007 - Toledo (Spain) T: +34 925 232 002 <+34%20925%2023%2020%2002> www.zennio.com [image: Descripción: Descripción: C:\Users\jjmanjarres\Desktop\Z zennio.jpg] [image: Descripción: Descripción: C:\Users\jjmanjarres\Desktop\twitter.jpg] [image: Descripción: Descripción: C:\Users\jjmanjarres\Desktop\descarga.jpg] [image: Descripción: Descripción: C:\Users\jjmanjarres\Desktop\linkedin.png] [image: Descripción: Descripción: C:\Users\jjmanjarres\Desktop\youtube.jpg] Zennio Avance y Tecnología S.L le informa de los siguientes extremos: Los datos por usted suministrados pasarán a formar parte de un fichero cuyo responsable es Zennio Avance y Tecnología S.L. Dicho fichero se encuentra legalmente inscrito en el Registro General de Protección de Datos de la Agencia Española de Protección de Datos. Los datos por usted suministrados serán empleados con fines de gestión, Zennio Avance y Tecnología S.L ha adoptado las medidas de seguridad exigidas en función del nivel de los datos suministrados, instalando las medidas técnicas y organizativas necesarias, habida cuenta del estado de la tecnología, a fin de evitar su pérdida, alteración, uso inadecuado o accesos no autorizados a los mismos. Para el ejercicio de sus derechos de acceso, rectificación, cancelación y oposición deberá dirigirse a la dirección del Responsable de Fichero Zennio Avance y Tecnología S.L C/ Rio Jarama, 132. Nave P-8.11, 45007, TOLEDO o a la dirección de correo electrónico: info@zennio.com Please, consider the environment before printing this e-mail... Save energy! Por favor, piensa en el medio ambiente antes de imprimir este e-mail... ¡Ahorra energía! Disclaimer: This message and any attached files transmitted with it, is confidential, especially as regards personal data. It is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient and have received this information in error or have accessed it for any reason, please notify us of this fact by email reply and then destroy or delete the message, refraining from any reproduction, use, alteration, filing or communication to third parties of this message and attached files on penalty of incurring legal responsibilities. The opinions contained in this message and the attached archives, belong exclusively to their sender and they do not represent the opinion of the company unless it is said specifically and the sender is authorized for it. The sender does not guarantee the integrity, the accuracy, the swift delivery or the security of this email transmission, and assumes no responsibility for any possible damage incurred through data capture, virus incorporation or any manipulation carried out by third parties. Advertencia legal: Este mensaje y, en su caso, los ficheros anexos son confidenciales, especialmente en lo que respecta a los datos personales, y se dirigen exclusivamente al destinatario referenciado. Si usted no lo es y lo ha recibido por error o tiene conocimiento del mismo por cualquier motivo, le rogamos que nos lo comunique por este medio y proceda a destruirlo o borrarlo, y que en todo caso se abstenga de utilizar, reproducir, alterar, archivar o comunicar a terceros el presente mensaje y ficheros anexos, todo ello bajo pena de incurrir en responsabilidades legales. Las opiniones contenidas en este mensaje y en los archivos adjuntos, pertenecen exclusivamente a su remitente y no representan la opinión de la empresa salvo que se diga expresamente y el remitente esté autorizado para ello. El emisor no garantiza la integridad, rapidez o seguridad del presente correo, ni se responsabiliza de posibles perjuicios derivados de la captura, incorporaciones de virus o cualesquiera otras manipulaciones efectuadas por terceros. 2018-05-15 13:37 GMT+02:00 Rick Jarvis <rick@magicmail.mooo.com>:
Now, I’m sure I’ve read about this somewhere, and now I need to do it, I can’t find it of course!
Basically need to hand the user authentication off to another server, via https.
Got this kind of thing working nicely in the dialplan using httapi, but can’t figure out how to do it for user registration? Needs to be real time, so exporting directory XML *to* FS isn’t going to do it.
Any ideas?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks José, It’s the XML_CURL binding bit that’s relevant to me then, as the server it’s querying is something we've written already. <bindings> <binding name="directory"> <param name="gateway-url" value="https://server/xmlcurl" bindings="directory"/> </binding> </bindings> So I’m seeing posts come into my server from general stuff, but nothing when I try and authenticate with it (via Verto). On the FS console I’m seeing: "jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "Authentication Required" } So I guess either it’s not working, or maybe FS doesn’t support Curl directories for Verto?
On 15 May 2018, at 13:01, Jose David Jurado Alonso <josedavid@zennio.com> wrote:
Hi Rick,
I use this library:
https://github.com/soulhunter1987/freeswitch-curl <https://github.com/soulhunter1987/freeswitch-curl>
to handle the real time user authentication vía http with the data into a mysql database.
José David Jurado Alonso <josedavid@zennio.com <mailto:josedavid@zennio.com>>
Área de Desarrollo de Software de Alto Nivel
Dpto. Ingeniería
Zennio Avance y Tecnología, S.L.
C/ Rio Jarama,132 <https://maps.google.com/?q=C/+Rio+Jarama,132&entry=gmail&source=g>. Nave P-8.11
45007 - Toledo (Spain)
T: +34 925 232 002 <tel:+34%20925%2023%2020%2002>
www.zennio.com <http://www.zennio.com/>
Zennio Avance y Tecnología S.L le informa de los siguientes extremos: Los datos por usted suministrados pasarán a formar parte de un fichero cuyo responsable es Zennio Avance y Tecnología S.L. Dicho fichero se encuentra legalmente inscrito en el Registro General de Protección de Datos de la Agencia Española de Protección de Datos. Los datos por usted suministrados serán empleados con fines de gestión, Zennio Avance y Tecnología S.L ha adoptado las medidas de seguridad exigidas en función del nivel de los datos suministrados, instalando las medidas técnicas y organizativas necesarias, habida cuenta del estado de la tecnología, a fin de evitar su pérdida, alteración, uso inadecuado o accesos no autorizados a los mismos. Para el ejercicio de sus derechos de acceso, rectificación, cancelación y oposición deberá dirigirse a la dirección del Responsable de Fichero Zennio Avance y Tecnología S.L C/ Rio Jarama, 132. Nave P-8.11, 45007, TOLEDO o a la dirección de correo electrónico: info@zennio.com <mailto:info@zennio.com>
Please, consider the environment before printing this e-mail... Save energy! Por favor, piensa en el medio ambiente antes de imprimir este e-mail... ¡Ahorra energía! Disclaimer: This message and any attached files transmitted with it, is confidential, especially as regards personal data. It is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient and have received this information in error or have accessed it for any reason, please notify us of this fact by email reply and then destroy or delete the message, refraining from any reproduction, use, alteration, filing or communication to third parties of this message and attached files on penalty of incurring legal responsibilities. The opinions contained in this message and the attached archives, belong exclusively to their sender and they do not represent the opinion of the company unless it is said specifically and the sender is authorized for it. The sender does not guarantee the integrity, the accuracy, the swift delivery or the security of this email transmission, and assumes no responsibility for any possible damage incurred through data capture, virus incorporation or any manipulation carried out by third parties. Advertencia legal: Este mensaje y, en su caso, los ficheros anexos son confidenciales, especialmente en lo que respecta a los datos personales, y se dirigen exclusivamente al destinatario referenciado. Si usted no lo es y lo ha recibido por error o tiene conocimiento del mismo por cualquier motivo, le rogamos que nos lo comunique por este medio y proceda a destruirlo o borrarlo, y que en todo caso se abstenga de utilizar, reproducir, alterar, archivar o comunicar a terceros el presente mensaje y ficheros anexos, todo ello bajo pena de incurrir en responsabilidades legales. Las opiniones contenidas en este mensaje y en los archivos adjuntos, pertenecen exclusivamente a su remitente y no representan la opinión de la empresa salvo que se diga expresamente y el remitente esté autorizado para ello. El emisor no garantiza la integridad, rapidez o seguridad del presente correo, ni se responsabiliza de posibles perjuicios derivados de la captura, incorporaciones de virus o cualesquiera otras manipulaciones efectuadas por terceros.
2018-05-15 13:37 GMT+02:00 Rick Jarvis <rick@magicmail.mooo.com <mailto:rick@magicmail.mooo.com>>: Now, I’m sure I’ve read about this somewhere, and now I need to do it, I can’t find it of course!
Basically need to hand the user authentication off to another server, via https.
Got this kind of thing working nicely in the dialplan using httapi, but can’t figure out how to do it for user registration? Needs to be real time, so exporting directory XML *to* FS isn’t going to do it.
Any ideas?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://confluence.freeswitch.org <http://confluence.freeswitch.org/> http://www.cluecon.com <http://www.cluecon.com/>
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org <http://www.freeswitch.org/> _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
it certainly can do curl directory lookups with verto. if you do the api command “xml_curl debug_on” it will provide more details of the requests and responses, it looks like you are not handling the request in your cgi the way we expect.
On May 15, 2018, at 2:44 PM, Rick Jarvis <rick@magicmail.mooo.com> wrote:
Thanks José,
It’s the XML_CURL binding bit that’s relevant to me then, as the server it’s querying is something we've written already.
<bindings> <binding name="directory"> <param name="gateway-url" value="https://server/xmlcurl <https://server/xmlcurl>" bindings="directory"/> </binding> </bindings>
So I’m seeing posts come into my server from general stuff, but nothing when I try and authenticate with it (via Verto).
On the FS console I’m seeing:
"jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "Authentication Required" }
So I guess either it’s not working, or maybe FS doesn’t support Curl directories for Verto?
What am I looking for exactly? I am seeing: mod_verto.c:1876 BAD READ -1000 …which sounds relevant. But I’m not seeing anything on my app receiving the request (I’ve got that simply console logging anything that hits the URL, and nothing happens when doing the Verto login…)
On 15 May 2018, at 20:40, Michael Jerris <mike@jerris.com> wrote:
it certainly can do curl directory lookups with verto. if you do the api command “xml_curl debug_on” it will provide more details of the requests and responses, it looks like you are not handling the request in your cgi the way we expect.
On May 15, 2018, at 2:44 PM, Rick Jarvis <rick@magicmail.mooo.com <mailto:rick@magicmail.mooo.com>> wrote:
Thanks José,
It’s the XML_CURL binding bit that’s relevant to me then, as the server it’s querying is something we've written already.
<bindings> <binding name="directory"> <param name="gateway-url" value="https://server/xmlcurl <https://server/xmlcurl>" bindings="directory"/> </binding> </bindings>
So I’m seeing posts come into my server from general stuff, but nothing when I try and authenticate with it (via Verto).
On the FS console I’m seeing:
"jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "Authentication Required" }
So I guess either it’s not working, or maybe FS doesn’t support Curl directories for Verto?
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
if you have it not hitting curl at all (and you have xml_curl debug_on enabled) and you see nothing, it sounds like the connection is failing before it even gets that far. Its hard to tell why with tiny snippets of information cherry picked out like below. Something in verto settings i would suspect. You can try to enable verto debug to get some more info possibly.
On May 15, 2018, at 4:17 PM, Rick Jarvis <rick@magicmail.mooo.com> wrote:
What am I looking for exactly? I am seeing:
mod_verto.c:1876 BAD READ -1000
…which sounds relevant. But I’m not seeing anything on my app receiving the request (I’ve got that simply console logging anything that hits the URL, and nothing happens when doing the Verto login…)
On 15 May 2018, at 20:40, Michael Jerris <mike@jerris.com <mailto:mike@jerris.com>> wrote:
it certainly can do curl directory lookups with verto. if you do the api command “xml_curl debug_on” it will provide more details of the requests and responses, it looks like you are not handling the request in your cgi the way we expect.
On May 15, 2018, at 2:44 PM, Rick Jarvis <rick@magicmail.mooo.com <mailto:rick@magicmail.mooo.com>> wrote:
Thanks José,
It’s the XML_CURL binding bit that’s relevant to me then, as the server it’s querying is something we've written already.
<bindings> <binding name="directory"> <param name="gateway-url" value="https://server/xmlcurl <https://server/xmlcurl>" bindings="directory"/> </binding> </bindings>
So I’m seeing posts come into my server from general stuff, but nothing when I try and authenticate with it (via Verto).
On the FS console I’m seeing:
"jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "Authentication Required" }
So I guess either it’s not working, or maybe FS doesn’t support Curl directories for Verto?
_
Ok, so I’ve stripped everything out to a very basic verto setup. - I *am* seeing the POST requests for a ‘normal’ sip authentication attempt, eg from an ip phone. - I am not however seeing any POST requests for the verto auth request I am seeing a ‘reconnect’, even after restarting FS, so I’m wondering if that’s part of my problem - do the sessions persist after a restart? How would I force a new session? Still getting ‘authentication required’ and ‘missing or improper credentials’ Debug & js below: // fs output 2018-05-16 14:38:03.656190 [DEBUG] mod_verto.c:4139 x.x.x.x:65349 Client Connect from x.x.x.x:65349 accepted 2018-05-16 14:38:03.656190 [DEBUG] mod_verto.c:1992 x.x.x.x:65349 Starting client thread. 2018-05-16 14:38:03.696189 [ALERT] mod_verto.c:1384 READ x.x.x.x:65349 [{ "jsonrpc": "2.0", "method": "login", "params": { "sessid": "c674980b-27ca-4c3e-37d1-3421736b990f" }, "id": 2 }] 2018-05-16 14:38:03.696189 [DEBUG] mod_verto.c:1281 x.x.x.x:65349 re-connecting session c674980b-27ca-4c3e-37d1-3421736b990f 2018-05-16 14:38:03.696189 [ALERT] mod_verto.c:604 WRITE x.x.x.x:65349 [{ "jsonrpc": "2.0", "id": 2, "error": { "code": -32000, "message": "Authentication Required" } }] 2018-05-16 14:38:03.696189 [ALERT] mod_verto.c:1384 READ x.x.x.x:65349 [{ "jsonrpc": "2.0", "method": "login", "params": { "sessid": "c674980b-27ca-4c3e-37d1-3421736b990f" }, "id": 1 }] 2018-05-16 14:38:03.696189 [ALERT] mod_verto.c:604 WRITE x.x.x.x:65349 [{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "Authentication Required" } }] 2018-05-16 14:38:03.696189 [ALERT] mod_verto.c:1384 READ x.x.x.x:65349 [{ "jsonrpc": "2.0", "method": "login", "params": { "login": “203@xxxx", "passwd": "password", "loginParams": { }, "userVariables": { }, "sessid": "c674980b-27ca-4c3e-37d1-3421736b990f" }, "id": 3 }] 2018-05-16 14:38:03.696189 [ALERT] mod_verto.c:604 WRITE x.x.x.x:65349 [{ "jsonrpc": "2.0", "id": 3, "error": { "code": -32001, "message": "Missing or improper credentials" } }] //verto_client.js var vertoHandle, vertoCallbacks; vertoCallbacks = { onWSLogin: onWSLogin, onWSClose: onWSClose, onDialogState: onDialogState }; $(document).ready(function() { $.verto.init({}, bootstrap); }); function onWSLogin(verto, success) { console.log('onWSLogin', success); }; function onWSClose(verto, success) { console.log('onWSClose', success); }; function onDialogState(d) { console.log ("XXXX DIALOG: ", d.state.name); }; function bootstrap(status) { console.log('bootstrap'); vertoHandle = new jQuery.verto({ login: ‘203@xxxx', passwd: 'password', socketUrl: 'wss://redio.siplink.uk:8082', ringFile: 'sounds/bell_ring2.wav', iceServers: [ { url: 'stun:stun.freeswitch.org', }, ], deviceParams: { useMic: 'any', useSpeak: 'any', }, tag: "video-container" }, vertoCallbacks); };
On 15 May 2018, at 21:22, Michael Jerris <mike@jerris.com> wrote:
if you have it not hitting curl at all (and you have xml_curl debug_on enabled) and you see nothing, it sounds like the connection is failing before it even gets that far. Its hard to tell why with tiny snippets of information cherry picked out like below. Something in verto settings i would suspect. You can try to enable verto debug to get some more info possibly.
On May 15, 2018, at 4:17 PM, Rick Jarvis <rick@magicmail.mooo.com <mailto:rick@magicmail.mooo.com>> wrote:
What am I looking for exactly? I am seeing:
mod_verto.c:1876 BAD READ -1000
…which sounds relevant. But I’m not seeing anything on my app receiving the request (I’ve got that simply console logging anything that hits the URL, and nothing happens when doing the Verto login…)
On 15 May 2018, at 20:40, Michael Jerris <mike@jerris.com <mailto:mike@jerris.com>> wrote:
it certainly can do curl directory lookups with verto. if you do the api command “xml_curl debug_on” it will provide more details of the requests and responses, it looks like you are not handling the request in your cgi the way we expect.
On May 15, 2018, at 2:44 PM, Rick Jarvis <rick@magicmail.mooo.com <mailto:rick@magicmail.mooo.com>> wrote:
Thanks José,
It’s the XML_CURL binding bit that’s relevant to me then, as the server it’s querying is something we've written already.
<bindings> <binding name="directory"> <param name="gateway-url" value="https://server/xmlcurl <https://server/xmlcurl>" bindings="directory"/> </binding> </bindings>
So I’m seeing posts come into my server from general stuff, but nothing when I try and authenticate with it (via Verto).
On the FS console I’m seeing:
"jsonrpc": "2.0", "id": 1, "error": { "code": -32000, "message": "Authentication Required" }
So I guess either it’s not working, or maybe FS doesn’t support Curl directories for Verto?
_
Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Jose David Jurado Alonso
-
Michael Jerris
-
Rick Jarvis