jambonz-python-sdk 0.2.0__py3-none-any.whl

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 (119) hide show
  1. jambonz_python_sdk-0.2.0.dist-info/METADATA +179 -0
  2. jambonz_python_sdk-0.2.0.dist-info/RECORD +119 -0
  3. jambonz_python_sdk-0.2.0.dist-info/WHEEL +4 -0
  4. jambonz_sdk/__init__.py +52 -0
  5. jambonz_sdk/_signature.py +73 -0
  6. jambonz_sdk/client/__init__.py +15 -0
  7. jambonz_sdk/client/api.py +241 -0
  8. jambonz_sdk/schema/callbacks/amd.schema.json +50 -0
  9. jambonz_sdk/schema/callbacks/base.schema.json +29 -0
  10. jambonz_sdk/schema/callbacks/call-status.schema.json +22 -0
  11. jambonz_sdk/schema/callbacks/conference-status.schema.json +24 -0
  12. jambonz_sdk/schema/callbacks/conference-wait.schema.json +11 -0
  13. jambonz_sdk/schema/callbacks/conference.schema.json +11 -0
  14. jambonz_sdk/schema/callbacks/dequeue.schema.json +19 -0
  15. jambonz_sdk/schema/callbacks/dial-dtmf.schema.json +18 -0
  16. jambonz_sdk/schema/callbacks/dial-hold.schema.json +22 -0
  17. jambonz_sdk/schema/callbacks/dial-refer.schema.json +28 -0
  18. jambonz_sdk/schema/callbacks/dial.schema.json +31 -0
  19. jambonz_sdk/schema/callbacks/enqueue-wait.schema.json +17 -0
  20. jambonz_sdk/schema/callbacks/enqueue.schema.json +27 -0
  21. jambonz_sdk/schema/callbacks/gather-partial.schema.json +54 -0
  22. jambonz_sdk/schema/callbacks/gather.schema.json +60 -0
  23. jambonz_sdk/schema/callbacks/listen.schema.json +21 -0
  24. jambonz_sdk/schema/callbacks/llm.schema.json +30 -0
  25. jambonz_sdk/schema/callbacks/message.schema.json +35 -0
  26. jambonz_sdk/schema/callbacks/pipeline-turn.schema.json +109 -0
  27. jambonz_sdk/schema/callbacks/play.schema.json +36 -0
  28. jambonz_sdk/schema/callbacks/session-new.schema.json +143 -0
  29. jambonz_sdk/schema/callbacks/session-reconnect.schema.json +9 -0
  30. jambonz_sdk/schema/callbacks/session-redirect.schema.json +38 -0
  31. jambonz_sdk/schema/callbacks/sip-refer-event.schema.json +20 -0
  32. jambonz_sdk/schema/callbacks/sip-refer.schema.json +22 -0
  33. jambonz_sdk/schema/callbacks/sip-request.schema.json +27 -0
  34. jambonz_sdk/schema/callbacks/transcribe-translation.schema.json +24 -0
  35. jambonz_sdk/schema/callbacks/transcribe.schema.json +46 -0
  36. jambonz_sdk/schema/callbacks/tts-streaming-event.schema.json +77 -0
  37. jambonz_sdk/schema/callbacks/verb-status.schema.json +57 -0
  38. jambonz_sdk/schema/components/actionHook.schema.json +36 -0
  39. jambonz_sdk/schema/components/actionHookDelayAction.schema.json +37 -0
  40. jambonz_sdk/schema/components/amd.schema.json +68 -0
  41. jambonz_sdk/schema/components/auth.schema.json +18 -0
  42. jambonz_sdk/schema/components/bidirectionalAudio.schema.json +22 -0
  43. jambonz_sdk/schema/components/fillerNoise.schema.json +25 -0
  44. jambonz_sdk/schema/components/llm-base.schema.json +94 -0
  45. jambonz_sdk/schema/components/recognizer-assemblyAiOptions.schema.json +66 -0
  46. jambonz_sdk/schema/components/recognizer-awsOptions.schema.json +52 -0
  47. jambonz_sdk/schema/components/recognizer-azureOptions.schema.json +32 -0
  48. jambonz_sdk/schema/components/recognizer-cobaltOptions.schema.json +34 -0
  49. jambonz_sdk/schema/components/recognizer-customOptions.schema.json +27 -0
  50. jambonz_sdk/schema/components/recognizer-deepgramOptions.schema.json +147 -0
  51. jambonz_sdk/schema/components/recognizer-elevenlabsOptions.schema.json +39 -0
  52. jambonz_sdk/schema/components/recognizer-gladiaOptions.schema.json +8 -0
  53. jambonz_sdk/schema/components/recognizer-googleOptions.schema.json +35 -0
  54. jambonz_sdk/schema/components/recognizer-houndifyOptions.schema.json +53 -0
  55. jambonz_sdk/schema/components/recognizer-ibmOptions.schema.json +54 -0
  56. jambonz_sdk/schema/components/recognizer-nuanceOptions.schema.json +150 -0
  57. jambonz_sdk/schema/components/recognizer-nvidiaOptions.schema.json +39 -0
  58. jambonz_sdk/schema/components/recognizer-openaiOptions.schema.json +59 -0
  59. jambonz_sdk/schema/components/recognizer-sonioxOptions.schema.json +46 -0
  60. jambonz_sdk/schema/components/recognizer-speechmaticsOptions.schema.json +100 -0
  61. jambonz_sdk/schema/components/recognizer-verbioOptions.schema.json +46 -0
  62. jambonz_sdk/schema/components/recognizer.schema.json +216 -0
  63. jambonz_sdk/schema/components/synthesizer.schema.json +82 -0
  64. jambonz_sdk/schema/components/target.schema.json +105 -0
  65. jambonz_sdk/schema/components/vad.schema.json +48 -0
  66. jambonz_sdk/schema/jambonz-app.schema.json +113 -0
  67. jambonz_sdk/schema/verbs/alert.schema.json +34 -0
  68. jambonz_sdk/schema/verbs/answer.schema.json +22 -0
  69. jambonz_sdk/schema/verbs/conference.schema.json +107 -0
  70. jambonz_sdk/schema/verbs/config.schema.json +221 -0
  71. jambonz_sdk/schema/verbs/deepgram_s2s.schema.json +81 -0
  72. jambonz_sdk/schema/verbs/dequeue.schema.json +51 -0
  73. jambonz_sdk/schema/verbs/dial.schema.json +200 -0
  74. jambonz_sdk/schema/verbs/dialogflow.schema.json +148 -0
  75. jambonz_sdk/schema/verbs/dtmf.schema.json +49 -0
  76. jambonz_sdk/schema/verbs/dub.schema.json +103 -0
  77. jambonz_sdk/schema/verbs/elevenlabs_s2s.schema.json +81 -0
  78. jambonz_sdk/schema/verbs/enqueue.schema.json +53 -0
  79. jambonz_sdk/schema/verbs/gather.schema.json +190 -0
  80. jambonz_sdk/schema/verbs/google_s2s.schema.json +42 -0
  81. jambonz_sdk/schema/verbs/hangup.schema.json +36 -0
  82. jambonz_sdk/schema/verbs/leave.schema.json +22 -0
  83. jambonz_sdk/schema/verbs/listen.schema.json +127 -0
  84. jambonz_sdk/schema/verbs/llm.schema.json +44 -0
  85. jambonz_sdk/schema/verbs/message.schema.json +82 -0
  86. jambonz_sdk/schema/verbs/openai_s2s.schema.json +42 -0
  87. jambonz_sdk/schema/verbs/pause.schema.json +36 -0
  88. jambonz_sdk/schema/verbs/pipeline.schema.json +240 -0
  89. jambonz_sdk/schema/verbs/play.schema.json +96 -0
  90. jambonz_sdk/schema/verbs/redirect.schema.json +34 -0
  91. jambonz_sdk/schema/verbs/rest_dial.schema.json +113 -0
  92. jambonz_sdk/schema/verbs/s2s.schema.json +39 -0
  93. jambonz_sdk/schema/verbs/say.schema.json +107 -0
  94. jambonz_sdk/schema/verbs/sip-decline.schema.json +58 -0
  95. jambonz_sdk/schema/verbs/sip-refer.schema.json +58 -0
  96. jambonz_sdk/schema/verbs/sip-request.schema.json +54 -0
  97. jambonz_sdk/schema/verbs/stream.schema.json +103 -0
  98. jambonz_sdk/schema/verbs/tag.schema.json +41 -0
  99. jambonz_sdk/schema/verbs/transcribe.schema.json +57 -0
  100. jambonz_sdk/schema/verbs/ultravox_s2s.schema.json +41 -0
  101. jambonz_sdk/types/__init__.py +139 -0
  102. jambonz_sdk/types/components.py +250 -0
  103. jambonz_sdk/types/rest.py +59 -0
  104. jambonz_sdk/types/session.py +55 -0
  105. jambonz_sdk/types/verbs.py +572 -0
  106. jambonz_sdk/validator.py +107 -0
  107. jambonz_sdk/verb_builder.py +316 -0
  108. jambonz_sdk/verb_builder.pyi +1133 -0
  109. jambonz_sdk/verb_registry.py +102 -0
  110. jambonz_sdk/webhook/__init__.py +10 -0
  111. jambonz_sdk/webhook/middleware.py +63 -0
  112. jambonz_sdk/webhook/response.py +43 -0
  113. jambonz_sdk/websocket/__init__.py +15 -0
  114. jambonz_sdk/websocket/audio_client.py +11 -0
  115. jambonz_sdk/websocket/audio_stream.py +151 -0
  116. jambonz_sdk/websocket/client.py +165 -0
  117. jambonz_sdk/websocket/endpoint.py +193 -0
  118. jambonz_sdk/websocket/router.py +87 -0
  119. jambonz_sdk/websocket/session.py +259 -0
