Skip to content

Commit f9f3f76

Browse files
feat(api): add SIP DTMF commands and delivery events (#4208)
## Summary Adds typed SIP sideband keypress commands and delivery confirmations while preserving legacy notification types. ## Changes - Send SIP keypresses with transport.dtmf.send and optional event correlation. - Receive transport.dtmf.sent confirmations while retaining existing transport.dtmf.send notification types. The `transport.dtmf.send` command is available for SIP sideband connections. Successful sends produce `transport.dtmf.sent` acknowledgements. Legacy SDK notification types and historical event decoding remain available, while the server acknowledgement now uses `transport.dtmf.sent`.
1 parent 3ee373e commit f9f3f76

9 files changed

Lines changed: 298 additions & 92 deletions

File tree

‎.castiron.stats.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schema_version: 1
2-
generation_id: 02a4f051-9120-487b-8954-9ea8b97df229
3-
openapi_spec_hash: 017866de8f67cefec8724f830463cbe2
4-
openapi_transformed_spec_hash: d7de2a7f65152a983cdba4c6b4a20d76
5-
config_hash: 3d64bda5a8bbef3ad0572848ae7e87f7
6-
codegen_sha: ab8360c6a37ccd1f94712f0aa9646349279084b1
7-
codegen_hash: cd27c533727eae2ee5d4350f07afd15d7de38e89fd3c4c2e35dbda61cd39f5d8
2+
generation_id: 27aedac3-d226-45f3-9b03-cdbc31e26c4a
3+
openapi_spec_hash: 6e0c0f870093ed93cda3b6c04057dff1
4+
openapi_transformed_spec_hash: 6dca3c69339704dc304046890bab23a2
5+
config_hash: 8a684aec06907ff8ced7809753e16225
6+
codegen_sha: a437bfc5da2d18f1d2cf8b2e0dabf33cbce30762
7+
codegen_hash: 7c728907f3820a04cdb65380930c806a947d51378d79412f730f857ec317f0bf

‎api_reference/openapi.transformed.yml‎

Lines changed: 141 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -52062,6 +52062,7 @@ components:
5206252062
- $ref: '#/components/schemas/LiveInputAudioMuteParam'
5206352063
- $ref: '#/components/schemas/LiveInputAudioUnmuteParam'
5206452064
- $ref: '#/components/schemas/LiveOutputAudioFixturePlayParam'
52065+
- $ref: '#/components/schemas/LiveTransportDTMFSendParam'
5206552066
- $ref: '#/components/schemas/LiveInstructionsAppendParam'
5206652067
- $ref: '#/components/schemas/LiveThinkingAppendParam'
5206752068
- $ref: '#/components/schemas/LiveCommentaryAppendParam'
@@ -52117,6 +52118,7 @@ components:
5211752118
- $ref: '#/components/schemas/LiveOutputAudioDelta'
5211852119
- $ref: '#/components/schemas/LiveTransportDTMFReceived'
5211952120
- $ref: '#/components/schemas/LiveTransportDTMFSend'
52121+
- $ref: '#/components/schemas/LiveTransportDTMFSent'
5212052122
- $ref: '#/components/schemas/LiveTransportRinging'
5212152123
- $ref: '#/components/schemas/LiveTransportAnswered'
5212252124
- $ref: '#/components/schemas/LiveTransportFailed'
@@ -79111,6 +79113,41 @@ components:
7911179113
- auto
7911279114
- none
7911379115
- required
79116+
LiveTransportDTMFSend:
79117+
description: Legacy SIP DTMF delivery notification retained for SDK compatibility and saved events. Current servers confirm delivery with transport.dtmf.sent; transport.dtmf.send is now the client command.
79118+
example:
79119+
type: transport.dtmf.send
79120+
event_id: event_dtmf_2
79121+
event: '#'
79122+
type: object
79123+
properties:
79124+
type:
79125+
default: transport.dtmf.send
79126+
x-stainless-const: true
79127+
type: string
79128+
enum:
79129+
- transport.dtmf.send
79130+
event_id:
79131+
type: string
79132+
event:
79133+
type: string
79134+
minLength: 1
79135+
maxLength: 1
79136+
pattern: ^[0-9A-D*#]$
79137+
client_event_id:
79138+
description: The event_id of the client command, when supplied.
79139+
type: string
79140+
x-stainless-skip:
79141+
- cli
79142+
required:
79143+
- type
79144+
- event_id
79145+
- event
79146+
x-oaiMeta:
79147+
example:
79148+
type: transport.dtmf.send
79149+
event_id: event_dtmf_2
79150+
event: '#'
7911479151
LegacyComputerAction:
7911579152
discriminator:
7911679153
propertyName: type
@@ -79124,42 +79161,6 @@ components:
7912479161
- $ref: '#/components/schemas/ScrollParam'
7912579162
- $ref: '#/components/schemas/TypeParam'
7912679163
- $ref: '#/components/schemas/WaitParam'
79127-
CodeInterpreterContainerAuto:
79128-
properties:
79129-
type:
79130-
type: string
79131-
enum:
79132-
- auto
79133-
description: Always `auto`.
79134-
default: auto
79135-
x-stainless-const: true
79136-
file_ids:
79137-
items:
79138-
type: string
79139-
example: file-123
79140-
type: array
79141-
maxItems: 50
79142-
description: An optional list of uploaded files to make available to your code.
79143-
memory_limit:
79144-
anyOf:
79145-
- $ref: '#/components/schemas/ContainerMemoryLimit'
79146-
description: The memory limit for the code interpreter container.
79147-
- type: 'null'
79148-
network_policy:
79149-
discriminator:
79150-
propertyName: type
79151-
description: Network access policy for the container.
79152-
anyOf:
79153-
- $ref: '#/components/schemas/ContainerNetworkPolicyDisabledParam'
79154-
- $ref: '#/components/schemas/ContainerNetworkPolicyAllowlistParam'
79155-
type: object
79156-
required:
79157-
- type
79158-
title: CodeInterpreterToolAuto
79159-
description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
79160-
x-stainless-naming:
79161-
go:
79162-
type_name: ToolCodeInterpreterContainerCodeInterpreterContainerAuto
7916379164
LiveSpecificFileSearchParam:
7916479165
type: object
7916579166
properties:
@@ -97649,41 +97650,6 @@ components:
9764997650
type: transport.dtmf.received
9765097651
event_id: event_dtmf_1
9765197652
event: '5'
97652-
LiveTransportDTMFSend:
97653-
description: A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command.
97654-
example:
97655-
type: transport.dtmf.send
97656-
event_id: event_dtmf_2
97657-
event: '#'
97658-
type: object
97659-
properties:
97660-
type:
97661-
default: transport.dtmf.send
97662-
x-stainless-const: true
97663-
type: string
97664-
enum:
97665-
- transport.dtmf.send
97666-
event_id:
97667-
type: string
97668-
event:
97669-
type: string
97670-
minLength: 1
97671-
maxLength: 1
97672-
pattern: ^[0-9A-D*#]$
97673-
client_event_id:
97674-
description: The event_id of the client command, when supplied.
97675-
type: string
97676-
x-stainless-skip:
97677-
- cli
97678-
required:
97679-
- type
97680-
- event_id
97681-
- event
97682-
x-oaiMeta:
97683-
example:
97684-
type: transport.dtmf.send
97685-
event_id: event_dtmf_2
97686-
event: '#'
9768797653
LiveTransportRinging:
9768897654
description: The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband observers.
9768997655
example:
@@ -97831,6 +97797,7 @@ components:
9783197797
- $ref: '#/components/schemas/LiveInfoEvent'
9783297798
- $ref: '#/components/schemas/LiveTransportDTMFReceived'
9783397799
- $ref: '#/components/schemas/LiveTransportDTMFSend'
97800+
- $ref: '#/components/schemas/LiveTransportDTMFSent'
9783497801
- $ref: '#/components/schemas/LiveTransportRinging'
9783597802
- $ref: '#/components/schemas/LiveTransportAnswered'
9783697803
- $ref: '#/components/schemas/LiveTransportFailed'
@@ -111027,6 +110994,73 @@ components:
111027110994
type: object
111028110995
required:
111029110996
- status
110997+
LiveTransportDTMFSendParam:
110998+
description: Send one DTMF keypress to the SIP trunk through a Live sideband connection. This command is supported only for SIP calls. A successful send emits `transport.dtmf.sent` on sideband. If you provide `event_id`, the success notification includes it as `client_event_id`; a failure includes it as `error.client_event_id`. Send separate events for multiple keypresses.
110999+
example:
111000+
type: transport.dtmf.send
111001+
event_id: evt_dtmf_001
111002+
event: '#'
111003+
type: object
111004+
properties:
111005+
event_id:
111006+
anyOf:
111007+
- description: Optional client identifier for correlating this command with a server event's client_event_id or error.client_event_id.
111008+
type: string
111009+
maxLength: 512
111010+
- type: 'null'
111011+
type:
111012+
default: transport.dtmf.send
111013+
x-stainless-const: true
111014+
type: string
111015+
enum:
111016+
- transport.dtmf.send
111017+
event:
111018+
description: 'The DTMF key to send: one of `0`–`9`, `A`–`D`, `*`, or `#`.'
111019+
type: string
111020+
minLength: 1
111021+
maxLength: 1
111022+
pattern: ^[0-9A-D*#]$
111023+
required:
111024+
- type
111025+
- event
111026+
x-oaiMeta:
111027+
example:
111028+
type: transport.dtmf.send
111029+
event_id: evt_dtmf_001
111030+
event: '#'
111031+
LiveTransportDTMFSent:
111032+
description: A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command.
111033+
example:
111034+
type: transport.dtmf.sent
111035+
event_id: event_dtmf_2
111036+
event: '#'
111037+
type: object
111038+
properties:
111039+
type:
111040+
default: transport.dtmf.sent
111041+
x-stainless-const: true
111042+
type: string
111043+
enum:
111044+
- transport.dtmf.sent
111045+
event_id:
111046+
type: string
111047+
event:
111048+
type: string
111049+
minLength: 1
111050+
maxLength: 1
111051+
pattern: ^[0-9A-D*#]$
111052+
client_event_id:
111053+
description: The event_id of the client command, when supplied.
111054+
type: string
111055+
required:
111056+
- type
111057+
- event_id
111058+
- event
111059+
x-oaiMeta:
111060+
example:
111061+
type: transport.dtmf.sent
111062+
event_id: event_dtmf_2
111063+
event: '#'
111030111064
SessionSpendControlResource:
111031111065
type: object
111032111066
properties:
@@ -111813,6 +111847,42 @@ components:
111813111847
- completed
111814111848
- incomplete
111815111849
- expired
111850+
CodeInterpreterContainerAuto:
111851+
properties:
111852+
type:
111853+
type: string
111854+
enum:
111855+
- auto
111856+
description: Always `auto`.
111857+
default: auto
111858+
x-stainless-const: true
111859+
file_ids:
111860+
items:
111861+
type: string
111862+
example: file-123
111863+
type: array
111864+
maxItems: 50
111865+
description: An optional list of uploaded files to make available to your code.
111866+
memory_limit:
111867+
anyOf:
111868+
- $ref: '#/components/schemas/ContainerMemoryLimit'
111869+
description: The memory limit for the code interpreter container.
111870+
- type: 'null'
111871+
network_policy:
111872+
discriminator:
111873+
propertyName: type
111874+
description: Network access policy for the container.
111875+
anyOf:
111876+
- $ref: '#/components/schemas/ContainerNetworkPolicyDisabledParam'
111877+
- $ref: '#/components/schemas/ContainerNetworkPolicyAllowlistParam'
111878+
type: object
111879+
required:
111880+
- type
111881+
title: CodeInterpreterToolAuto
111882+
description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
111883+
x-stainless-naming:
111884+
go:
111885+
type_name: ToolCodeInterpreterContainerCodeInterpreterContainerAuto
111816111886
LiveFunctionToolChoiceParam:
111817111887
type: object
111818111888
properties:

‎scripts/castiron/generated-files.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@
571571
},
572572
"src/openai/resources/live/sideband.py": {
573573
"mode": "100644",
574-
"sha256": "4ed10b89fadd3aff1e3226cd7e0db9e1463ef834ce3d2c1e437618c7292cbd20"
574+
"sha256": "9f780c2c96066d0f2a70f48b5c7f4f610900a1d07371c7b19fd0a7b787e79120"
575575
},
576576
"src/openai/resources/models.py": {
577577
"mode": "100644",
@@ -4635,15 +4635,15 @@
46354635
},
46364636
"src/openai/types/live/connect_client_event.py": {
46374637
"mode": "100644",
4638-
"sha256": "bc941c81d969470e47b82605313ca6beff3d40bf152eabe7ba0b6e6649cf2afa"
4638+
"sha256": "3dafdbb32c5765eaa39a1473d56f1b5113b2af596feac4fb4332b5632c5332fc"
46394639
},
46404640
"src/openai/types/live/connect_client_event_param.py": {
46414641
"mode": "100644",
4642-
"sha256": "b8f84462deda4beb537beb4f8dcf18a1be3bc842bc1679adb9d4fc66e1b8b18b"
4642+
"sha256": "348e243ff821cf55dd0c1a5f04aa5c83ee12221b033913314c7c25ffb47101da"
46434643
},
46444644
"src/openai/types/live/connect_server_event.py": {
46454645
"mode": "100644",
4646-
"sha256": "f1762b5ae9f57faaf5bc12d24497b6736a454d9c9b0a92bea8556ec5e191c948"
4646+
"sha256": "0ea5b662cd3893671b1ed1f89cc49852a8db23a4591ef6694a5a789e8aa253ed"
46474647
},
46484648
"src/openai/types/live/custom_voice.py": {
46494649
"mode": "100644",
@@ -4823,7 +4823,7 @@
48234823
},
48244824
"src/openai/types/live/fork_server_event.py": {
48254825
"mode": "100644",
4826-
"sha256": "a908fc4ff11c69feb00f2e5bdd57ec4af95fd5c7bbdf02a8dbf8b566257ae837"
4826+
"sha256": "e7b6e1523075c44d6a39125cbec89984be35a60c3b314f521768bca68f92caae"
48274827
},
48284828
"src/openai/types/live/fork_session_config.py": {
48294829
"mode": "100644",
@@ -4987,7 +4987,7 @@
49874987
},
49884988
"src/openai/types/live/server_event.py": {
49894989
"mode": "100644",
4990-
"sha256": "ab64c366facea5dd4ba3e487fc09227bb806401fee45d0512156507695f20feb"
4990+
"sha256": "6b7bbf4ebd0cafdccda1532cf059e9c6a4be2ea3c4fde83c2c3c3d30ab37ae2b"
49914991
},
49924992
"src/openai/types/live/server_event_selector.py": {
49934993
"mode": "100644",

0 commit comments

Comments
 (0)