Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

injectCommand does not handle 'dial' #27

Open
davehorton opened this issue Dec 18, 2024 · 2 comments
Open

injectCommand does not handle 'dial' #27

davehorton opened this issue Dec 18, 2024 · 2 comments
Assignees

Comments

@davehorton
Copy link
Contributor

Say an inbound application wants to queue the caller and separately launch a dial. This requires injectCommand to support 'dial' which it currently does not

@davehorton davehorton self-assigned this Dec 18, 2024
@davehorton
Copy link
Contributor Author

example

      /* queue the caller */
      session
        .say({text: 'Please hold while we find you an agent.'})
        .enqueue({name: session.call_sid})
        .hangup()
        .send();

      await sleepFor(500);

      /* now outdial to the agent, passing on the queue name */
      session.injectCommand('dial', {
        application_sid: 'a52d6cbf-3a8b-41f7-a8d4-4b1964c52451',
        from: '15083728299',
        to: {
          type: 'phone',
          number: '15083084809'
        },
        tag: {
          queueName: session.call_sid,
          prompt: 'Hi there, we have a John Doe on the line.  Please hold and I will connect you'
        }
      })

@davehorton
Copy link
Contributor Author

minimally, need to add something like this to inject-commands.json (but need additional properties)

  "dial": {
    "properties": {
      "application_sid": "string",
      "actionHook": "string",
      "confirmHook": "string",
      "amd": "object",
      "from": "string",
      "to": "object",
      "timeout": "number",
      "tag": "object"
    },
    "required": [
      "application_sid",
      "from",
      "to"
    ]
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant