@jambonz/sdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/client/index.cjs +60 -13
  2. package/dist/client/index.cjs.map +1 -1
  3. package/dist/client/index.d.cts +36 -7
  4. package/dist/client/index.d.ts +36 -7
  5. package/dist/client/index.js +59 -13
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/common-BWUBZtju.d.cts +30 -0
  8. package/dist/common-BWUBZtju.d.ts +30 -0
  9. package/dist/index.cjs +364 -32
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +8 -7
  12. package/dist/index.d.ts +8 -7
  13. package/dist/index.js +360 -32
  14. package/dist/index.js.map +1 -1
  15. package/dist/rest-BF9HKZrA.d.ts +136 -0
  16. package/dist/rest-v8weIueZ.d.cts +136 -0
  17. package/dist/session-DHc6G_9y.d.cts +112 -0
  18. package/dist/session-DHc6G_9y.d.ts +112 -0
  19. package/dist/types/index.d.cts +4 -3
  20. package/dist/types/index.d.ts +4 -3
  21. package/dist/{verb-builder-But-DJle.d.cts → verb-builder-Dg_IPC4I.d.ts} +35 -2
  22. package/dist/{verb-builder-CO_qoYxC.d.ts → verb-builder-DkHAJrk4.d.cts} +35 -2
  23. package/dist/{verbs-B_afNNUM.d.cts → verbs-fjJjfGEt.d.cts} +40 -14
  24. package/dist/{verbs-B_afNNUM.d.ts → verbs-fjJjfGEt.d.ts} +40 -14
  25. package/dist/webhook/index.cjs +68 -8
  26. package/dist/webhook/index.cjs.map +1 -1
  27. package/dist/webhook/index.d.cts +45 -3
  28. package/dist/webhook/index.d.ts +45 -3
  29. package/dist/webhook/index.js +68 -9
  30. package/dist/webhook/index.js.map +1 -1
  31. package/dist/websocket/index.cjs +291 -19
  32. package/dist/websocket/index.cjs.map +1 -1
  33. package/dist/websocket/index.d.cts +198 -4
  34. package/dist/websocket/index.d.ts +198 -4
  35. package/dist/websocket/index.js +290 -20
  36. package/dist/websocket/index.js.map +1 -1
  37. package/package.json +19 -6
  38. package/schema/callbacks/base.schema.json +29 -0
  39. package/schema/callbacks/call-status.schema.json +22 -0
  40. package/schema/callbacks/conference-status.schema.json +24 -0
  41. package/schema/callbacks/conference-wait.schema.json +11 -0
  42. package/schema/callbacks/conference.schema.json +11 -0
  43. package/schema/callbacks/dequeue.schema.json +19 -0
  44. package/schema/callbacks/dial-dtmf.schema.json +18 -0
  45. package/schema/callbacks/dial-hold.schema.json +22 -0
  46. package/schema/callbacks/dial-refer.schema.json +28 -0
  47. package/schema/callbacks/dial.schema.json +31 -0
  48. package/schema/callbacks/enqueue-wait.schema.json +17 -0
  49. package/schema/callbacks/enqueue.schema.json +27 -0
  50. package/schema/callbacks/gather-partial.schema.json +54 -0
  51. package/schema/callbacks/gather.schema.json +60 -0
  52. package/schema/callbacks/listen.schema.json +21 -0
  53. package/schema/callbacks/llm.schema.json +30 -0
  54. package/schema/callbacks/message.schema.json +35 -0
  55. package/schema/callbacks/play.schema.json +36 -0
  56. package/schema/callbacks/session-new.schema.json +143 -0
  57. package/schema/callbacks/session-reconnect.schema.json +9 -0
  58. package/schema/callbacks/session-redirect.schema.json +38 -0
  59. package/schema/callbacks/sip-refer-event.schema.json +20 -0
  60. package/schema/callbacks/sip-refer.schema.json +22 -0
  61. package/schema/callbacks/sip-request.schema.json +27 -0
  62. package/schema/callbacks/transcribe-translation.schema.json +24 -0
  63. package/schema/callbacks/transcribe.schema.json +46 -0
  64. package/schema/callbacks/verb-status.schema.json +57 -0
  65. package/schema/components/actionHook.schema.json +36 -0
  66. package/schema/components/actionHookDelayAction.schema.json +37 -0
  67. package/schema/components/amd.schema.json +68 -0
  68. package/schema/components/auth.schema.json +18 -0
  69. package/schema/components/bidirectionalAudio.schema.json +22 -0
  70. package/schema/components/fillerNoise.schema.json +25 -0
  71. package/schema/components/recognizer-assemblyAiOptions.schema.json +35 -0
  72. package/schema/components/recognizer-awsOptions.schema.json +52 -0
  73. package/schema/components/recognizer-azureOptions.schema.json +32 -0
  74. package/schema/components/recognizer-cobaltOptions.schema.json +34 -0
  75. package/schema/components/recognizer-customOptions.schema.json +27 -0
  76. package/schema/components/recognizer-deepgramOptions.schema.json +147 -0
  77. package/schema/components/recognizer-elevenlabsOptions.schema.json +39 -0
  78. package/schema/components/recognizer-gladiaOptions.schema.json +8 -0
  79. package/schema/components/recognizer-googleOptions.schema.json +35 -0
  80. package/schema/components/recognizer-houndifyOptions.schema.json +53 -0
  81. package/schema/components/recognizer-ibmOptions.schema.json +54 -0
  82. package/schema/components/recognizer-nuanceOptions.schema.json +150 -0
  83. package/schema/components/recognizer-nvidiaOptions.schema.json +39 -0
  84. package/schema/components/recognizer-openaiOptions.schema.json +59 -0
  85. package/schema/components/recognizer-sonioxOptions.schema.json +46 -0
  86. package/schema/components/recognizer-speechmaticsOptions.schema.json +91 -0
  87. package/schema/components/recognizer-verbioOptions.schema.json +46 -0
  88. package/schema/components/recognizer.schema.json +212 -0
  89. package/schema/components/synthesizer.schema.json +82 -0
  90. package/schema/components/target.schema.json +105 -0
  91. package/schema/components/vad.schema.json +48 -0
  92. package/schema/jambonz-app.schema.json +106 -0
  93. package/schema/verbs/alert.schema.json +20 -0
  94. package/schema/verbs/answer.schema.json +12 -0
  95. package/schema/verbs/conference.schema.json +43 -0
  96. package/schema/verbs/config.schema.json +170 -0
  97. package/schema/verbs/dequeue.schema.json +36 -0
  98. package/schema/verbs/dial.schema.json +153 -0
  99. package/schema/verbs/dtmf.schema.json +27 -0
  100. package/schema/verbs/dub.schema.json +52 -0
  101. package/schema/verbs/enqueue.schema.json +38 -0
  102. package/schema/verbs/gather.schema.json +145 -0
  103. package/schema/verbs/hangup.schema.json +29 -0
  104. package/schema/verbs/leave.schema.json +12 -0
  105. package/schema/verbs/listen.schema.json +109 -0
  106. package/schema/verbs/llm.schema.json +131 -0
  107. package/schema/verbs/message.schema.json +30 -0
  108. package/schema/verbs/pause.schema.json +26 -0
  109. package/schema/verbs/pipeline.schema.json +61 -0
  110. package/schema/verbs/play.schema.json +69 -0
  111. package/schema/verbs/redirect.schema.json +23 -0
  112. package/schema/verbs/say.schema.json +84 -0
  113. package/schema/verbs/sip-decline.schema.json +31 -0
  114. package/schema/verbs/sip-refer.schema.json +41 -0
  115. package/schema/verbs/sip-request.schema.json +33 -0
  116. package/schema/verbs/stream.schema.json +30 -0
  117. package/schema/verbs/tag.schema.json +21 -0
  118. package/schema/verbs/transcribe.schema.json +48 -0
  119. package/dist/common-Bsqv1Brz.d.cts +0 -69
  120. package/dist/common-Bsqv1Brz.d.ts +0 -69
  121. package/dist/rest-BV_FsqnH.d.cts +0 -97
  122. package/dist/rest-CthGXHnw.d.ts +0 -97
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/listen",
4
+ "title": "Listen",
5
+ "description": "Streams real-time call audio to an external websocket endpoint. The remote endpoint receives raw audio and can optionally send audio back (bidirectional). Used for custom speech processing, real-time analysis, AI agent integration, and recording to external systems.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": {
9
+ "const": "listen",
10
+ "description": "The verb name."
11
+ },
12
+ "id": {
13
+ "type": "string",
14
+ "description": "An optional unique identifier for this verb instance."
15
+ },
16
+ "url": {
17
+ "type": "string",
18
+ "format": "uri",
19
+ "description": "The websocket URL to stream audio to.",
20
+ "examples": ["wss://myapp.example.com/audio-stream"]
21
+ },
22
+ "actionHook": {
23
+ "$ref": "../components/actionHook",
24
+ "description": "A webhook invoked when the listen session ends. Should return the next verbs to execute."
25
+ },
26
+ "wsAuth": {
27
+ "$ref": "../components/auth",
28
+ "description": "Authentication credentials for the websocket connection."
29
+ },
30
+ "mixType": {
31
+ "type": "string",
32
+ "description": "How to mix the audio channels when streaming. 'mono' sends a single mixed channel, 'stereo' sends caller and callee as separate left/right channels, 'mixed' sends both as a single mixed stream.",
33
+ "enum": ["mono", "stereo", "mixed"],
34
+ "default": "mono"
35
+ },
36
+ "metadata": {
37
+ "type": "object",
38
+ "description": "Arbitrary metadata to send to the websocket endpoint in the initial connection message.",
39
+ "additionalProperties": true
40
+ },
41
+ "sampleRate": {
42
+ "type": "number",
43
+ "description": "The audio sample rate in Hz.",
44
+ "examples": [8000, 16000, 24000],
45
+ "default": 8000
46
+ },
47
+ "finishOnKey": {
48
+ "type": "string",
49
+ "description": "A DTMF key that ends the listen session when pressed.",
50
+ "examples": ["#"]
51
+ },
52
+ "maxLength": {
53
+ "type": "number",
54
+ "description": "Maximum duration in seconds for the listen session."
55
+ },
56
+ "passDtmf": {
57
+ "type": "boolean",
58
+ "description": "If true, forward DTMF events to the websocket endpoint."
59
+ },
60
+ "playBeep": {
61
+ "type": "boolean",
62
+ "description": "If true, play a beep tone before streaming begins."
63
+ },
64
+ "disableBidirectionalAudio": {
65
+ "type": "boolean",
66
+ "description": "If true, disable receiving audio from the websocket endpoint. Audio flows only from the call to the websocket, not back."
67
+ },
68
+ "bidirectionalAudio": {
69
+ "$ref": "../components/bidirectionalAudio",
70
+ "description": "Fine-grained configuration for bidirectional audio."
71
+ },
72
+ "timeout": {
73
+ "type": "number",
74
+ "description": "Time in seconds to wait for audio activity before ending the listen session."
75
+ },
76
+ "transcribe": {
77
+ "$ref": "transcribe",
78
+ "description": "Nested transcribe verb — enables simultaneous real-time transcription of the audio being streamed."
79
+ },
80
+ "earlyMedia": {
81
+ "type": "boolean",
82
+ "description": "If true, begin streaming audio before the call is formally answered."
83
+ },
84
+ "channel": {
85
+ "type": "number",
86
+ "description": "Specific audio channel to stream. Used when streaming a single channel of a multi-channel call."
87
+ }
88
+ },
89
+ "required": ["url"],
90
+ "examples": [
91
+ {
92
+ "verb": "listen",
93
+ "url": "wss://myapp.example.com/audio-stream",
94
+ "actionHook": "/listen-complete",
95
+ "sampleRate": 16000,
96
+ "mixType": "stereo"
97
+ },
98
+ {
99
+ "verb": "listen",
100
+ "url": "wss://myapp.example.com/ai-agent",
101
+ "bidirectionalAudio": {
102
+ "enabled": true,
103
+ "streaming": true,
104
+ "sampleRate": 24000
105
+ },
106
+ "metadata": { "callType": "support", "language": "en-US" }
107
+ }
108
+ ]
109
+ }
@@ -0,0 +1,131 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/llm",
4
+ "title": "LLM",
5
+ "description": "Connects the caller to a large language model for a real-time voice conversation. Handles the complete STT → LLM → TTS pipeline, including turn detection, interruption handling, and tool/function calling. The caller speaks naturally and the LLM responds via synthesized speech. This is the primary verb for building AI voice agents on jambonz.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": {
9
+ "const": "llm",
10
+ "description": "The verb name."
11
+ },
12
+ "id": {
13
+ "type": "string",
14
+ "description": "An optional unique identifier for this verb instance."
15
+ },
16
+ "vendor": {
17
+ "type": "string",
18
+ "description": "The LLM vendor to use.",
19
+ "examples": ["openai", "anthropic", "google", "groq", "deepseek", "deepgram", "ultravox", "custom"]
20
+ },
21
+ "model": {
22
+ "type": "string",
23
+ "description": "The specific model to use from the vendor.",
24
+ "examples": ["gpt-4o", "claude-sonnet-4-20250514", "gemini-2.0-flash"]
25
+ },
26
+ "auth": {
27
+ "type": "object",
28
+ "description": "Authentication credentials for the LLM vendor API.",
29
+ "properties": {
30
+ "apiKey": {
31
+ "type": "string",
32
+ "description": "The API key for the LLM vendor."
33
+ }
34
+ },
35
+ "additionalProperties": true
36
+ },
37
+ "connectOptions": {
38
+ "type": "object",
39
+ "description": "Additional connection options for the LLM vendor, such as custom base URLs or API versions.",
40
+ "additionalProperties": true
41
+ },
42
+ "llmOptions": {
43
+ "type": "object",
44
+ "description": "Configuration passed to the LLM including the system prompt, temperature, tools/functions, and other model parameters. The structure varies by vendor but typically includes 'messages' (conversation history), 'temperature', 'tools' (function definitions), and 'maxTokens'.",
45
+ "additionalProperties": true,
46
+ "examples": [
47
+ {
48
+ "messages": [
49
+ { "role": "system", "content": "You are a helpful customer service agent for Acme Corp." }
50
+ ],
51
+ "temperature": 0.7,
52
+ "tools": [
53
+ {
54
+ "type": "function",
55
+ "function": {
56
+ "name": "lookupOrder",
57
+ "description": "Look up an order by order number",
58
+ "parameters": {
59
+ "type": "object",
60
+ "properties": {
61
+ "orderNumber": { "type": "string" }
62
+ },
63
+ "required": ["orderNumber"]
64
+ }
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ ]
70
+ },
71
+ "mcpServers": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "object",
75
+ "properties": {
76
+ "url": {
77
+ "type": "string",
78
+ "format": "uri",
79
+ "description": "The URL of the MCP server."
80
+ },
81
+ "auth": {
82
+ "type": "object",
83
+ "description": "Authentication for the MCP server.",
84
+ "additionalProperties": true
85
+ },
86
+ "roots": {
87
+ "type": "array",
88
+ "items": { "type": "object" },
89
+ "description": "MCP root definitions."
90
+ }
91
+ },
92
+ "required": ["url"]
93
+ },
94
+ "description": "Model Context Protocol servers to connect to. MCP servers provide tools that the LLM can invoke during the conversation."
95
+ },
96
+ "actionHook": {
97
+ "$ref": "../components/actionHook",
98
+ "description": "A webhook invoked when the LLM conversation ends. Receives conversation details and should return the next verbs to execute."
99
+ },
100
+ "eventHook": {
101
+ "$ref": "../components/actionHook",
102
+ "description": "A webhook invoked for real-time events during the LLM conversation (e.g. tool calls, transcription events)."
103
+ },
104
+ "toolHook": {
105
+ "$ref": "../components/actionHook",
106
+ "description": "A webhook invoked when the LLM calls a tool/function. Receives the tool name and arguments, and should return the tool result."
107
+ },
108
+ "events": {
109
+ "type": "array",
110
+ "items": { "type": "string" },
111
+ "description": "List of event types to receive via the eventHook."
112
+ }
113
+ },
114
+ "required": ["vendor", "llmOptions"],
115
+ "examples": [
116
+ {
117
+ "verb": "llm",
118
+ "vendor": "openai",
119
+ "model": "gpt-4o",
120
+ "auth": { "apiKey": "sk-..." },
121
+ "llmOptions": {
122
+ "messages": [
123
+ { "role": "system", "content": "You are a helpful customer service agent. Be concise and friendly." }
124
+ ],
125
+ "temperature": 0.7
126
+ },
127
+ "actionHook": "/llm-complete",
128
+ "toolHook": "/llm-tool-call"
129
+ }
130
+ ]
131
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/message",
4
+ "title": "Message",
5
+ "description": "Sends an SMS or MMS message. Can be used during a voice call to send a text message to the caller or another party, or as a standalone action.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": { "const": "message" },
9
+ "id": { "type": "string", "description": "An optional unique identifier for this verb instance." },
10
+ "to": { "type": "string", "description": "The destination phone number in E.164 format.", "examples": ["+15085551212"] },
11
+ "from": { "type": "string", "description": "The sender phone number in E.164 format. Must be a number provisioned on the jambonz platform.", "examples": ["+15085559876"] },
12
+ "text": { "type": "string", "description": "The text content of the message." },
13
+ "media": {
14
+ "oneOf": [
15
+ { "type": "string", "format": "uri" },
16
+ { "type": "array", "items": { "type": "string", "format": "uri" } }
17
+ ],
18
+ "description": "URL(s) of media to attach to the message (MMS). Can be images, audio, or video.",
19
+ "examples": ["https://example.com/images/receipt.png"]
20
+ },
21
+ "carrier": { "type": "string", "description": "The messaging carrier to use. If not specified, the default carrier is used." },
22
+ "account_sid": { "type": "string", "description": "The account SID to use for sending. Defaults to the current account." },
23
+ "message_sid": { "type": "string", "description": "An optional message SID for tracking." },
24
+ "actionHook": { "$ref": "../components/actionHook", "description": "A webhook invoked when the message send completes or fails." }
25
+ },
26
+ "required": ["to", "from"],
27
+ "examples": [
28
+ { "verb": "message", "to": "+15085551212", "from": "+15085559876", "text": "Your order has been confirmed. Order #12345." }
29
+ ]
30
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/pause",
4
+ "title": "Pause",
5
+ "description": "Pauses execution for a specified number of seconds. The caller hears silence during the pause. Useful for adding delays between verbs.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": {
9
+ "const": "pause",
10
+ "description": "The verb name."
11
+ },
12
+ "id": {
13
+ "type": "string",
14
+ "description": "An optional unique identifier for this verb instance."
15
+ },
16
+ "length": {
17
+ "type": "number",
18
+ "description": "The duration of the pause in seconds.",
19
+ "examples": [1, 2, 5]
20
+ }
21
+ },
22
+ "required": ["length"],
23
+ "examples": [
24
+ { "verb": "pause", "length": 2 }
25
+ ]
26
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/pipeline",
4
+ "title": "Pipeline",
5
+ "description": "Configures a complete STT → LLM → TTS voice AI pipeline with integrated turn detection. Provides a higher-level abstraction than manually orchestrating the individual components. Optimized for building voice AI agents with proper turn-taking behavior.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": { "const": "pipeline" },
9
+ "id": { "type": "string", "description": "An optional unique identifier for this verb instance." },
10
+ "stt": {
11
+ "$ref": "../components/recognizer",
12
+ "description": "Speech-to-text configuration for the pipeline."
13
+ },
14
+ "tts": {
15
+ "$ref": "../components/synthesizer",
16
+ "description": "Text-to-speech configuration for the pipeline."
17
+ },
18
+ "vad": {
19
+ "$ref": "../components/vad",
20
+ "description": "Voice activity detection configuration for the pipeline."
21
+ },
22
+ "turnDetection": {
23
+ "type": "object",
24
+ "description": "Turn detection configuration. Determines when the user has finished speaking and it's the AI's turn to respond.",
25
+ "properties": {
26
+ "vendor": { "type": "string", "enum": ["krisp"], "description": "The turn detection vendor." },
27
+ "threshold": { "type": "number", "description": "Confidence threshold for turn detection." },
28
+ "eagerEotThreshold": { "type": "number", "description": "Threshold for eager end-of-turn detection. Lower values cause earlier turn transitions." }
29
+ },
30
+ "required": ["vendor"]
31
+ },
32
+ "llm": {
33
+ "type": "object",
34
+ "description": "LLM configuration for the pipeline. See the 'llm' verb schema for details.",
35
+ "additionalProperties": true
36
+ },
37
+ "preflightLlm": {
38
+ "type": "boolean",
39
+ "description": "If true, establish the LLM connection before the call starts to reduce latency on the first interaction."
40
+ },
41
+ "actionHook": { "$ref": "../components/actionHook", "description": "A webhook invoked when the pipeline ends." },
42
+ "eventHook": { "$ref": "../components/actionHook", "description": "A webhook invoked for pipeline events." }
43
+ },
44
+ "required": ["stt", "llm", "tts"],
45
+ "examples": [
46
+ {
47
+ "verb": "pipeline",
48
+ "stt": { "vendor": "deepgram", "language": "en-US" },
49
+ "tts": { "vendor": "cartesia", "voice": "sonic-english" },
50
+ "llm": {
51
+ "vendor": "openai",
52
+ "model": "gpt-4o",
53
+ "llmOptions": {
54
+ "messages": [{ "role": "system", "content": "You are a helpful voice assistant." }]
55
+ }
56
+ },
57
+ "turnDetection": { "vendor": "krisp", "threshold": 0.5 },
58
+ "actionHook": "/pipeline-complete"
59
+ }
60
+ ]
61
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/play",
4
+ "title": "Play",
5
+ "description": "Plays an audio file to the caller. Supports WAV and MP3 formats hosted at a URL. Can play a single file or cycle through a list of files.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": {
9
+ "const": "play",
10
+ "description": "The verb name."
11
+ },
12
+ "id": {
13
+ "type": "string",
14
+ "description": "An optional unique identifier for this verb instance."
15
+ },
16
+ "url": {
17
+ "oneOf": [
18
+ { "type": "string", "format": "uri" },
19
+ {
20
+ "type": "array",
21
+ "items": { "type": "string", "format": "uri" }
22
+ }
23
+ ],
24
+ "description": "The URL(s) of the audio file(s) to play. Supports WAV and MP3. If an array, files are played in sequence.",
25
+ "examples": [
26
+ "https://example.com/sounds/greeting.wav",
27
+ ["https://example.com/sounds/part1.wav", "https://example.com/sounds/part2.wav"]
28
+ ]
29
+ },
30
+ "loop": {
31
+ "oneOf": [
32
+ { "type": "number" },
33
+ { "type": "string" }
34
+ ],
35
+ "description": "Number of times to repeat playback. Use 0 or 'forever' to loop indefinitely until interrupted.",
36
+ "examples": [3, "forever"]
37
+ },
38
+ "earlyMedia": {
39
+ "type": "boolean",
40
+ "description": "If true, play the audio as early media before the call is answered."
41
+ },
42
+ "seekOffset": {
43
+ "oneOf": [
44
+ { "type": "number" },
45
+ { "type": "string" }
46
+ ],
47
+ "description": "Start playback at this offset in seconds from the beginning of the file."
48
+ },
49
+ "timeoutSecs": {
50
+ "oneOf": [
51
+ { "type": "number" },
52
+ { "type": "string" }
53
+ ],
54
+ "description": "Maximum time in seconds to play the audio. Playback stops after this duration even if the file has not finished."
55
+ },
56
+ "actionHook": {
57
+ "$ref": "../components/actionHook",
58
+ "description": "A webhook to invoke when playback completes."
59
+ }
60
+ },
61
+ "required": ["url"],
62
+ "examples": [
63
+ {
64
+ "verb": "play",
65
+ "url": "https://example.com/sounds/hold-music.mp3",
66
+ "loop": "forever"
67
+ }
68
+ ]
69
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/redirect",
4
+ "title": "Redirect",
5
+ "description": "Transfers call control to a different webhook URL. The current verb stack is abandoned and the new webhook's response becomes the active application. Useful for modular application design where different URLs handle different phases of a call.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": { "const": "redirect" },
9
+ "id": { "type": "string", "description": "An optional unique identifier for this verb instance." },
10
+ "actionHook": {
11
+ "$ref": "../components/actionHook",
12
+ "description": "The webhook to transfer control to. Must return a new array of verbs."
13
+ },
14
+ "statusHook": {
15
+ "$ref": "../components/actionHook",
16
+ "description": "A webhook to receive call status events after the redirect."
17
+ }
18
+ },
19
+ "required": ["actionHook"],
20
+ "examples": [
21
+ { "verb": "redirect", "actionHook": "/new-handler" }
22
+ ]
23
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/say",
4
+ "title": "Say",
5
+ "description": "Speaks text to the caller using text-to-speech. The text can be plain text or SSML. Optionally streams TTS output incrementally for lower latency. This is one of the most commonly used verbs in jambonz applications.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": {
9
+ "const": "say",
10
+ "description": "The verb name."
11
+ },
12
+ "id": {
13
+ "type": "string",
14
+ "description": "An optional unique identifier for this verb instance. Can be used to reference it in other contexts."
15
+ },
16
+ "text": {
17
+ "oneOf": [
18
+ { "type": "string" },
19
+ {
20
+ "type": "array",
21
+ "items": { "type": "string" }
22
+ }
23
+ ],
24
+ "description": "The text to speak. Can be plain text or SSML markup. If an array is provided, one entry is selected at random (useful for variety in prompts).",
25
+ "examples": [
26
+ "Hello, welcome to our service.",
27
+ "<speak>Hello <break time='500ms'/> welcome.</speak>",
28
+ ["Hello!", "Hi there!", "Welcome!"]
29
+ ]
30
+ },
31
+ "instructions": {
32
+ "type": "string",
33
+ "description": "Natural language instructions to guide TTS expression and delivery. Supported by vendors that offer instruction-based synthesis (e.g. ElevenLabs, some OpenAI models).",
34
+ "examples": ["Speak in a warm, friendly tone", "Sound excited and energetic"]
35
+ },
36
+ "stream": {
37
+ "type": "boolean",
38
+ "description": "If true, stream TTS audio to the caller incrementally as it is generated, rather than waiting for the complete audio. Reduces time-to-first-byte for long utterances. Requires a vendor that supports streaming synthesis."
39
+ },
40
+ "loop": {
41
+ "oneOf": [
42
+ { "type": "number" },
43
+ { "type": "string" }
44
+ ],
45
+ "description": "Number of times to repeat the speech. Use 0 or 'forever' to loop indefinitely until interrupted.",
46
+ "examples": [2, "forever"]
47
+ },
48
+ "synthesizer": {
49
+ "$ref": "../components/synthesizer",
50
+ "description": "Override the session-level TTS configuration for this specific utterance."
51
+ },
52
+ "earlyMedia": {
53
+ "type": "boolean",
54
+ "description": "If true, play the audio as early media (before the call is answered). Used for playing announcements or prompts to the caller before the call is formally connected."
55
+ },
56
+ "disableTtsCache": {
57
+ "type": "boolean",
58
+ "description": "If true, bypass the TTS cache and always generate fresh audio. Useful when the same text should be re-synthesized (e.g. with different SSML or when the voice has been updated)."
59
+ },
60
+ "closeStreamOnEmpty": {
61
+ "type": "boolean",
62
+ "description": "If true, close the TTS stream when an empty text string is received. Only applies when stream is true."
63
+ }
64
+ },
65
+ "examples": [
66
+ {
67
+ "verb": "say",
68
+ "text": "Hello, welcome to Acme Corp. How can I help you today?"
69
+ },
70
+ {
71
+ "verb": "say",
72
+ "text": "Please hold while I transfer your call.",
73
+ "synthesizer": {
74
+ "vendor": "elevenlabs",
75
+ "voice": "Rachel"
76
+ }
77
+ },
78
+ {
79
+ "verb": "say",
80
+ "text": ["Hello!", "Hi there!", "Welcome!"],
81
+ "loop": 1
82
+ }
83
+ ]
84
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/sip:decline",
4
+ "title": "SIP Decline",
5
+ "description": "Rejects an incoming call with a SIP error response. Used to decline calls with a specific status code and reason (e.g. 486 Busy Here, 603 Decline).",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": { "const": "sip:decline" },
9
+ "id": { "type": "string", "description": "An optional unique identifier for this verb instance." },
10
+ "status": {
11
+ "type": "number",
12
+ "description": "The SIP response status code to send.",
13
+ "examples": [486, 603, 404, 480]
14
+ },
15
+ "reason": {
16
+ "type": "string",
17
+ "description": "The SIP reason phrase to include in the response.",
18
+ "examples": ["Busy Here", "Decline", "Not Found"]
19
+ },
20
+ "headers": {
21
+ "type": "object",
22
+ "description": "Custom SIP headers to include in the response.",
23
+ "additionalProperties": { "type": "string" }
24
+ }
25
+ },
26
+ "required": ["status"],
27
+ "examples": [
28
+ { "verb": "sip:decline", "status": 486, "reason": "Busy Here" },
29
+ { "verb": "sip:decline", "status": 603, "reason": "Decline" }
30
+ ]
31
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/sip:refer",
4
+ "title": "SIP Refer",
5
+ "description": "Sends a SIP REFER request to transfer the call to another party. Initiates an attended or unattended (blind) transfer.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": { "const": "sip:refer" },
9
+ "id": { "type": "string", "description": "An optional unique identifier for this verb instance." },
10
+ "referTo": {
11
+ "type": "string",
12
+ "description": "The SIP URI or phone number to transfer the call to.",
13
+ "examples": ["sip:alice@example.com", "+15085551212"]
14
+ },
15
+ "referredBy": {
16
+ "type": "string",
17
+ "description": "The SIP URI to use in the Referred-By header."
18
+ },
19
+ "referredByDisplayName": {
20
+ "type": "string",
21
+ "description": "The display name to use in the Referred-By header."
22
+ },
23
+ "headers": {
24
+ "type": "object",
25
+ "description": "Custom SIP headers to include in the REFER request.",
26
+ "additionalProperties": { "type": "string" }
27
+ },
28
+ "actionHook": {
29
+ "$ref": "../components/actionHook",
30
+ "description": "A webhook invoked when the REFER completes (or fails)."
31
+ },
32
+ "eventHook": {
33
+ "$ref": "../components/actionHook",
34
+ "description": "A webhook invoked for NOTIFY events during the REFER process, providing transfer progress updates."
35
+ }
36
+ },
37
+ "required": ["referTo"],
38
+ "examples": [
39
+ { "verb": "sip:refer", "referTo": "sip:alice@example.com", "actionHook": "/refer-complete" }
40
+ ]
41
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/verbs/sip:request",
4
+ "title": "SIP Request",
5
+ "description": "Sends a SIP request within the current dialog. Used to send INFO, NOTIFY, or other SIP methods to the remote party during an active call.",
6
+ "type": "object",
7
+ "properties": {
8
+ "verb": { "const": "sip:request" },
9
+ "id": { "type": "string", "description": "An optional unique identifier for this verb instance." },
10
+ "method": {
11
+ "type": "string",
12
+ "description": "The SIP method to send.",
13
+ "examples": ["INFO", "NOTIFY", "MESSAGE"]
14
+ },
15
+ "body": {
16
+ "type": "string",
17
+ "description": "The body of the SIP request."
18
+ },
19
+ "headers": {
20
+ "type": "object",
21
+ "description": "Custom SIP headers to include in the request.",
22
+ "additionalProperties": { "type": "string" }
23
+ },
24
+ "actionHook": {
25
+ "$ref": "../components/actionHook",
26
+ "description": "A webhook invoked when the response to the SIP request is received."
27
+ }
28
+ },
29
+ "required": ["method"],
30
+ "examples": [
31
+ { "verb": "sip:request", "method": "INFO", "body": "Signal=1\nDuration=250", "headers": { "Content-Type": "application/dtmf-relay" } }
32
+ ]
33
+ }