{"id":23221,"date":"2025-05-17T22:05:40","date_gmt":"2025-05-18T02:05:40","guid":{"rendered":"https:\/\/redvoztelecom.com\/?page_id=23221"},"modified":"2025-05-17T22:05:40","modified_gmt":"2025-05-18T02:05:40","slug":"23221-2","status":"publish","type":"page","link":"https:\/\/redvoztelecom.com\/fr\/23221-2\/","title":{"rendered":""},"content":{"rendered":"<p><!DOCTYPE html><br \/>\n<html lang=\"es\"><br \/>\n<head><br \/>\n  <meta charset=\"UTF-8\" \/><br \/>\n  <title>Maestro de Idiomas AI<\/title><\/p>\n<style>\n    \/* Estilos b\u00e1sicos para el chat *\/\n    #chat { border: 1px solid #ccc; padding: 10px; width: 400px; height: 300px; overflow-y: scroll; }\n    #input { width: 300px; }\n  <\/style>\n<p><\/head><br \/>\n<body><\/p>\n<h1>Bienvenido al Maestro de Idiomas AI<\/h1>\n<div>\n    <label for=\"idioma\">Idioma a aprender:<\/label><br \/>\n    <select id=\"idioma\"><option value=\"en\">Ingl\u00e9s<\/option><option value=\"fr\">Franc\u00e9s<\/option><!-- Agrega m\u00e1s opciones seg\u00fan necesidad --><br \/>\n    <\/select>\n  <\/div>\n<div>\n    <label for=\"nivel\">Nivel:<\/label><br \/>\n    <select id=\"nivel\"><option value=\"principiante\">Principiante<\/option><option value=\"intermedio\">Intermedio<\/option><option value=\"avanzado\">Avanzado<\/option><\/select>\n  <\/div>\n<div id=\"chat\"><\/div>\n<p>  <input type=\"text\" id=\"input\" placeholder=\"Escribe tu mensaje...\" \/><br \/>\n  <button onclick=\"enviarMensaje()\">Enviar<\/button><\/p>\n<p>  <script>\n    async function enviarMensaje() {\n      const mensaje = document.getElementById('input').value;\n      const idioma = document.getElementById('idioma').value;\n      const nivel = document.getElementById('nivel').value;<\/p>\n<p>      const respuesta = await fetch('\/api\/chat', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\/json' },\n        body: JSON.stringify({ mensaje, idioma, nivel })\n      });\n      const datos = await respuesta.json();<\/p>\n<p>      const chat = document.getElementById('chat');\n      chat.innerHTML += `<\/p>\n<p><strong>T\u00fa:<\/strong> ${mensaje}<\/p>\n<p>`;\n      chat.innerHTML += `<\/p>\n<p><strong>Maestro:<\/strong> ${datos.respuesta}<\/p>\n<p>`;<\/p>\n<p>      \/\/ Reproducir la respuesta con voz\n      const utterance = new SpeechSynthesisUtterance(datos.respuesta);\n      utterance.lang = idioma;\n      speechSynthesis.speak(utterance);<\/p>\n<p>      document.getElementById('input').value = '';\n    }\n  <\/script><br \/>\n<\/body><br \/>\n<\/html><\/p>\n<p>\/\/ Configuraci\u00f3n de SIP.js en el frontend<br \/>\nconst userAgent = new SIP.UA({<br \/>\n  uri: &#8216;usuario@tuservidorvoip.com&#8217;,<br \/>\n  transportOptions: {<br \/>\n    wsServers: [&#8216;wss:\/\/tuservidorvoip.com\/ws&#8217;]<br \/>\n  },<br \/>\n  authorizationUser: &#8216;usuario&#8217;,<br \/>\n  password: &#8216;contrase\u00f1a&#8217;<br \/>\n});<\/p>\n<p>\/\/ Realizar una llamada<br \/>\nconst session = userAgent.invite(&#8216;sip:extension@tuservidorvoip.com&#8217;);<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"qua-blog-post-description\">Maestro de Idiomas AI Bienvenido al Maestro de Idiomas AI Idioma a aprender: Ingl\u00e9sFranc\u00e9s Nivel: PrincipianteIntermedioAvanzado Enviar \/\/ Configuraci\u00f3n de SIP.js en el frontend const userAgent = new SIP.UA({ uri: &#8216;usuario@tuservidorvoip.com&#8217;, transportOptions: { wsServers: [&#8216;wss:\/\/tuservidorvoip.com\/ws&#8217;] }, authorizationUser: &#8216;usuario&#8217;, password: &#8216;contrase\u00f1a&#8217; }); \/\/ Realizar una llamada const session = userAgent.invite(&#8216;sip:extension@tuservidorvoip.com&#8217;);<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"full-width.php","meta":{"footnotes":""},"class_list":["post-23221","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/pages\/23221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/comments?post=23221"}],"version-history":[{"count":6,"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/pages\/23221\/revisions"}],"predecessor-version":[{"id":23227,"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/pages\/23221\/revisions\/23227"}],"wp:attachment":[{"href":"https:\/\/redvoztelecom.com\/fr\/wp-json\/wp\/v2\/media?parent=23221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}