@jambonz/schema 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.
- package/AGENTS.md +974 -0
- package/callbacks/amd.schema.json +50 -0
- package/callbacks/base.schema.json +29 -0
- package/callbacks/call-status.schema.json +22 -0
- package/callbacks/conference-status.schema.json +24 -0
- package/callbacks/conference-wait.schema.json +11 -0
- package/callbacks/conference.schema.json +11 -0
- package/callbacks/dequeue.schema.json +19 -0
- package/callbacks/dial-dtmf.schema.json +18 -0
- package/callbacks/dial-hold.schema.json +22 -0
- package/callbacks/dial-refer.schema.json +28 -0
- package/callbacks/dial.schema.json +31 -0
- package/callbacks/enqueue-wait.schema.json +17 -0
- package/callbacks/enqueue.schema.json +27 -0
- package/callbacks/gather-partial.schema.json +54 -0
- package/callbacks/gather.schema.json +60 -0
- package/callbacks/listen.schema.json +21 -0
- package/callbacks/llm.schema.json +30 -0
- package/callbacks/message.schema.json +35 -0
- package/callbacks/pipeline-turn.schema.json +109 -0
- package/callbacks/play.schema.json +36 -0
- package/callbacks/session-new.schema.json +143 -0
- package/callbacks/session-reconnect.schema.json +9 -0
- package/callbacks/session-redirect.schema.json +38 -0
- package/callbacks/sip-refer-event.schema.json +20 -0
- package/callbacks/sip-refer.schema.json +22 -0
- package/callbacks/sip-request.schema.json +27 -0
- package/callbacks/transcribe-translation.schema.json +24 -0
- package/callbacks/transcribe.schema.json +46 -0
- package/callbacks/tts-streaming-event.schema.json +77 -0
- package/callbacks/verb-status.schema.json +57 -0
- package/components/actionHook.schema.json +36 -0
- package/components/actionHookDelayAction.schema.json +37 -0
- package/components/amd.schema.json +68 -0
- package/components/auth.schema.json +18 -0
- package/components/bidirectionalAudio.schema.json +22 -0
- package/components/fillerNoise.schema.json +25 -0
- package/components/llm-base.schema.json +94 -0
- package/components/recognizer-assemblyAiOptions.schema.json +66 -0
- package/components/recognizer-awsOptions.schema.json +52 -0
- package/components/recognizer-azureOptions.schema.json +32 -0
- package/components/recognizer-cobaltOptions.schema.json +34 -0
- package/components/recognizer-customOptions.schema.json +27 -0
- package/components/recognizer-deepgramOptions.schema.json +147 -0
- package/components/recognizer-elevenlabsOptions.schema.json +39 -0
- package/components/recognizer-gladiaOptions.schema.json +8 -0
- package/components/recognizer-googleOptions.schema.json +35 -0
- package/components/recognizer-houndifyOptions.schema.json +53 -0
- package/components/recognizer-ibmOptions.schema.json +54 -0
- package/components/recognizer-nuanceOptions.schema.json +150 -0
- package/components/recognizer-nvidiaOptions.schema.json +39 -0
- package/components/recognizer-openaiOptions.schema.json +59 -0
- package/components/recognizer-sonioxOptions.schema.json +46 -0
- package/components/recognizer-speechmaticsOptions.schema.json +100 -0
- package/components/recognizer-verbioOptions.schema.json +46 -0
- package/components/recognizer.schema.json +216 -0
- package/components/synthesizer.schema.json +82 -0
- package/components/target.schema.json +105 -0
- package/components/vad.schema.json +48 -0
- package/docs/components/recognizer.md +78 -0
- package/docs/components/synthesizer.md +27 -0
- package/docs/guides/session-commands.md +417 -0
- package/docs/verbs/conference.md +51 -0
- package/docs/verbs/deepgram_s2s.md +108 -0
- package/docs/verbs/dial.md +8 -0
- package/docs/verbs/listen.md +71 -0
- package/docs/verbs/pipeline.md +475 -0
- package/docs/verbs/stream.md +5 -0
- package/index.js +9 -0
- package/jambonz-app.schema.json +112 -0
- package/lib/normalize.js +72 -0
- package/lib/validator.js +137 -0
- package/package.json +39 -0
- package/verbs/alert.schema.json +34 -0
- package/verbs/answer.schema.json +22 -0
- package/verbs/conference.schema.json +107 -0
- package/verbs/config.schema.json +218 -0
- package/verbs/deepgram_s2s.schema.json +81 -0
- package/verbs/dequeue.schema.json +51 -0
- package/verbs/dial.schema.json +187 -0
- package/verbs/dialogflow.schema.json +148 -0
- package/verbs/dtmf.schema.json +49 -0
- package/verbs/dub.schema.json +103 -0
- package/verbs/elevenlabs_s2s.schema.json +81 -0
- package/verbs/enqueue.schema.json +53 -0
- package/verbs/gather.schema.json +188 -0
- package/verbs/google_s2s.schema.json +42 -0
- package/verbs/hangup.schema.json +36 -0
- package/verbs/leave.schema.json +22 -0
- package/verbs/listen.schema.json +127 -0
- package/verbs/llm.schema.json +44 -0
- package/verbs/message.schema.json +82 -0
- package/verbs/openai_s2s.schema.json +42 -0
- package/verbs/pause.schema.json +36 -0
- package/verbs/pipeline.schema.json +240 -0
- package/verbs/play.schema.json +96 -0
- package/verbs/redirect.schema.json +34 -0
- package/verbs/s2s.schema.json +39 -0
- package/verbs/say.schema.json +107 -0
- package/verbs/sip-decline.schema.json +58 -0
- package/verbs/sip-refer.schema.json +58 -0
- package/verbs/sip-request.schema.json +54 -0
- package/verbs/stream.schema.json +103 -0
- package/verbs/tag.schema.json +41 -0
- package/verbs/transcribe.schema.json +57 -0
- package/verbs/ultravox_s2s.schema.json +41 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/pipeline-turn",
|
|
4
|
+
"title": "Pipeline EventHook Events",
|
|
5
|
+
"description": "Events sent to the pipeline verb's eventHook during a conversation. These are sent as 'pipeline:event' messages over the WebSocket connection.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"oneOf": [
|
|
8
|
+
{
|
|
9
|
+
"properties": {
|
|
10
|
+
"type": {
|
|
11
|
+
"const": "turn_end",
|
|
12
|
+
"description": "Sent at the end of each conversational turn."
|
|
13
|
+
},
|
|
14
|
+
"transcript": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "The user's final speech-to-text transcript for this turn."
|
|
17
|
+
},
|
|
18
|
+
"response": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "The assistant's text response for this turn. May be trimmed to what was actually spoken if the turn was interrupted and alignment tracking is enabled."
|
|
21
|
+
},
|
|
22
|
+
"interrupted": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "True if the user interrupted the assistant before it finished speaking.",
|
|
25
|
+
"default": false
|
|
26
|
+
},
|
|
27
|
+
"latency": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"description": "Latency metrics for this turn, all in milliseconds. Fields are absent when not applicable.",
|
|
30
|
+
"properties": {
|
|
31
|
+
"transcriber_latency": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"description": "STT processing latency: time from user stops talking until final transcript received, in milliseconds."
|
|
34
|
+
},
|
|
35
|
+
"turn_detection_latency": {
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"description": "Additional wait after final transcript for end-of-turn detection, in milliseconds. Absent when EOT fires before or with the transcript."
|
|
38
|
+
},
|
|
39
|
+
"model_latency": {
|
|
40
|
+
"type": "integer",
|
|
41
|
+
"description": "LLM latency: time spent waiting for the first LLM token after the system is ready to prompt, in milliseconds. Absent on a preflight hit."
|
|
42
|
+
},
|
|
43
|
+
"voice_latency": {
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"description": "TTS engine latency: time from first text sent to the TTS engine until first audio received back, in milliseconds."
|
|
46
|
+
},
|
|
47
|
+
"preflight": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"description": "Early generation (preflight) metrics. Only present when earlyGeneration is enabled.",
|
|
50
|
+
"properties": {
|
|
51
|
+
"result": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"enum": ["hit", "miss", "pending"],
|
|
54
|
+
"description": "Whether the speculative preflight transcript matched the final transcript ('hit'), did not match ('miss'), or was still in progress ('pending')."
|
|
55
|
+
},
|
|
56
|
+
"tokens": {
|
|
57
|
+
"type": "integer",
|
|
58
|
+
"description": "Number of preflight tokens that were buffered. Only present on a 'hit'."
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"required": ["type", "transcript", "response", "interrupted", "latency"],
|
|
68
|
+
"additionalProperties": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"properties": {
|
|
72
|
+
"type": {
|
|
73
|
+
"const": "user_transcript",
|
|
74
|
+
"description": "Sent when the user's final transcript is available and the system is proceeding to prompt the LLM. This indicates the end of the user's speech input for the current turn."
|
|
75
|
+
},
|
|
76
|
+
"transcript": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"description": "The user's final speech-to-text transcript."
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"required": ["type", "transcript"],
|
|
82
|
+
"additionalProperties": false
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"properties": {
|
|
86
|
+
"type": {
|
|
87
|
+
"const": "agent_response",
|
|
88
|
+
"description": "Sent when the LLM has finished generating its response for the current turn. Contains the complete response text."
|
|
89
|
+
},
|
|
90
|
+
"response": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "The assistant's complete text response."
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": ["type", "response"],
|
|
96
|
+
"additionalProperties": false
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"properties": {
|
|
100
|
+
"type": {
|
|
101
|
+
"const": "user_interruption",
|
|
102
|
+
"description": "Sent when the user barges in (interrupts) while the assistant is speaking. This event has no additional data."
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"required": ["type"],
|
|
106
|
+
"additionalProperties": false
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/play",
|
|
4
|
+
"title": "Play ActionHook Payload",
|
|
5
|
+
"description": "Payload sent to the play verb's actionHook when playback completes or fails.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "base" }
|
|
8
|
+
],
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"reason": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["playCompleted", "playFailed"],
|
|
14
|
+
"description": "Outcome of playback. 'playCompleted' on success, 'playFailed' on file-not-found or other error."
|
|
15
|
+
},
|
|
16
|
+
"playback_seconds": {
|
|
17
|
+
"type": "integer",
|
|
18
|
+
"description": "Total playback duration in seconds. Present when reason is 'playCompleted'."
|
|
19
|
+
},
|
|
20
|
+
"playback_milliseconds": {
|
|
21
|
+
"type": "integer",
|
|
22
|
+
"description": "Total playback duration in milliseconds. Present when reason is 'playCompleted'."
|
|
23
|
+
},
|
|
24
|
+
"playback_last_offset_pos": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Last offset position in the audio stream. Present when reason is 'playCompleted'."
|
|
27
|
+
},
|
|
28
|
+
"status": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": ["fail"],
|
|
31
|
+
"description": "Set to 'fail' when playback failed (e.g. file not found)."
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": ["reason"],
|
|
35
|
+
"additionalProperties": true
|
|
36
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/session-new",
|
|
4
|
+
"title": "Session:new Payload",
|
|
5
|
+
"description": "Payload delivered when a new call arrives. For webhook apps this is the initial POST body; for WebSocket apps it is the `data` property of the first `session:new` message. In the @jambonz/sdk WebSocket transport, this data is available as `session.data`.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "base" }
|
|
8
|
+
],
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"caller_name": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Caller display name from the SIP From header."
|
|
14
|
+
},
|
|
15
|
+
"caller_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Caller ID value (phone number or SIP user)."
|
|
18
|
+
},
|
|
19
|
+
"service_provider_sid": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Service provider identifier, if applicable."
|
|
22
|
+
},
|
|
23
|
+
"parent_call_sid": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Call SID of the parent call, present when this session was created via the REST API dial (adulting) or when an outbound call leg is promoted to its own session."
|
|
26
|
+
},
|
|
27
|
+
"fs_sip_address": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Internal SIP address of the FreeSWITCH media server handling this call."
|
|
30
|
+
},
|
|
31
|
+
"fs_public_ip": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Public IP address of the FreeSWITCH media server, if available."
|
|
34
|
+
},
|
|
35
|
+
"sip": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "The raw SIP INVITE message (drachtio SipRequest object, serialized). Only present for WebSocket and HTTP POST transports (not for HTTP GET). See https://drachtio.org/api#sip-request for the full drachtio SipRequest API.",
|
|
38
|
+
"properties": {
|
|
39
|
+
"headers": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "SIP headers from the INVITE as key-value pairs. Custom headers (X-* headers) from the originating carrier or SIP client are included here. Standard SIP headers like From, To, Contact, Call-ID, Via, etc. are also present.",
|
|
42
|
+
"additionalProperties": { "type": "string" },
|
|
43
|
+
"examples": [
|
|
44
|
+
{
|
|
45
|
+
"X-Authenticated-User": "retell@sip.example.com",
|
|
46
|
+
"X-Override-Number": "+15551234567",
|
|
47
|
+
"From": "<sip:+15083084809@10.0.0.1>;tag=abc123",
|
|
48
|
+
"To": "<sip:+15083728299@jambonz.cloud>",
|
|
49
|
+
"Call-ID": "abc123@10.0.0.1"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"body": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "SIP message body (typically SDP for INVITE)."
|
|
56
|
+
},
|
|
57
|
+
"method": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "SIP method (always 'INVITE' for session:new)."
|
|
60
|
+
},
|
|
61
|
+
"uri": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Request-URI from the SIP INVITE."
|
|
64
|
+
},
|
|
65
|
+
"calledNumber": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Phone number extracted from the Request-URI."
|
|
68
|
+
},
|
|
69
|
+
"callingNumber": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "Calling phone number extracted from P-Asserted-Identity or From header."
|
|
72
|
+
},
|
|
73
|
+
"type": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"enum": ["request"],
|
|
76
|
+
"description": "Always 'request' for an incoming INVITE."
|
|
77
|
+
},
|
|
78
|
+
"source": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"enum": ["network", "application"],
|
|
81
|
+
"description": "Origin of the SIP message."
|
|
82
|
+
},
|
|
83
|
+
"source_address": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"description": "IP address of the sender."
|
|
86
|
+
},
|
|
87
|
+
"source_port": {
|
|
88
|
+
"type": ["string", "integer"],
|
|
89
|
+
"description": "Port of the sender."
|
|
90
|
+
},
|
|
91
|
+
"protocol": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Transport protocol (e.g. 'udp', 'tcp', 'tls', 'wss')."
|
|
94
|
+
},
|
|
95
|
+
"payload": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"description": "Message body organized into parts; useful for multipart content."
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"env_vars": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"description": "Application environment variables configured in the jambonz portal. These are the key-value pairs defined in the application's environment variable schema. In the @jambonz/sdk, access via `session.data.env_vars`.",
|
|
104
|
+
"additionalProperties": true,
|
|
105
|
+
"examples": [
|
|
106
|
+
{
|
|
107
|
+
"RETELL_TRUNK_NAME": "retell-hosted",
|
|
108
|
+
"PSTN_TRUNK_NAME": "my-carrier",
|
|
109
|
+
"DEFAULT_COUNTRY": "US"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"defaults": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"description": "Default speech settings for the account (synthesizer and recognizer defaults).",
|
|
116
|
+
"properties": {
|
|
117
|
+
"synthesizer": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"description": "Default TTS settings.",
|
|
120
|
+
"properties": {
|
|
121
|
+
"vendor": { "type": "string" },
|
|
122
|
+
"language": { "type": "string" },
|
|
123
|
+
"voice": { "type": "string" }
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"recognizer": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"description": "Default STT settings.",
|
|
129
|
+
"properties": {
|
|
130
|
+
"vendor": { "type": "string" },
|
|
131
|
+
"language": { "type": "string" }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"customerData": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"description": "Custom data attached to the call via the REST API when creating an outbound call. Preserved as-is (not snake-cased).",
|
|
139
|
+
"additionalProperties": true
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"additionalProperties": true
|
|
143
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/session-reconnect",
|
|
4
|
+
"title": "Session:reconnect Payload",
|
|
5
|
+
"description": "Payload delivered when a WebSocket client reconnects after a disconnection. The payload is identical to the original session:new payload — it is cached from the initial session setup and replayed on reconnect. This allows the application to restore state without needing to re-fetch call details.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "session-new" }
|
|
8
|
+
]
|
|
9
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/session-redirect",
|
|
4
|
+
"title": "Session:redirect Payload",
|
|
5
|
+
"description": "Payload delivered when a redirect verb transfers the call to a new application or WebSocket endpoint. Contains only the current call state information — unlike session:new, it does not include defaults, env_vars, sip, or service_provider_sid.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "base" }
|
|
8
|
+
],
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"caller_name": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Caller display name from the SIP From header."
|
|
14
|
+
},
|
|
15
|
+
"caller_id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Caller ID value (phone number or SIP user)."
|
|
18
|
+
},
|
|
19
|
+
"parent_call_sid": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Call SID of the parent call, if applicable."
|
|
22
|
+
},
|
|
23
|
+
"fs_sip_address": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Internal SIP address of the FreeSWITCH media server handling this call."
|
|
26
|
+
},
|
|
27
|
+
"fs_public_ip": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Public IP address of the FreeSWITCH media server, if available."
|
|
30
|
+
},
|
|
31
|
+
"customerData": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"description": "Custom data attached to the call via the REST API. Preserved as-is (not snake-cased).",
|
|
34
|
+
"additionalProperties": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"additionalProperties": true
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/sip-refer-event",
|
|
4
|
+
"title": "SIP Refer EventHook Payload",
|
|
5
|
+
"description": "Payload sent to the sip-refer eventHook when a SIP NOTIFY is received with transfer status updates.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"event": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "transfer-status",
|
|
11
|
+
"description": "Event type — always 'transfer-status' for REFER notifications."
|
|
12
|
+
},
|
|
13
|
+
"call_status": {
|
|
14
|
+
"type": "integer",
|
|
15
|
+
"description": "SIP status code from the NOTIFY sipfrag body (e.g. 100 for trying, 180 for ringing, 200 for success)."
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": ["event", "call_status"],
|
|
19
|
+
"additionalProperties": true
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/sip-refer",
|
|
4
|
+
"title": "SipRefer ActionHook Payload",
|
|
5
|
+
"description": "Payload sent to the sip-refer verb's actionHook when the REFER completes. Sent once the REFER response is received, or after a final NOTIFY arrives.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "base" }
|
|
8
|
+
],
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"refer_status": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"description": "SIP status code from the REFER response (e.g. 202 for accepted, 4xx/5xx for failure)."
|
|
14
|
+
},
|
|
15
|
+
"final_referred_call_status": {
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"description": "Final SIP status of the referred call, extracted from a NOTIFY sipfrag. Present only when the REFER was accepted (202) and a final NOTIFY was received."
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": ["refer_status"],
|
|
21
|
+
"additionalProperties": true
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/sip-request",
|
|
4
|
+
"title": "SipRequest ActionHook Payload",
|
|
5
|
+
"description": "Payload sent to the sip-request verb's actionHook after a SIP request (e.g. INFO, NOTIFY) is sent and a response is received.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "base" }
|
|
8
|
+
],
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"result": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"enum": ["success", "failed"],
|
|
14
|
+
"description": "Whether the SIP request succeeded or failed."
|
|
15
|
+
},
|
|
16
|
+
"sip_status": {
|
|
17
|
+
"type": "integer",
|
|
18
|
+
"description": "SIP response status code. Present when result is 'success'."
|
|
19
|
+
},
|
|
20
|
+
"err": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Error message. Present when result is 'failed'."
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": ["result"],
|
|
26
|
+
"additionalProperties": true
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/transcribe-translation",
|
|
4
|
+
"title": "Transcribe TranslationHook Payload",
|
|
5
|
+
"description": "Payload sent to the translationHook when a translation result is received.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "base" }
|
|
8
|
+
],
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"translation": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"description": "Translation result data.",
|
|
14
|
+
"properties": {
|
|
15
|
+
"channel": { "type": "integer", "description": "Audio channel number (1 or 2)." },
|
|
16
|
+
"language": { "type": "string", "description": "Target language code for the translation." },
|
|
17
|
+
"translation": { "type": "string", "description": "The translated text." }
|
|
18
|
+
},
|
|
19
|
+
"required": ["channel", "language", "translation"]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": ["translation"],
|
|
23
|
+
"additionalProperties": true
|
|
24
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/transcribe",
|
|
4
|
+
"title": "Transcribe TranscriptionHook Payload",
|
|
5
|
+
"description": "Payload sent to the transcriptionHook when a transcription result is received from the STT engine.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{ "$ref": "base" }
|
|
8
|
+
],
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"speech": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"description": "Speech recognition results, present when the STT engine returns alternatives.",
|
|
14
|
+
"properties": {
|
|
15
|
+
"language_code": { "type": "string", "description": "Language code used for recognition (e.g. 'en-US')." },
|
|
16
|
+
"channel_tag": { "type": "integer", "description": "Audio channel number." },
|
|
17
|
+
"is_final": { "type": "boolean", "description": "Whether this is a final (not interim) recognition result." },
|
|
18
|
+
"alternatives": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"transcript": { "type": "string", "description": "The recognized transcript." },
|
|
24
|
+
"confidence": { "type": "number", "description": "Confidence score between 0 and 1." }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"description": "Array of recognition alternatives, ordered by confidence."
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"speech_event": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"description": "Speech event data, present when the STT engine returns a typed event (e.g. end of utterance).",
|
|
34
|
+
"properties": {
|
|
35
|
+
"type": { "type": "string", "description": "Event type from the STT vendor." }
|
|
36
|
+
},
|
|
37
|
+
"additionalProperties": true
|
|
38
|
+
},
|
|
39
|
+
"stt_latency_ms": { "type": "string", "description": "STT latency in milliseconds." },
|
|
40
|
+
"stt_talkspurts": { "type": "string", "description": "JSON-encoded array of talkspurt timing data." },
|
|
41
|
+
"stt_start_time": { "type": "string", "description": "STT recognition start time." },
|
|
42
|
+
"stt_stop_time": { "type": "string", "description": "STT recognition stop time." },
|
|
43
|
+
"stt_usage": { "description": "STT usage data from the vendor." }
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": true
|
|
46
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/tts-streaming-event",
|
|
4
|
+
"title": "TTS Streaming Event",
|
|
5
|
+
"description": "Events sent to the '/streaming-event' WebSocket endpoint during TTS streaming. These are sent as 'tts:streaming-event' messages. The tts_spoken event is only sent when trackTtsPlayout is enabled via the config verb.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"oneOf": [
|
|
8
|
+
{
|
|
9
|
+
"properties": {
|
|
10
|
+
"event_type": {
|
|
11
|
+
"const": "stream_open",
|
|
12
|
+
"description": "The TTS streaming connection has been established."
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": ["event_type"],
|
|
16
|
+
"additionalProperties": false
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"properties": {
|
|
20
|
+
"event_type": {
|
|
21
|
+
"const": "stream_closed",
|
|
22
|
+
"description": "The TTS streaming connection has been closed."
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": ["event_type"],
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"properties": {
|
|
30
|
+
"event_type": {
|
|
31
|
+
"const": "stream_paused",
|
|
32
|
+
"description": "TTS streaming has been paused."
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": ["event_type"],
|
|
36
|
+
"additionalProperties": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"properties": {
|
|
40
|
+
"event_type": {
|
|
41
|
+
"const": "stream_resumed",
|
|
42
|
+
"description": "TTS streaming has been resumed."
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": ["event_type"],
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"properties": {
|
|
50
|
+
"event_type": {
|
|
51
|
+
"const": "user_interruption",
|
|
52
|
+
"description": "The user interrupted (barged in) during TTS playout, causing the stream to be cleared."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": ["event_type"],
|
|
56
|
+
"additionalProperties": false
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"properties": {
|
|
60
|
+
"event_type": {
|
|
61
|
+
"const": "tts_spoken",
|
|
62
|
+
"description": "Reports the actual text that was spoken via TTS. Sent on utterance completion or when the user barges in. Only sent when trackTtsPlayout is enabled via the config verb. Requires a TTS vendor that supports alignment data (e.g. ElevenLabs)."
|
|
63
|
+
},
|
|
64
|
+
"text": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "The text that was actually spoken before completion or interruption."
|
|
67
|
+
},
|
|
68
|
+
"bargein": {
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"description": "True if the user barged in (interrupted) before the TTS finished speaking. False if the utterance completed normally."
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"required": ["event_type", "text", "bargein"],
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/callbacks/verb-status",
|
|
4
|
+
"title": "Verb Status Event",
|
|
5
|
+
"description": "Real-time verb lifecycle events sent over WebSocket when notifyEvents is enabled on the session. These are informational — no response is expected.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"event": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"enum": [
|
|
11
|
+
"starting",
|
|
12
|
+
"finished",
|
|
13
|
+
"start-playback",
|
|
14
|
+
"stop-playback",
|
|
15
|
+
"kill-playback",
|
|
16
|
+
"dtmf-bargein-detected",
|
|
17
|
+
"speech-bargein-detected",
|
|
18
|
+
"synthesized-audio"
|
|
19
|
+
],
|
|
20
|
+
"description": "The verb lifecycle event."
|
|
21
|
+
},
|
|
22
|
+
"verb": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "The verb name (e.g. 'say', 'play', 'gather'). Present on synthesized-audio, start-playback, stop-playback, kill-playback, and dtmf/speech-bargein events."
|
|
25
|
+
},
|
|
26
|
+
"name": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "The verb name. Present on 'starting' and 'finished' events (these use 'name' instead of 'verb')."
|
|
29
|
+
},
|
|
30
|
+
"id": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "The verb instance id, if one was assigned by the application."
|
|
33
|
+
},
|
|
34
|
+
"vendor": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "TTS vendor name. Present on synthesized-audio events."
|
|
37
|
+
},
|
|
38
|
+
"language": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "TTS language code. Present on synthesized-audio events."
|
|
41
|
+
},
|
|
42
|
+
"characters": {
|
|
43
|
+
"type": "integer",
|
|
44
|
+
"description": "Number of characters synthesized. Present on synthesized-audio events when not served from cache."
|
|
45
|
+
},
|
|
46
|
+
"elapsed_time": {
|
|
47
|
+
"type": "number",
|
|
48
|
+
"description": "TTS round-trip time in milliseconds. Present on synthesized-audio events when not served from cache."
|
|
49
|
+
},
|
|
50
|
+
"served_from_cache": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Whether the TTS audio was served from cache. Present on synthesized-audio events."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": ["event"],
|
|
56
|
+
"additionalProperties": true
|
|
57
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://jambonz.org/schema/components/actionHook",
|
|
4
|
+
"title": "ActionHook",
|
|
5
|
+
"description": "A webhook or websocket callback that jambonz invokes when a verb completes. Reports verb results (e.g. speech recognition from 'gather', dial outcome) and receives the next verbs to execute. In webhook mode: jambonz POSTs to this URL and the HTTP response body is the next verb array. In WebSocket mode: this value becomes an event name emitted on the session — bind session.on('/hookName', (evt) => {...}) and respond with session.reply() (NOT session.send()). The callback payload always includes 'reason' plus verb-specific fields (e.g. 'speech', 'digits' for gather). Can be a simple URL/path string or an object with additional options.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "string",
|
|
9
|
+
"format": "uri",
|
|
10
|
+
"description": "A URL to invoke. For webhook applications this is an HTTP(S) URL. For websocket applications this is typically a relative path or event name.",
|
|
11
|
+
"examples": ["https://myapp.example.com/gather-result", "/gather-result"]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "object",
|
|
15
|
+
"description": "A hook specification with URL and additional options.",
|
|
16
|
+
"properties": {
|
|
17
|
+
"url": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"format": "uri",
|
|
20
|
+
"description": "The URL to invoke."
|
|
21
|
+
},
|
|
22
|
+
"method": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "The HTTP method to use. Only applies to webhook applications.",
|
|
25
|
+
"enum": ["GET", "POST"],
|
|
26
|
+
"default": "POST"
|
|
27
|
+
},
|
|
28
|
+
"basicAuth": {
|
|
29
|
+
"$ref": "auth",
|
|
30
|
+
"description": "Basic authentication credentials to include in the request."
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"required": ["url"]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|