@jambonz/sdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/client/index.cjs +60 -13
  2. package/dist/client/index.cjs.map +1 -1
  3. package/dist/client/index.d.cts +36 -7
  4. package/dist/client/index.d.ts +36 -7
  5. package/dist/client/index.js +59 -13
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/common-BWUBZtju.d.cts +30 -0
  8. package/dist/common-BWUBZtju.d.ts +30 -0
  9. package/dist/index.cjs +364 -32
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +8 -7
  12. package/dist/index.d.ts +8 -7
  13. package/dist/index.js +360 -32
  14. package/dist/index.js.map +1 -1
  15. package/dist/rest-BF9HKZrA.d.ts +136 -0
  16. package/dist/rest-v8weIueZ.d.cts +136 -0
  17. package/dist/session-DHc6G_9y.d.cts +112 -0
  18. package/dist/session-DHc6G_9y.d.ts +112 -0
  19. package/dist/types/index.d.cts +4 -3
  20. package/dist/types/index.d.ts +4 -3
  21. package/dist/{verb-builder-But-DJle.d.cts → verb-builder-Dg_IPC4I.d.ts} +35 -2
  22. package/dist/{verb-builder-CO_qoYxC.d.ts → verb-builder-DkHAJrk4.d.cts} +35 -2
  23. package/dist/{verbs-B_afNNUM.d.cts → verbs-fjJjfGEt.d.cts} +40 -14
  24. package/dist/{verbs-B_afNNUM.d.ts → verbs-fjJjfGEt.d.ts} +40 -14
  25. package/dist/webhook/index.cjs +68 -8
  26. package/dist/webhook/index.cjs.map +1 -1
  27. package/dist/webhook/index.d.cts +45 -3
  28. package/dist/webhook/index.d.ts +45 -3
  29. package/dist/webhook/index.js +68 -9
  30. package/dist/webhook/index.js.map +1 -1
  31. package/dist/websocket/index.cjs +291 -19
  32. package/dist/websocket/index.cjs.map +1 -1
  33. package/dist/websocket/index.d.cts +198 -4
  34. package/dist/websocket/index.d.ts +198 -4
  35. package/dist/websocket/index.js +290 -20
  36. package/dist/websocket/index.js.map +1 -1
  37. package/package.json +19 -6
  38. package/schema/callbacks/base.schema.json +29 -0
  39. package/schema/callbacks/call-status.schema.json +22 -0
  40. package/schema/callbacks/conference-status.schema.json +24 -0
  41. package/schema/callbacks/conference-wait.schema.json +11 -0
  42. package/schema/callbacks/conference.schema.json +11 -0
  43. package/schema/callbacks/dequeue.schema.json +19 -0
  44. package/schema/callbacks/dial-dtmf.schema.json +18 -0
  45. package/schema/callbacks/dial-hold.schema.json +22 -0
  46. package/schema/callbacks/dial-refer.schema.json +28 -0
  47. package/schema/callbacks/dial.schema.json +31 -0
  48. package/schema/callbacks/enqueue-wait.schema.json +17 -0
  49. package/schema/callbacks/enqueue.schema.json +27 -0
  50. package/schema/callbacks/gather-partial.schema.json +54 -0
  51. package/schema/callbacks/gather.schema.json +60 -0
  52. package/schema/callbacks/listen.schema.json +21 -0
  53. package/schema/callbacks/llm.schema.json +30 -0
  54. package/schema/callbacks/message.schema.json +35 -0
  55. package/schema/callbacks/play.schema.json +36 -0
  56. package/schema/callbacks/session-new.schema.json +143 -0
  57. package/schema/callbacks/session-reconnect.schema.json +9 -0
  58. package/schema/callbacks/session-redirect.schema.json +38 -0
  59. package/schema/callbacks/sip-refer-event.schema.json +20 -0
  60. package/schema/callbacks/sip-refer.schema.json +22 -0
  61. package/schema/callbacks/sip-request.schema.json +27 -0
  62. package/schema/callbacks/transcribe-translation.schema.json +24 -0
  63. package/schema/callbacks/transcribe.schema.json +46 -0
  64. package/schema/callbacks/verb-status.schema.json +57 -0
  65. package/schema/components/actionHook.schema.json +36 -0
  66. package/schema/components/actionHookDelayAction.schema.json +37 -0
  67. package/schema/components/amd.schema.json +68 -0
  68. package/schema/components/auth.schema.json +18 -0
  69. package/schema/components/bidirectionalAudio.schema.json +22 -0
  70. package/schema/components/fillerNoise.schema.json +25 -0
  71. package/schema/components/recognizer-assemblyAiOptions.schema.json +35 -0
  72. package/schema/components/recognizer-awsOptions.schema.json +52 -0
  73. package/schema/components/recognizer-azureOptions.schema.json +32 -0
  74. package/schema/components/recognizer-cobaltOptions.schema.json +34 -0
  75. package/schema/components/recognizer-customOptions.schema.json +27 -0
  76. package/schema/components/recognizer-deepgramOptions.schema.json +147 -0
  77. package/schema/components/recognizer-elevenlabsOptions.schema.json +39 -0
  78. package/schema/components/recognizer-gladiaOptions.schema.json +8 -0
  79. package/schema/components/recognizer-googleOptions.schema.json +35 -0
  80. package/schema/components/recognizer-houndifyOptions.schema.json +53 -0
  81. package/schema/components/recognizer-ibmOptions.schema.json +54 -0
  82. package/schema/components/recognizer-nuanceOptions.schema.json +150 -0
  83. package/schema/components/recognizer-nvidiaOptions.schema.json +39 -0
  84. package/schema/components/recognizer-openaiOptions.schema.json +59 -0
  85. package/schema/components/recognizer-sonioxOptions.schema.json +46 -0
  86. package/schema/components/recognizer-speechmaticsOptions.schema.json +91 -0
  87. package/schema/components/recognizer-verbioOptions.schema.json +46 -0
  88. package/schema/components/recognizer.schema.json +212 -0
  89. package/schema/components/synthesizer.schema.json +82 -0
  90. package/schema/components/target.schema.json +105 -0
  91. package/schema/components/vad.schema.json +48 -0
  92. package/schema/jambonz-app.schema.json +106 -0
  93. package/schema/verbs/alert.schema.json +20 -0
  94. package/schema/verbs/answer.schema.json +12 -0
  95. package/schema/verbs/conference.schema.json +43 -0
  96. package/schema/verbs/config.schema.json +170 -0
  97. package/schema/verbs/dequeue.schema.json +36 -0
  98. package/schema/verbs/dial.schema.json +153 -0
  99. package/schema/verbs/dtmf.schema.json +27 -0
  100. package/schema/verbs/dub.schema.json +52 -0
  101. package/schema/verbs/enqueue.schema.json +38 -0
  102. package/schema/verbs/gather.schema.json +145 -0
  103. package/schema/verbs/hangup.schema.json +29 -0
  104. package/schema/verbs/leave.schema.json +12 -0
  105. package/schema/verbs/listen.schema.json +109 -0
  106. package/schema/verbs/llm.schema.json +131 -0
  107. package/schema/verbs/message.schema.json +30 -0
  108. package/schema/verbs/pause.schema.json +26 -0
  109. package/schema/verbs/pipeline.schema.json +61 -0
  110. package/schema/verbs/play.schema.json +69 -0
  111. package/schema/verbs/redirect.schema.json +23 -0
  112. package/schema/verbs/say.schema.json +84 -0
  113. package/schema/verbs/sip-decline.schema.json +31 -0
  114. package/schema/verbs/sip-refer.schema.json +41 -0
  115. package/schema/verbs/sip-request.schema.json +33 -0
  116. package/schema/verbs/stream.schema.json +30 -0
  117. package/schema/verbs/tag.schema.json +21 -0
  118. package/schema/verbs/transcribe.schema.json +48 -0
  119. package/dist/common-Bsqv1Brz.d.cts +0 -69
  120. package/dist/common-Bsqv1Brz.d.ts +0 -69
  121. package/dist/rest-BV_FsqnH.d.cts +0 -97
  122. package/dist/rest-CthGXHnw.d.ts +0 -97
@@ -0,0 +1,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
+ }
@@ -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,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
+ }