480 likes | 490 Views
This article summarizes a talk by Wei-Kuo Chiang on Internet Telecom protocols H.323, SIP, and MGCP, focusing on MEGACO, SS7, and PSTN networks. It discusses protocol features, connection models, and command naming in detail.
E N D
MEGACO Protocol Modified from the talk by Wei-Kuo Chiang (江為國) Internet Telecom. Dept. (K200) CCL/ITRI wkchiang@itri.org.tw 1
H323, SIP & MGCP, MEGACO SS7 CA PSTN SG MGCP TGW RGW GK GW TN CO GK GW TN PSTN H.323 RTP MCU TN TN MCU TN TN CA : Call Agent TGW : Trunking Gateway RGW : Residential Gateway SG : Singling Gateway GW : Gateway GK : Gatekeeper TN : Terminal MCU : Multipoint Control Unit 2
H323, SIP & MGCP, MEGACO • H.323, SIP • peer-to-peer • internet oriented • intelligent endpoint • optional GK • decentralized • Problems • maintenance • cost & scalability of large systems • signaling & media control are coupled • interoperability with SS7 • MGCP, MEGACO • client-server • traditional telephony • intelligent server • “dumb” terminal • “stateless” terminal • centralized • Concept • gateway decomposed • separate call control from media ports • CA, MG, SG • interoperability with PSTN 3
MEGACO Features • Media Gateway Control Protocol • Change of Connection Model • Concept of Context • Change of Command Naming • Comparison of Commands • MEGACO Transaction & Descriptor • Call Flows: RGW to RGW 4
MEGACO Connection Model MGCP MEGACO 1 Endpoint Termination 2 Connection Context 3 Call Agent (CA) Media Gateway Controller (MGC) 5
TransactionRequest • Consists of a number of commands • Usually requested by an MGC • TransacionReply • A number of responses • Text encoding and binary encoding • Augmented Backus-Naur Form, RFC 2234 • Abstract Syntax Notation One (ASN.1), ITU-T R X.680 6
MEGACO Connection Model • Termination • A logical entity on a MG • that sources / sinks media / control streams • Two kinds of Termination • Physical Interface • RTP stream (ephemeral termination) • Add/subtraction command • CreateConnection and DeleteConnection 7
The properties of a termination • Grouped into a set of descriptors • Are included in MEGACO commands • Can be changed • Wild cards • *, all ; $, any • Termination ID • an arbitrary string assigned by the MG • at the time of their creation • Root Termination • the entire MG itself 8
MEGACO Connection Model • Context • An association between a collection of terminations • Added to, removed from, moved from one to another • A termination can exist in only one context at any time • describe the topology (who hears/sees whom) • refer to Topology Descriptor • Context ID • a 32-bit integer chosen by the MG • : ALL ; - : NULL; $ : Choosing one • Null Context • Containing all terminations that are not associated to any other termination 9
MEGACO Connection Model • Media Flow • Topology of a Context • describe the media flow between • Terminations within a Context • refer to Topology Descriptor • Mode of a Termination • describe the media flow at the ingress/egress of the media gateway • refer to Media Descriptor Stream Descriptor Local Control Descriptor (receive-only, send/receive, …) Context SCN 1 RTP SCN 2 Contexts in GW SCN 1 RTP SCN 1 11
Termination RTP Stream Termination SCN Channel Concept of Context MGC MGCP MEGACO CA MEGACO MGCP MG MG RGW RGW RTP RTP Context IP Endpoint Endpoint IP Connection established after CRCX Add 2 Terminations into 1 context 12
MEGACO Transactions • The passing of commands and the responses • Commands are directed towards terminations within contexts • ContextID + TerminationIDs • Multiple commands can be grouped • TransactionRequest (TransactionID { ContextID1 {Command, Command, … Command}, ContextID2 {Command, Command, … Command}, ContextID3 {Command, Command, … Command} } ) • TransactionReplay (TransactionID { ContextID1 {Response, Response, … Response}, ContextID2 {Response, Response, … Response}, ContextID3 {Response, Response, … Response} } ) 13
Commands are executed in sequence • If a command fails, the subsequent commands are not processed • Not the case for optional commands • O-”command-name” • An interim reply • TransactionPending (TransactionID {} ) • Messages • Concatenate multiple transactions • The transactions are treated independently 14
MEGACO Transactions MGC to MG1: MEGACO/1 [123.123.123.41]:5555 Transaction = 10003 { Context = $ { Add = A4444, Add = $ { Media { Stream = 1 { LocalControl { …} Local { v=0 c=IN IP4 $ m= audio $ RTP/AVP 4 …} }}}}} Transaction Action 1 for One Context Command 1 Command 2 Command 3 Action 2 for the Other Context Command 1 Action 3 for Another Context Command 1 Command 2 15
MEGACO Command Naming MEGACO Similar Commands in MGCP (1) Add (Termination to Context) (1) CreateConnection (Endpoint) (2) Modify (Termination-descriptor) (2) ModifyConnection (Endpoint) (3) Subtract (Termination) (3) DeleteConnection (Endpoint) (4) Move (Termination) CreateConnection + DeleteConnection (5) AuditValue (Termination) (4) AuditEndpoint (6) AuditCapability (Termination) (NONE) (7) Notify (Termination) (5) Notify (Endpoint) (8) ServiceChange (Termination) (6) RestartInProgress (Endpoint) (NONE) (7) AuditConnection Add, Modify, Move (8) NotificationRequest (Endpoint) Add, Modify, Move (9) EndpointConfiguration (Endpoint-encode) 16
MEGACO Commands • Add • Adds a termination to a context • Modify • Change the property values of a termination • E.g., to issue signals or to detect specific events • Subtract • Remove a termination from a context • The response provides statistics 17
Move • From one context to another • Cannot be moved to the null context • AuditValue • Retrieve current values for properties, events, and signals • AuditCapabilities • Retrieve the possible values of properties, signals, and events 18
Notify • Inform the MGC of events that have occurred • Accompanied by a RequestID • ServiceChange • Inform an MGC that a group of termination will be taken out of service or will resume service 19
Descriptors • For use with commands and responses • To qualify a given command/response • Mandatory, forbidden or optional • Descriptorname=<someID>{parm=value, …} • Parameters can be fully specified, • under specified; the use of $, • over specified; a list of acceptable parameter value in order of preference 20
Termination Descriptors Media Descriptors Modem Descriptors MUX Descriptors Events Descriptors Signals Descriptors Digit Map Descriptors Audit Dsp (unused in Reply) Service Change Descriptors ---------------------------- Observed Events Descriptors Event Buffer Descriptors Statistics Descriptors Package Descriptors Transaction Action 1 for One Context Topology Descriptor Command 1 Command 2 Command 3 Action 3 for Another Context Command 1 Command 2 21
Modem Descriptor • Modem type and associated parameters • By default, a termination does not have a modem descriptor • They may be applied later in an Add or Modify • Multiplex Descriptor • Multimedia communications; different media streams on different channel channels • The association between media streams and bearers 22
Media Descriptors • Describes the various media streams • Hierarchical • Media Descriptor • Termination State Descriptor • Stream Descriptor • Local Control Descriptor • Local Descriptor • Remote Descriptor 23
Termination State Descriptor • ServiceStates • “test,” “out-of-service,” or “in service” • EventBufferControl • Off, the termination reports detected events immediately • Lockstep, the events will be buffered in a FIFO buffer, time-stamped • Examined upon receipt of a new Events Descriptor • Or when the control is set off 24
Stream Descriptor • A stream is created by specifying a new StreamID on a particular termination in a context • A stream is deleted by setting empty Local and Remote Descriptors and by setting ReserveGroup and ReserveValue in LocalControl descriptor to “false” • Local Control Descriptor • Mode, ReserveGroup, and ReserveValue Properties • Mode: sendonly, receiveonly, sendreceive, inactive, and loopback • Send and receive directions are w.r.t. the exterior of a context • MGC specifies a set of choices for the session • ReserveGroup and ReserveValue indicate the resources should be reserved 25
Local Descriptor and Remote Descriptor • Zero or more SDP sessions descriptions • It’s permissible to indicate several alternatives for a parameters • Events Descriptor • A RequestIdentifier and a list of events • Off-hook, fax-tone, etc. • EventControlBuffer property • Signal Descriptor • A list of signals that a termination is to apply • To just a single stream or to all streams 26
Three type of signals • On/off: remains on until it is turned off • Timeout • Brief: only for a limited time • Audit Descriptor • A list of information to be returned from an MG to an MGC • A list of other descriptors such as • Modem, Multiplex, Events, Signals, ObserveEvents, DigitMap, Statistics, Packages, and Eventbuffer 27
Service Change Descriptor • Used only in association with the ServiceChange command • The type of service change, • ServiceChangeMethod • Graceful, the removal of existing terminations w/o interrupting existing connections • Forced, an abrupt removal • Restart, after a specified delay • Disconnected, applied to the entire MG • Handoff, from the old MGC; a new MGC is taking over • or Failover, from MG to MGC • ServiceChangeDelay, a number of seconds • SericeChangeReason, Table 6-4, page 279. • and a new address 28
DigitMap Descriptor • A dialing plan • A string or a list of strings • [0-9] and [A-K] • x: a wild card • .: zero of more repetitions of the immediately proceeding digit • A start timer, to start • A short timer, when more digits are needed • A long timer, to differentiate different routing • (0|00|[1-7]xxx|8xxxxxxx|Fxxxxxxx|Exx|91xxxxxxxxxx|9011x.) • The timers are applied by default 29
Statistics Descriptor • Statistical information regarding the usage of a termination • For the response of a Subtract command • In response to the AuditValue command • Observed Events Descriptor • Mandatory in the Notify command • RequestIdentifier • Optional time-stamp for each observed event • yyyymmddThhmmssss • For the response of a ServiceChange command • In a response to the AuditValue command • Events stored in the event buffer 30
Topology Descriptor • Relevant to a context only • How media streams should flow within a context • By default, all terminations in a context can send and receive media to and from each other • Isolate, oneway and bothway • A useful tool for implementing services such as call waiting 31
Context Descriptors Context 1 Context 2 Context 3 Transaction T2 T2 T2 Action 1 for One Context Topology Descriptor Command 1 Command 2 T1 T3 T1 T3 T1 T3 1. No topology descriptor 2. T1, T2 isolate 3. T3, T2 oneway Context 4 Context 5 Context 6 T2 T2 T2 Action 3 for Another Context Command 1 T1 T3 T1 T3 T1 T3 4. T2, T3 oneway 5. T2, T3 bothway 6. T1, T2 bothway 32
Packages • Groups of properties, signals, events and statistics • For different types of terminations • Items are defined and given identifiers • Tone Detection Package, DTMF Generator Package, Analog Line Supervision Package, … • Package Descriptor • Provides the MGC with a list of the packages implemented in a termination 33
MEGAO Command and Response • Command Syntax MEGACO/1 [111.111.222.222]:3456 Transaction = 12345 { Context = - { Modify = * { Events = 7777 {al/of}, DigitMap = Map1 { (0|00|[1-7]xxx|8xxxxxxx|Fxxxxxxx|Exxx|9011x.)} } } } 34
Response Syntax MEGACO/1 {111.111.333.333]:5678 Reply = 12345 { context = - { Modify = * } } Reply = 12345 { context = - { Modify = * { Error = 500 {Internal Gateway Error} }}} 35
Call Setup Using MEGACO • pp. 290-294 36
Based on Detected Events • pp. 295- 37
Call Flow: RGW to RGW 123.123.123.4 MGC 124.124.124.222 125.125.125.5 3 1 4 2 RGW RGW Internet A5555 A4444 NULL Context NULL Context 1.(3) ServiceChange(ROOT): MG register with MGC 2.(4) Modify(A4444): MGC set Mode(SendReceive) & Events(al/of) 39
Call Flow: RGW to RGW 123.123.123.4 MGC 124.124.124.222 125.125.125.5 5 6 RGW RGW Internet A5555 A4444 NULL Context NULL Context DTMF detection/ Digit Map Complete Event 5. Notify(A4444): MG report an off hook event(time) 6. Modify(A4444): MGC set Events(al/on, dd/ce, {DigitMap = Dialplan0}) Signals(cg/dt) DigitMap = Dialplan0{…} Call Progress Tone Generator/Dial Tone 40
Call Flow: RGW to RGW 123.123.123.4 MGC 124.124.124.222 125.125.125.5 7 8 RGW RGW Internet A5555 A4444 A4445 Full Match Context ID = 2000 Digit String 7. Notify(A4444): MG report a Digit Map Complete event(ds=916135551212,Meth=FM) 8. Add(A4444,$:Mode(ReceiveOnly), Local(RTP)) 41
Call Flow: RGW to RGW 123.123.123.4 MGC 124.124.124.222 125.125.125.5 9 10 RGW RGW Internet A5555 A5556 A4444 A4445 Context ID = 5003 Context ID = 2000 9. Add(A5555: Mode(SendReceive), Events(al/of), Signals(al/ri), $: Mode(SendReceive), Local(RTP), Remote(...)) 10. Modify(A4444: Signals(cg/rt)); Modify(A4445: Remote(…)) 42
Call Flow: RGW to RGW 123.123.123.4 MGC 124.124.124.222 125.125.125.5 12 11 13 RGW RGW Internet A5555 A5556 A4444 A4445 Context ID = 5003 Context ID = 2000 11. Notify(A5555: Observed(al/of)) 12. Modify(A5555: Events(al/on), Signals()); to turn off ringing 13. Modify(A4445: Mode(SendReceive)); Modify(A4444: Signals()) 43
Mobile-initiated Hold and Resume of a Mobile-PSTN Session 48