Kotlin

Crea tu aplicación de Vonage

En este paso crearás una cuenta de Vonage Aplicaciones capaz de casos de uso de comunicación de voz dentro de la aplicación.

Abre un nuevo terminal y, si es necesario, ve al directorio de tu proyecto.

Crea una aplicación Vonage copiando y pegando el siguiente comando en el terminal:

vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application' ✅ Creating Application Saving private key ... Done! Application created Name: Your application Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: None Enabled

Ahora que ya has creado tu aplicación de Vonage, actualiza tu autorización CLI con el ID de la aplicación y la clave privada:

vonage auth set `
--local `
--api-key='your-api-key' `
--api-secret='your-api-secret' `
--app-id='your-application-id' `
--private-key=C:\path\to\private.key

API Key: your-api-key
API Secret: your-**************
App ID: your-application-id
Private Key: Is Set

✅ Checking API Key Secret
✅ Checking App ID and Private Key
vonage auth set ^
--local ^
--api-key='your-api-key' ^
--api-secret='your-api-secret' ^ 
--app-id='your-application-id' ^
--private-key=C:\path\to\private.key

API Key: your-api-key
API Secret: your-**************
App ID: your-application-id
Private Key: Is Set

✅ Checking API Key Secret
✅ Checking App ID and Private Key
vonage auth set \ --local \ --api-key='your-api-key' \ --api-secret='your-api-secret' \ --app-id='your-application-id' \ --private-key=/path/to/private.key API Key: your-api-key API Secret: your-************** App ID: your-application-id Private Key: Is Set ✅ Checking API Key Secret ✅ Checking App ID and Private Key

Luego, configura los webhooks en tu aplicación de Vonage. Asegúrate de cambiar los valores de --voice-answer-url y --voice-event-url sustituyendo las URL por https://SUBDOMAIN.loca.lt/voice/answer y https://SUBDOMAIN.loca.lt/voice/event respectivamente. SUBDOMAIN es el valor real utilizado en el paso anterior:

vonage apps capabilities update 00000000-0000-0000-0000-000000000000 voice `
  --voice-answer-url='https://example.com/webhooks/voice/answer' `
  --voice-event-url='https://example.com/webhooks/voice/event' `
  --voice-fallback-url='https://example.com/webhooks/voice/fallback'
  
✅ Fetching Application
✅ Adding voice capability to application 00000000-0000-0000-0000-000000000000

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
 VOICE:
    Uses Signed callbacks: On
    Conversation TTL: 41 hours
    Leg Persistence Time: 6 days
    Event URL: [POST] https://example.com/webhooks/voice/event
    Answer URL: [POST] https://example.com/webhooks/voice/answer
    Fallback URL: [POST] https://example.com/webhooks/voice/fallback
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 voice ^
  --voice-answer-url='https://example.com/webhooks/voice/answer' ^
  --voice-event-url='https://example.com/webhooks/voice/event' ^
  --voice-fallback-url='https://example.com/webhooks/voice/fallback'
  
✅ Fetching Application
✅ Adding voice capability to application 00000000-0000-0000-0000-000000000000

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
 VOICE:
    Uses Signed callbacks: On
    Conversation TTL: 41 hours
    Leg Persistence Time: 6 days
    Event URL: [POST] https://example.com/webhooks/voice/event
    Answer URL: [POST] https://example.com/webhooks/voice/answer
    Fallback URL: [POST] https://example.com/webhooks/voice/fallback
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 voice \ --voice-answer-url='https://example.com/webhooks/voice/answer' \ --voice-event-url='https://example.com/webhooks/voice/event' \ --voice-fallback-url='https://example.com/webhooks/voice/fallback' ✅ Fetching Application ✅ Adding voice capability to application 00000000-0000-0000-0000-000000000000 Name: Your application Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: VOICE: Uses Signed callbacks: On Conversation TTL: 41 hours Leg Persistence Time: 6 days Event URL: [POST] https://example.com/webhooks/voice/event Answer URL: [POST] https://example.com/webhooks/voice/answer Fallback URL: [POST] https://example.com/webhooks/voice/fallback

NOTA: También puede encontrar información sobre su solicitud, incluido el identificador de solicitud, en la sección Panel de control.