Beginnings of telephony schemas

This commit is contained in:
Tony Garnock-Jones 2021-12-16 20:31:41 +01:00
parent 425c1770a1
commit e178be32c8
4 changed files with 51 additions and 2 deletions

View File

@ -4,5 +4,5 @@ clean:
rm -f schema-bundle.bin
schema-bundle.bin: schemas/*.prs
preserves-schemac schemas/*.prs > $@.tmp
preserves-schemac schemas > $@.tmp
mv $@.tmp $@

View File

@ -1 +1,7 @@
´³bundle·µ³usersAndGroups„´³schema·³version³ definitions·³Spec´³orµµ± userAccount´³lit³user„„µ± systemAccount´³lit³system„„µ±id´³atom³ SignedInteger„„„„³Group´³rec´³lit³grent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³name´³named³name´³atom³String„„„„„„„³Account´³rec´³lit³pwent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³uid´³named³uid´³atom³ SignedInteger„„³home´³named³home´³atom³String„„³info´³named³info´³atom³String„„³name´³named³name´³atom³String„„³shell´³named³shell´³atom³String„„„„„„„³ EnsureGroup´³rec´³lit³ ensure-group„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„³ GroupMember´³rec´³lit³ group-member„´³tupleµ´³named³uid´³atom³ SignedInteger„„´³named³gid´³atom³ SignedInteger„„„„„³ EnsureAccount´³rec´³lit³ensure-account„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„„³ embeddedType€„„„„
´³bundle·µ³hayes„´³schema·³version³ definitions·³Result´³rec´³lit³result„´³tupleµ´³named³text´³atom³String„„´³named³tag´³refµ„³ MaybeString„„´³named³fields´³refµ„³ MaybeStrings„„„„„³CallType´³orµµ±voice´³lit³voice„„µ±data´³lit³data„„µ±fax´³lit³fax„„„„³ CallState´³orµµ±hold´³lit³hold„„µ±original´³lit³original„„µ±connect´³lit³connect„„µ±incoming´³lit³incoming„„µ±waiting´³lit³waiting„„µ±end´³lit³end„„µ±alerting´³lit³alerting„„„„³
ActiveCall´³rec´³lit³
call-state„´³tupleµ´³named³callId´³atom³ SignedInteger„„´³named³ direction´³refµ„³ CallDirection„„´³named³type´³refµ„³CallType„„´³named³peer´³atom³String„„´³named³peerNumberType´³refµ„³
NumberType„„´³named³state´³refµ„³ CallState„„„„„³
AnswerCall´³rec´³lit³ answer-call„´³tupleµ´³named³callId´³atom³ SignedInteger„„„„„³
NumberType´³orµµ±unknown´³lit³unknown„„µ± international´³lit³ international„„µ±national´³lit³national„„„„³ MaybeString´³orµµ±present´³atom³String„„µ±absent´³lit€„„„„³ MaybeStrings´³orµµ±present´³seqof´³atom³String„„„µ±absent´³lit€„„„„³ ModemPresent´³rec´³lit³modem„´³tupleµ´³named³
devicePath´³atom³String„„´³named³ dataspace´³embedded´³refµ„³InternalProtocol„„„„„„³ CallDirection´³orµµ±mo´³lit³mo„„µ±mt´³lit³mt„„„„³ CommandResult´³rec´³lit³command-result„´³tupleµ´³named³ commandText´³atom³String„„´³named³results´³seqof´³refµ„³Result„„„´³named³ finalResult´³atom³String„„„„„³DisconnectCall´³rec´³lit³disconnect-call„´³tupleµ´³named³callId´³atom³ SignedInteger„„„„„³ExecuteCommand´³rec´³lit³execute-command„´³tupleµ´³named³ commandText´³atom³String„„´³named³replyTo´³embedded´³refµ„³ CommandResult„„„„„„³InternalProtocol³any³UnsolicitedResultCode´³rec´³lit³ unsolicited„´³tupleµ´³named³result´³refµ„³Result„„„„„„³ embeddedType€„„µ³ telephony„´³schema·³version³ definitions·„³ embeddedType€„„µ³usersAndGroups„´³schema·³version³ definitions·³Spec´³orµµ± userAccount´³lit³user„„µ± systemAccount´³lit³system„„µ±id´³atom³ SignedInteger„„„„³Group´³rec´³lit³grent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³name´³named³name´³atom³String„„„„„„„³Account´³rec´³lit³pwent„´³tupleµ´³dict·³gid´³named³gid´³atom³ SignedInteger„„³uid´³named³uid´³atom³ SignedInteger„„³home´³named³home´³atom³String„„³info´³named³info´³atom³String„„³name´³named³name´³atom³String„„³shell´³named³shell´³atom³String„„„„„„„³ EnsureGroup´³rec´³lit³ ensure-group„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„³ GroupMember´³rec´³lit³ group-member„´³tupleµ´³named³uid´³atom³ SignedInteger„„´³named³gid´³atom³ SignedInteger„„„„„³ EnsureAccount´³rec´³lit³ensure-account„´³tupleµ´³named³name´³atom³String„„´³named³spec´³refµ„³Spec„„„„„„³ embeddedType€„„„„

View File

@ -0,0 +1,41 @@
version 1 .
; Definitions for the internal workings of the Hayes modem driver.
; Assertion. Declares presence of a modem.
ModemPresent = <modem @devicePath string @dataspace #!InternalProtocol> .
; TODO not yet properly specified
InternalProtocol = any .
; Message. Sent when the modem sends us a "URC", an Unsolicited Result Code.
UnsolicitedResultCode = <unsolicited @result Result> .
; Assertion. Asks the modem to execute the given command.
ExecuteCommand = <execute-command @commandText string @replyTo #!CommandResult> .
; Assertion. Describes the result of a command execution.
CommandResult = <command-result @commandText string @results [Result ...] @finalResult string> .
@<examples [
<unsolicited <result "NO CARRIER" #f #f>>
<unsolicited <result "+CRING: VOICE" "CRING" ["VOICE"]>>
<unsolicited <result "+CLIP: \"+31655555555\",145,,,,0" "CLIP" ["+31655555555" "145" "" "" "" "0"]>>
<unsolicited <result "^DSCI: 2,1,4,0,+31655555555,145" "DSCI" ["2" "1" "4" "0" "+31655555555" "145"]>>
<unsolicited <result "+QIND: \"csq\",12,99" "QIND" ["csq" "12" "99"]>>
]>
Result = <result @text string @tag MaybeString @fields MaybeStrings> .
MaybeString = @present string / @absent #f .
MaybeStrings = @present [string ...] / @absent #f .
; Assertion. Describes an ongoing call.
ActiveCall = <call-state @callId int @direction CallDirection @type CallType @peer string @peerNumberType NumberType @state CallState> .
CallDirection = =mo / =mt .
CallType = =voice / =data / =fax .
NumberType = =unknown / =international / =national .
CallState = =hold / =original / =connect / =incoming / =waiting / =end / =alerting .
; Message. Triggers call answering.
AnswerCall = <answer-call @callId int> .
; Message. Triggers call rejection or disconnection.
DisconnectCall = <disconnect-call @callId int> .

View File

@ -0,0 +1,2 @@
version 1 .