@@ -0,0 +1,241 @@
1
+ """JambonzClient - REST API client for jambonz platform management and call control.
2
+
3
+ Provides typed methods for creating calls, querying active calls,
4
+ and mid-call control (redirect, whisper, mute, etc.).
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from typing import Any
10
+
11
+ import aiohttp
12
+
13
+
14
+ class _Resource:
15
+ """Base class for API resources."""
16
+
17
+ def __init__(self, client: JambonzClient, path: str) -> None:
18
+ self._client = client
19
+ self._path = path
20
+
21
+ async def _request(
22
+ self,
23
+ method: str,
24
+ path: str = "",
25
+ *,
26
+ json: Any = None,
27
+ params: dict[str, str] | None = None,
28
+ ) -> Any:
29
+ return await self._client._request(
30
+ method, f"{self._path}{path}", json=json, params=params
31
+ )
32
+
33
+
34
+ class CallsResource(_Resource):
35
+ """REST API operations for active calls."""
36
+
37
+ def __init__(self, client: JambonzClient) -> None:
38
+ super().__init__(client, "/Calls")
39
+
40
+ async def create(self, opts: dict[str, Any]) -> str:
41
+ """Create an outbound call.
42
+
43
+ Args:
44
+ opts: Call options including ``from``, ``to``, ``call_hook``, etc.
45
+
46
+ Returns:
47
+ The call_sid of the created call.
48
+ """
49
+ result = await self._request("POST", json=opts)
50
+ return result.get("sid", result.get("call_sid", ""))
51
+
52
+ async def list(self, filter: dict[str, str] | None = None) -> list[dict[str, Any]]:
53
+ """List active calls.
54
+
55
+ Args:
56
+ filter: Optional filter by direction, from, to, callStatus.
57
+ """
58
+ return await self._request("GET", params=filter)
59
+
60
+ async def get(self, call_sid: str) -> dict[str, Any]:
61
+ """Get information about a specific call."""
62
+ return await self._request("GET", f"/{call_sid}")
63
+
64
+ async def count(self) -> dict[str, int]:
65
+ """Get count of inbound/outbound calls."""
66
+ return await self._request("GET", "/count")
67
+
68
+ async def update(self, call_sid: str, opts: dict[str, Any]) -> dict[str, Any]:
69
+ """Update an active call (generic)."""
70
+ return await self._request("PUT", f"/{call_sid}", json=opts)
71
+
72
+ async def delete(self, call_sid: str) -> None:
73
+ """Terminate a call."""
74
+ await self._request("DELETE", f"/{call_sid}")
75
+
76
+ async def redirect(self, call_sid: str, hook: str) -> dict[str, Any]:
77
+ """Redirect a call to a new webhook.
78
+
79
+ Args:
80
+ call_sid: The call to redirect.
81
+ hook: URL of the new webhook.
82
+ """
83
+ return await self.update(call_sid, {"call_hook": hook})
84
+
85
+ async def whisper(self, call_sid: str, verb: dict[str, Any]) -> dict[str, Any]:
86
+ """Inject a whisper verb (say/play) into the call.
87
+
88
+ Args:
89
+ call_sid: The call to whisper to.
90
+ verb: A verb dict (e.g., ``{"verb": "say", "text": "Hello"}``).
91
+ """
92
+ return await self.update(call_sid, {"whisper": verb})
93
+
94
+ async def mute(self, call_sid: str, status: str) -> dict[str, Any]:
95
+ """Mute or unmute a call.
96
+
97
+ Args:
98
+ call_sid: The call to mute.
99
+ status: ``'mute'`` or ``'unmute'``.
100
+ """
101
+ return await self.update(call_sid, {"mute_status": status})
102
+
103
+ async def update_pipeline(
104
+ self, call_sid: str, data: dict[str, Any]
105
+ ) -> dict[str, Any]:
106
+ """Send a mid-conversation pipeline update.
107
+
108
+ Args:
109
+ call_sid: The call to update.
110
+ data: Pipeline update payload.
111
+ """
112
+ return await self.update(call_sid, {"pipeline_update": data})
113
+
114
+ async def noise_isolation(
115
+ self, call_sid: str, status: str, opts: dict[str, Any] | None = None
116
+ ) -> dict[str, Any]:
117
+ """Enable or disable noise isolation.
118
+
119
+ Args:
120
+ call_sid: The call.
121
+ status: ``'on'`` or ``'off'``.
122
+ opts: Additional noise isolation options.
123
+ """
124
+ data: dict[str, Any] = {"noiseIsolation_status": status}
125
+ if opts:
126
+ data.update(opts)
127
+ return await self.update(call_sid, data)
128
+
129
+
130
+ class ConferencesResource(_Resource):
131
+ """REST API operations for conferences."""
132
+
133
+ def __init__(self, client: JambonzClient) -> None:
134
+ super().__init__(client, "/Conferences")
135
+
136
+ async def list(self) -> list[dict[str, Any]]:
137
+ """List active conferences."""
138
+ return await self._request("GET")
139
+
140
+
141
+ class QueuesResource(_Resource):
142
+ """REST API operations for call queues."""
143
+
144
+ def __init__(self, client: JambonzClient) -> None:
145
+ super().__init__(client, "/Queues")
146
+
147
+ async def list(self, search: str | None = None) -> list[dict[str, Any]]:
148
+ """List active queues.
149
+
150
+ Args:
151
+ search: Optional search string to filter queues.
152
+ """
153
+ params = {"search": search} if search else None
154
+ return await self._request("GET", params=params)
155
+
156
+
157
+ class JambonzClient:
158
+ """REST API client for jambonz platform.
159
+
160
+ Provides access to call control, conferences, and queues.
161
+
162
+ Example::
163
+
164
+ client = JambonzClient(
165
+ base_url="https://api.jambonz.us",
166
+ account_sid="your-account-sid",
167
+ api_key="your-api-key",
168
+ )
169
+
170
+ # Create an outbound call
171
+ call_sid = await client.calls.create({
172
+ "from": "+15085551212",
173
+ "to": {"type": "phone", "number": "+15085551213"},
174
+ "call_hook": "/incoming",
175
+ })
176
+
177
+ # Mid-call control
178
+ await client.calls.mute(call_sid, "mute")
179
+ await client.calls.whisper(call_sid, {"verb": "say", "text": "Hello"})
180
+ """
181
+
182
+ def __init__(
183
+ self,
184
+ *,
185
+ base_url: str,
186
+ account_sid: str,
187
+ api_key: str,
188
+ ) -> None:
189
+ self._base_url = base_url.rstrip("/")
190
+ self._account_sid = account_sid
191
+ self._api_key = api_key
192
+ self._session: aiohttp.ClientSession | None = None
193
+
194
+ # Resource accessors
195
+ self.calls = CallsResource(self)
196
+ self.conferences = ConferencesResource(self)
197
+ self.queues = QueuesResource(self)
198
+
199
+ @property
200
+ def _api_base(self) -> str:
201
+ return f"{self._base_url}/v1/Accounts/{self._account_sid}"
202
+
203
+ async def _get_session(self) -> aiohttp.ClientSession:
204
+ if self._session is None or self._session.closed:
205
+ self._session = aiohttp.ClientSession(
206
+ headers={
207
+ "Authorization": f"Bearer {self._api_key}",
208
+ "Content-Type": "application/json",
209
+ }
210
+ )
211
+ return self._session
212
+
213
+ async def _request(
214
+ self,
215
+ method: str,
216
+ path: str,
217
+ *,
218
+ json: Any = None,
219
+ params: dict[str, str] | None = None,
220
+ ) -> Any:
221
+ session = await self._get_session()
222
+ url = f"{self._api_base}{path}"
223
+
224
+ async with session.request(method, url, json=json, params=params) as resp:
225
+ if resp.status == 204:
226
+ return None
227
+ resp.raise_for_status()
228
+ if resp.content_type == "application/json":
229
+ return await resp.json()
230
+ return await resp.text()
231
+
232
+ async def close(self) -> None:
233
+ """Close the underlying HTTP session."""
234
+ if self._session and not self._session.closed:
235
+ await self._session.close()
236
+
237
+ async def __aenter__(self) -> JambonzClient:
238
+ return self
239
+
240
+ async def __aexit__(self, *args: Any) -> None:
241
+ await self.close()
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/amd",
4
+ "title": "AMD ActionHook Payload",
5
+ "description": "Payload sent to the AMD actionHook when an answering machine detection event occurs. Multiple events may fire during a single call (e.g. amd_machine_detected followed by amd_machine_stopped_speaking or amd_tone_detected).",
6
+ "allOf": [{ "$ref": "base" }],
7
+ "type": "object",
8
+ "properties": {
9
+ "type": {
10
+ "type": "string",
11
+ "description": "The AMD event type. IMPORTANT: This field is 'type', NOT 'amd_type'.",
12
+ "enum": [
13
+ "amd_human_detected",
14
+ "amd_machine_detected",
15
+ "amd_no_speech_detected",
16
+ "amd_decision_timeout",
17
+ "amd_machine_stopped_speaking",
18
+ "amd_tone_detected",
19
+ "amd_tone_timeout",
20
+ "amd_error",
21
+ "amd_stopped"
22
+ ]
23
+ },
24
+ "reason": {
25
+ "type": "string",
26
+ "description": "Reason for the detection result (e.g. 'short greeting', 'long greeting', 'hint', 'digit count'). Present on amd_human_detected and amd_machine_detected events."
27
+ },
28
+ "greeting": {
29
+ "type": "string",
30
+ "description": "The transcribed greeting text. Present on amd_human_detected and amd_machine_detected events."
31
+ },
32
+ "hint": {
33
+ "type": "string",
34
+ "description": "The voicemail hint that matched, if detection was triggered by hint matching."
35
+ },
36
+ "language": {
37
+ "type": "string",
38
+ "description": "Language code from the transcription (e.g. 'en-US'). Present on amd_human_detected and amd_machine_detected events."
39
+ },
40
+ "frequency": {
41
+ "type": "number",
42
+ "description": "Frequency of the detected beep in Hz. Present on amd_tone_detected events."
43
+ },
44
+ "variance": {
45
+ "type": "number",
46
+ "description": "Frequency variance of the detected beep. Present on amd_tone_detected events."
47
+ }
48
+ },
49
+ "required": ["type"]
50
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/base",
4
+ "title": "ActionHook Base Payload",
5
+ "description": "Common fields present in every actionHook callback payload. All verb-specific callback schemas extend this base.",
6
+ "type": "object",
7
+ "properties": {
8
+ "call_sid": { "type": "string", "description": "Unique identifier for this call." },
9
+ "account_sid": { "type": "string", "description": "Account identifier." },
10
+ "application_sid": { "type": "string", "description": "Application identifier." },
11
+ "direction": { "type": "string", "enum": ["inbound", "outbound"], "description": "Call direction." },
12
+ "from": { "type": "string", "description": "Caller phone number or SIP URI." },
13
+ "to": { "type": "string", "description": "Called phone number or SIP URI." },
14
+ "call_id": { "type": "string", "description": "SIP Call-ID." },
15
+ "sbc_callid": { "type": "string", "description": "SBC-level Call-ID." },
16
+ "call_status": {
17
+ "type": "string",
18
+ "enum": ["trying", "ringing", "early-media", "in-progress", "completed", "failed", "busy", "no-answer", "queued"],
19
+ "description": "Current call state."
20
+ },
21
+ "sip_status": { "type": "integer", "description": "SIP response code (e.g. 200, 486)." },
22
+ "sip_reason": { "type": "string", "description": "SIP reason phrase (e.g. 'OK', 'Busy Here')." },
23
+ "trace_id": { "type": "string", "description": "Distributed tracing identifier for correlating logs across jambonz components." },
24
+ "originating_sip_ip": { "type": "string", "description": "IP address of the originating SIP trunk." },
25
+ "originating_sip_trunk_name": { "type": "string", "description": "Name of the originating SIP trunk as configured in jambonz." },
26
+ "api_base_url": { "type": "string", "description": "jambonz REST API base URL. Use this for mid-call control via the REST API." }
27
+ },
28
+ "additionalProperties": true
29
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/call-status",
4
+ "title": "Call Status Webhook Payload",
5
+ "description": "Payload sent to the call status webhook URL whenever the call state changes (e.g. trying, in-progress, completed). The status webhook is configured at the application level in jambonz. Multiple status events are sent over the life of a call. The final event (completed or failed) includes additional fields like duration and termination cause.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "call_termination_by": {
12
+ "type": "string",
13
+ "enum": ["caller", "jambonz"],
14
+ "description": "Who terminated the call. 'caller' if the remote party hung up, 'jambonz' if the call was ended by the application (e.g. hangup verb, REST API). Present only on the final status event (completed/failed)."
15
+ },
16
+ "duration": {
17
+ "type": "integer",
18
+ "description": "Call duration in seconds. Present only on the final status event (completed/failed)."
19
+ }
20
+ },
21
+ "additionalProperties": true
22
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/conference-status",
4
+ "title": "Conference StatusHook Payload",
5
+ "description": "Payload sent to the conference statusHook when a conference event occurs.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "event": {
12
+ "type": "string",
13
+ "enum": ["start", "end", "join", "leave", "start-talking", "stop-talking"],
14
+ "description": "The conference event that occurred."
15
+ },
16
+ "conference_sid": { "type": "string", "description": "Conference identifier (format: conf:<account_sid>:<conference_name>)." },
17
+ "friendly_name": { "type": "string", "description": "The conference name as specified in the conference verb." },
18
+ "duration": { "type": "number", "description": "Time in seconds since the conference started." },
19
+ "members": { "type": "integer", "description": "Current number of participants in the conference." },
20
+ "time": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of when the event occurred." }
21
+ },
22
+ "required": ["event", "conference_sid"],
23
+ "additionalProperties": true
24
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/conference-wait",
4
+ "title": "Conference WaitHook Payload",
5
+ "description": "Payload sent to the conference waitHook while a participant is waiting for the conference to start. The response should contain an array of say, play, and/or pause verbs to play while waiting.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "additionalProperties": true
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/conference",
4
+ "title": "Conference ActionHook Payload",
5
+ "description": "Payload sent to the conference verb's actionHook when the participant leaves or the conference ends. Contains only the base call info.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "additionalProperties": true
11
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/dequeue",
4
+ "title": "Dequeue ActionHook Payload",
5
+ "description": "Payload sent to the dequeue verb's actionHook when the dequeue operation completes.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "dequeue_result": {
12
+ "type": "string",
13
+ "enum": ["complete", "timeout", "hangup"],
14
+ "description": "Outcome of the dequeue. 'complete' — successfully dequeued and bridged; 'timeout' — no queued caller found; 'hangup' — call hung up during bridge."
15
+ }
16
+ },
17
+ "required": ["dequeue_result"],
18
+ "additionalProperties": true
19
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/dial-dtmf",
4
+ "title": "Dial DtmfHook Payload",
5
+ "description": "Payload sent to the dial dtmfHook when DTMF digits matching the configured pattern are detected during a dial.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "dtmf": {
12
+ "type": "string",
13
+ "description": "The DTMF digit sequence that matched the configured dtmfCapture pattern."
14
+ }
15
+ },
16
+ "required": ["dtmf"],
17
+ "additionalProperties": true
18
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/dial-hold",
4
+ "title": "Dial OnHoldHook Payload",
5
+ "description": "Payload sent to the dial onHoldHook when the remote party places the call on hold. The response should contain say, play, and/or pause verbs to play as hold music. The hook is called repeatedly until the hold ends.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "hold_detail": {
12
+ "type": "object",
13
+ "description": "Details of the hold event.",
14
+ "properties": {
15
+ "from": { "type": "string", "description": "SIP From header value." },
16
+ "to": { "type": "string", "description": "SIP To header value." }
17
+ }
18
+ }
19
+ },
20
+ "required": ["hold_detail"],
21
+ "additionalProperties": true
22
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/dial-refer",
4
+ "title": "Dial ReferHook Payload",
5
+ "description": "Payload sent to the dial referHook when a SIP REFER is received during an active dial. The response can contain new verbs to execute.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "refer_details": {
12
+ "type": "object",
13
+ "description": "Details of the SIP REFER request. Any custom X-* headers on the REFER are also included as snake_cased properties (e.g. X-Override-Number becomes x_override_number).",
14
+ "properties": {
15
+ "sip_refer_to": { "type": "string", "description": "Full SIP Refer-To header value." },
16
+ "refer_to_user": { "type": "string", "description": "User part of the Refer-To URI (phone number or SIP user)." },
17
+ "sip_referred_by": { "type": "string", "description": "SIP Referred-By header value, if present." },
18
+ "referred_by_user": { "type": "string", "description": "User part of the Referred-By URI, if present." },
19
+ "sip_user_agent": { "type": "string", "description": "User-Agent header from the REFER request." },
20
+ "referring_call_sid": { "type": "string", "description": "Call SID of the leg that sent the REFER." },
21
+ "referred_call_sid": { "type": "string", "description": "Call SID of the leg being referred." }
22
+ },
23
+ "additionalProperties": true
24
+ }
25
+ },
26
+ "required": ["refer_details"],
27
+ "additionalProperties": true
28
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/dial",
4
+ "title": "Dial ActionHook Payload",
5
+ "description": "Payload sent to the actionHook when a dial verb completes, either because the dialed party hung up, the call was not answered, or an error occurred.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "dial_call_status": {
12
+ "type": "string",
13
+ "enum": ["completed", "failed", "busy", "no-answer", "trying", "ringing", "early-media", "in-progress"],
14
+ "description": "Final status of the outbound (dialed) call leg."
15
+ },
16
+ "dial_sip_status": {
17
+ "type": "integer",
18
+ "description": "SIP response code from the dialed party (e.g. 200, 486, 487).",
19
+ "examples": [200, 486, 487]
20
+ },
21
+ "dial_call_sid": {
22
+ "type": "string",
23
+ "description": "Call SID of the outbound (dialed) call leg."
24
+ },
25
+ "dial_sbc_callid": {
26
+ "type": "string",
27
+ "description": "SBC-level Call-ID for the outbound (dialed) call leg."
28
+ }
29
+ },
30
+ "additionalProperties": true
31
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/enqueue-wait",
4
+ "title": "Enqueue WaitHook Payload",
5
+ "description": "Payload sent to the enqueue waitHook while a caller is waiting in the queue. The response should contain an array of say, play, pause, and/or leave verbs. Note: this payload is sparse — it contains queue-specific fields plus call_sid and call_id, but NOT the full base payload fields.",
6
+ "type": "object",
7
+ "properties": {
8
+ "queue_sid": { "type": "string", "description": "Queue identifier in the format 'queue:{account_sid}:{queue_name}'." },
9
+ "queue_time": { "type": "integer", "description": "Time in seconds the caller has been waiting in the queue." },
10
+ "queue_size": { "type": "integer", "description": "Total number of callers currently in the queue." },
11
+ "queue_position": { "type": "integer", "description": "Caller's current position in the queue (0-based)." },
12
+ "call_sid": { "type": "string", "description": "Unique identifier for this call." },
13
+ "call_id": { "type": "string", "description": "SIP Call-ID." }
14
+ },
15
+ "required": ["queue_sid", "queue_time"],
16
+ "additionalProperties": true
17
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/enqueue",
4
+ "title": "Enqueue ActionHook Payload",
5
+ "description": "Payload sent to the enqueue actionHook when the enqueue verb completes — i.e. the call was bridged, abandoned, left the queue, or an error occurred.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "queue_sid": {
12
+ "type": "string",
13
+ "description": "Queue identifier in the format 'queue:{account_sid}:{queue_name}'."
14
+ },
15
+ "queue_time": {
16
+ "type": "integer",
17
+ "description": "Time in seconds the caller spent waiting in the queue."
18
+ },
19
+ "queue_result": {
20
+ "type": "string",
21
+ "enum": ["bridged", "hangup", "leave", "error"],
22
+ "description": "Outcome of the enqueue. 'bridged' — call was dequeued and connected; 'hangup' — caller hung up while waiting; 'leave' — caller executed a leave verb from the waitHook; 'error' — an error occurred during bridging."
23
+ }
24
+ },
25
+ "required": ["queue_sid", "queue_time", "queue_result"],
26
+ "additionalProperties": true
27
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/gather-partial",
4
+ "title": "Gather Partial Transcript Payload",
5
+ "description": "Payload sent to the partialResultHook during a gather verb with speech input. Delivers interim (partial) speech recognition results as they arrive, before the gather completes. This hook is informational — the response is ignored and does not replace the verb stack. Note: the base fields use slightly different names than the actionHook payload (e.g. local_sip_address instead of fs_sip_address).",
6
+ "type": "object",
7
+ "properties": {
8
+ "call_sid": { "type": "string", "description": "Unique identifier for this call." },
9
+ "account_sid": { "type": "string", "description": "Account identifier." },
10
+ "application_sid": { "type": "string", "description": "Application identifier." },
11
+ "direction": { "type": "string", "enum": ["inbound", "outbound"], "description": "Call direction." },
12
+ "from": { "type": "string", "description": "Caller phone number or SIP URI." },
13
+ "to": { "type": "string", "description": "Called phone number or SIP URI." },
14
+ "call_id": { "type": "string", "description": "SIP Call-ID." },
15
+ "sbc_callid": { "type": "string", "description": "SBC-level Call-ID." },
16
+ "call_status": { "type": "string", "description": "Current call state." },
17
+ "sip_status": { "type": "integer", "description": "SIP response code." },
18
+ "sip_reason": { "type": "string", "description": "SIP reason phrase." },
19
+ "trace_id": { "type": "string", "description": "Distributed tracing identifier." },
20
+ "b3": { "type": "string", "description": "B3 trace propagation header." },
21
+ "caller_name": { "type": "string", "description": "Caller display name from SIP, if available." },
22
+ "originating_sip_ip": { "type": "string", "description": "IP address of the originating SIP trunk." },
23
+ "originating_sip_trunk_name": { "type": "string", "description": "Name of the originating SIP trunk." },
24
+ "speech": {
25
+ "type": "object",
26
+ "description": "Interim speech recognition results.",
27
+ "properties": {
28
+ "language_code": { "type": "string", "description": "Language code used for recognition (e.g. 'en-US')." },
29
+ "channel_tag": { "type": "integer", "description": "Audio channel number." },
30
+ "is_final": { "type": "boolean", "description": "Always false for partial results." },
31
+ "alternatives": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "properties": {
36
+ "transcript": { "type": "string", "description": "The partial transcript recognized so far." },
37
+ "confidence": { "type": "number", "description": "Confidence score between 0 and 1." }
38
+ }
39
+ },
40
+ "description": "Array of recognition alternatives, ordered by confidence."
41
+ },
42
+ "vendor": {
43
+ "type": "object",
44
+ "description": "Vendor-specific STT data. Structure varies by provider.",
45
+ "properties": {
46
+ "name": { "type": "string", "description": "STT vendor name (e.g. 'deepgram', 'google', 'aws')." },
47
+ "evt": { "type": "object", "description": "Raw vendor-specific event payload.", "additionalProperties": true }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ },
53
+ "additionalProperties": true
54
+ }