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,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/gather",
4
+ "title": "Gather ActionHook Payload",
5
+ "description": "Payload sent to the actionHook when a gather verb completes, either due to speech detected, DTMF detected, or timeout.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "reason": {
12
+ "type": "string",
13
+ "enum": ["speechDetected", "dtmfDetected", "timeout", "error", "stt-low-confidence"],
14
+ "description": "The reason the gather completed."
15
+ },
16
+ "speech": {
17
+ "type": "object",
18
+ "description": "Speech recognition results, present when reason is speechDetected.",
19
+ "properties": {
20
+ "language_code": { "type": "string", "description": "Language code used for recognition (e.g. 'en-US')." },
21
+ "channel_tag": { "type": "integer", "description": "Audio channel number." },
22
+ "is_final": { "type": "boolean", "description": "Whether this is a final (not interim) recognition result." },
23
+ "alternatives": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "object",
27
+ "properties": {
28
+ "transcript": { "type": "string", "description": "The recognized transcript." },
29
+ "confidence": { "type": "number", "description": "Confidence score between 0 and 1." }
30
+ }
31
+ },
32
+ "description": "Array of recognition alternatives, ordered by confidence."
33
+ },
34
+ "vendor": {
35
+ "type": "object",
36
+ "description": "Vendor-specific STT data. Structure varies by provider.",
37
+ "properties": {
38
+ "name": { "type": "string", "description": "STT vendor name (e.g. 'deepgram', 'google', 'aws')." },
39
+ "evt": {
40
+ "description": "Raw vendor-specific event payload. A single object for simple utterances, or an array of objects when jambonz assembles the final transcript from multiple STT segments. Contains provider-specific fields like word-level timestamps, model info, etc.",
41
+ "oneOf": [
42
+ { "type": "object", "additionalProperties": true },
43
+ { "type": "array", "items": { "type": "object", "additionalProperties": true } }
44
+ ]
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "digits": {
51
+ "type": "string",
52
+ "description": "DTMF digits collected, present when reason is dtmfDetected."
53
+ },
54
+ "details": {
55
+ "type": "object",
56
+ "description": "Error information if reason is error."
57
+ }
58
+ },
59
+ "additionalProperties": true
60
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/listen",
4
+ "title": "Listen ActionHook Payload",
5
+ "description": "Payload sent to the listen verb's actionHook when the listen verb completes.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "dial_call_duration": {
12
+ "type": "integer",
13
+ "description": "Duration of the listen session in seconds, present if recording was active."
14
+ },
15
+ "digits": {
16
+ "type": "string",
17
+ "description": "DTMF digit that ended the listen, present if finishOnKey was configured and pressed."
18
+ }
19
+ },
20
+ "additionalProperties": true
21
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/llm",
4
+ "title": "LLM ActionHook Payload",
5
+ "description": "Payload sent to the llm verb's actionHook when the LLM session ends. Applies to all LLM providers (OpenAI, Google, ElevenLabs, Ultravox, and generic voice agents).",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "completion_reason": {
12
+ "type": "string",
13
+ "enum": [
14
+ "normal conversation end",
15
+ "connection failure",
16
+ "disconnect from remote end",
17
+ "server failure",
18
+ "server error",
19
+ "client error calling function",
20
+ "client error calling mcp function"
21
+ ],
22
+ "description": "Reason the LLM session ended."
23
+ },
24
+ "error": {
25
+ "description": "Error details, present when completion_reason indicates a failure."
26
+ }
27
+ },
28
+ "required": ["completion_reason"],
29
+ "additionalProperties": true
30
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jambonz.org/schema/callbacks/message",
4
+ "title": "Message ActionHook Payload",
5
+ "description": "Payload sent to the message verb's actionHook with the delivery status of an outbound SMS.",
6
+ "allOf": [
7
+ { "$ref": "base" }
8
+ ],
9
+ "type": "object",
10
+ "properties": {
11
+ "message_sid": {
12
+ "type": "string",
13
+ "description": "Unique identifier for the message."
14
+ },
15
+ "message_status": {
16
+ "type": "string",
17
+ "enum": ["success", "failure", "no carriers", "smpp configuration error", "system error"],
18
+ "description": "Delivery status of the message."
19
+ },
20
+ "carrier": {
21
+ "type": "string",
22
+ "description": "Name of the carrier used to send the message. Present on success or carrier-level failure."
23
+ },
24
+ "carrier_message_id": {
25
+ "type": "string",
26
+ "description": "Message ID returned by the carrier. Present on success or carrier-level failure."
27
+ },
28
+ "message_failure_reason": {
29
+ "type": "string",
30
+ "description": "Reason for failure. Present when message_status is 'failure' or 'system error'."
31
+ }
32
+ },
33
+ "required": ["message_sid", "message_status"],
34
+ "additionalProperties": true
35
+ }
@@ -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
+ }