smalltalk
/
osmo-st-mgcp
Archived
1
0
Fork 0

callagent: Add commands for CRCX/DLCX/MDCX

This commit is contained in:
Holger Hans Peter Freyther 2011-06-10 13:13:11 +02:00
parent 2a8efb434d
commit 21b2634a56
1 changed files with 48 additions and 23 deletions

View File

@ -23,29 +23,6 @@ Object subclass: MGCPCommand [
certain things. E.g. the endpoint numbering is different'>
<category: 'MGCP-callagent'>
MGCPCommand class >> createCRCX: anEndpoint callId: aCallId transId: aTransId [
<category: 'factory'>
"I create a CRCX command for the given endpoint."
^ (self new)
initialize;
verb: 'CRCX';
transactionId: aTransId;
endpoint: (self endpointNumberToName: anEndpoint);
parameterAdd: 'M: recvonly';
parameterAdd: 'C: ', aCallId asString;
yourself
]
MGCPCommand class >> endpointNumberToName: aNumber [
| hex |
<category: 'format'>
<comment: 'The IPA MGW assumes endpoint numbers in hex, lowercase'>
hex := ((aNumber radix: 16) copyFrom: 4) asLowercase.
^ hex, '@mgw'
]
verb: aVerb [
<category: 'private'>
verb := aVerb.
@ -114,3 +91,51 @@ Object subclass: MGCPCommand [
^ out contents
]
]
MGCPCommand subclass: MGCPCRCXCommand [
<comment: 'I represent a CRCX message'>
<category: 'MGCP-callagent'>
MGCPCRCXCommand class >> createCRCX: anEndpoint callId: aCallId transId: aTransId [
<category: 'factory'>
"I create a CRCX command for the given endpoint."
^ (self new)
verb: 'CRCX';
transactionId: aTransId;
endpoint: anEndpoint;
parameterAdd: 'M: recvonly';
parameterAdd: 'C: ', aCallId asString;
yourself
]
]
MGCPCommand subclass: MGCPMDCXCommand [
<comment: 'I represent a MDCX message'>
<category: 'MGCP-Callagent'>
MGCPMDCXCommand class >> createMDCX: anEndpoint callId: aCallId transId: aTransId [
<category: 'factory'>
^ (self new)
verb: 'MDCX';
transactionId: aTransId;
endpoint: anEndpoint;
parameterAdd: 'C: ', aCallId asString;
yourself
]
]
MGCPCommand subclass: MGCPDLCXCommand [
<comment: 'I represent a DLCX message'>
<category: 'MGCP-Callagent'>
MGCPDLCXCommand class >> createDLCX: anEndpoint callId: aCallId transId: aTransId [
^ (self new)
verb: 'DLCX';
transactionId: aTransId;
endpoint: anEndpoint;
parameterAdd: 'C: ', aCallId asString;
yourself
]
]