MGCP call agent module
From Yate Documentation
(Difference between revisions)
(One intermediate revision by one user not shown) | |||
Line 2: | Line 2: | ||
This module implements the Call Agent part of [http://en.wikipedia.org/wiki/Media_Gateway_Control_Protocol_%28MGCP%29 MGCP] allowing Yate to control analog or digital Media Gateways. | This module implements the Call Agent part of [http://en.wikipedia.org/wiki/Media_Gateway_Control_Protocol_%28MGCP%29 MGCP] allowing Yate to control analog or digital Media Gateways. | ||
− | The resources of these gateways appear as voice circuits so you need to reference them in the [ | + | The resources of these gateways appear as voice circuits so you need to reference them in the [http://docs.yate.ro/wiki/Analog analog] or [[Ysigchan|signaling module]]. |
− | Specific information is available for configuring digital voice trunks for Mediant and Cisco gateways. | + | Specific information is available for configuring digital voice trunks for [[Configure Mediant MGCP|Mediant]] and [[Configure Cisco MGCP|Cisco]] gateways. |
− | ''' | + | ===Configuration file=== |
+ | mgcpca.conf: | ||
+ | |||
+ | [general] | ||
+ | ; This section sets global variables of the MGCP Call Agent module | ||
+ | |||
+ | ; priority: int: Priority of the chan.rtp message handler | ||
+ | ;priority=80 | ||
+ | |||
+ | ; tzoffset: int: Timezone offset from GMT in seconds for sending Caller ID | ||
+ | ; Positive to go East, negative to go West | ||
+ | ; Examples: CET=3600, EST=-18000 | ||
+ | ; This parameter is reloadable | ||
+ | ;tzoffset=0 | ||
+ | |||
+ | [engine] | ||
+ | ; These parameters are used to initialize the MGCP Engine | ||
+ | |||
+ | ; enabled: bool: Enable the MGCP engine | ||
+ | ;enabled=yes | ||
+ | |||
+ | ; address: ipaddress: Local IP address to bind to, default all interfaces | ||
+ | ;address=0.0.0.0 | ||
+ | |||
+ | ; port: int: UDP port to bind, set to zero to use default MGCP CA port (2727) | ||
+ | ;port= | ||
+ | |||
+ | ; request_ack: bool: Request an Acknowledge of the transactions | ||
+ | ;request_ack=yes | ||
+ | |||
+ | ; send_provisional: bool: Send 1xx provisional answers to the requests | ||
+ | ;send_provisional=yes | ||
+ | |||
+ | |||
+ | [endpoint] | ||
+ | ; Settings for the local endpoint | ||
+ | |||
+ | ; user: string: The user part of the local endpoint | ||
+ | ;user=yate | ||
+ | |||
+ | ; host: string: The host part of the local endpoint, default engine's address | ||
+ | ;host= | ||
+ | |||
+ | ; port: int: Declared local port, defaults to engine's port | ||
+ | ;port= | ||
+ | |||
+ | |||
+ | [codecs] | ||
+ | ; This section allows to individually enable or disable the codecs | ||
+ | |||
+ | ; default: bool: Enable all unlisted codecs by default if a transcoder exists | ||
+ | ;default=enable | ||
+ | |||
+ | ; mulaw: bool: Companded-only G711 mu-law (PCMU/8000) | ||
+ | ;mulaw=default | ||
+ | |||
+ | ; alaw: bool: Companded-only G711 a-law (PCMU/8000) | ||
+ | ;alaw=default | ||
+ | |||
+ | ; gsm: bool: European GSM 06.10 (GSM/8000) | ||
+ | ;gsm=default | ||
+ | |||
+ | ; lpc10: bool: Linear Prediction Codec (LPC/8000) | ||
+ | ;lpc10=default | ||
+ | |||
+ | ; ilbc: bool: Internet Low Bandwidth Codec (iLBC/8000) | ||
+ | ;ilbc=default | ||
+ | |||
+ | ; amr: bool: Adaptive Multi-Rate 3GPP (AMR/8000) | ||
+ | ;amr=default | ||
+ | |||
+ | ; slin: bool: Signed Linear 16-bit uncompressed (L16/8000) | ||
+ | ;slin=default | ||
+ | |||
+ | ; g723: bool: ITU G.723 all variations (G723/8000) | ||
+ | ;g723=default | ||
+ | |||
+ | ; g726: bool: ITU G.726 32-bit (G726-32/8000) | ||
+ | ;g726=default | ||
+ | |||
+ | ; g728: bool: ITU G.728 all variations (G728/8000) | ||
+ | ;g728=default | ||
+ | |||
+ | ; g729: bool: ITU G.729 all variations (G729/8000) | ||
+ | ;g729=default | ||
+ | |||
+ | ; g729_annexb: bool: G.729 Annex B (VAD) support default (if not in SDP) | ||
+ | ; NOTE: RFC 3555 specifies the default should be yes | ||
+ | ;g729_annexb=no | ||
+ | |||
+ | ; amr_octet: bool: Octet aligned AMR RTP payload default (if not in SDP) | ||
+ | ; NOTE: RFC 4867 (and older 3267) specifies the default is bandwidth efficient | ||
+ | ;amr_octet=no | ||
+ | |||
+ | [hacks] | ||
+ | ; This section holds the dirty stuff required to work with some broken | ||
+ | ; implementations | ||
+ | ; | ||
+ | ; ilbc_forced: string: Format to force as iLBC, can be: ilbc20 or ilbc30 | ||
+ | ;ilbc_forced= | ||
+ | ; | ||
+ | ; ilbc_default: string: Format to use for iLBC when packetization is unknown | ||
+ | ;ilbc_default=ilbc30 | ||
+ | |||
+ | ; g729_annexb: bool: Force G.729 Annex B support when parsing the SDP | ||
+ | ;g729_annexb= | ||
+ | |||
+ | ; ignore_sdp_port: bool: Ignore SDP changes if only the port is different | ||
+ | ; This allows preserving the local RTP session and port | ||
+ | ;ignore_sdp_port=no | ||
+ | |||
+ | ;[gw PUT_NAME_HERE] | ||
+ | ; One gw ... section is required for each gateway we control | ||
+ | ; The gateway name is a string that can be referenced from other modules | ||
+ | |||
+ | ; user: string: Remote MGCP resource name | ||
+ | ;user= | ||
+ | |||
+ | ; host: ipaddress: IP address or hostname of the gateway, mandatory | ||
+ | ;host= | ||
+ | |||
+ | ; port: int: Remote port to send packets to | ||
+ | ;port=2427 | ||
+ | |||
+ | ; address: ipaddress: IP address of the gateway, if present will override | ||
+ | ; resolving the host name and will immediately make the span operational | ||
+ | ; without waiting for a remote RSIP | ||
+ | ;address= | ||
+ | |||
+ | ; version: string: Protocol name and version to use initially, if left blank | ||
+ | ; will autodetect from first received RSIP, until then uses MGCP 1.0 | ||
+ | ; Depending on remote capabilities and settings it is possible to use the SGCP | ||
+ | ; or TGCP protocols too. | ||
+ | ;version= | ||
+ | |||
+ | ; range: string: Range of gateways to create using this section as a template | ||
+ | ; If range is not empty the "user" setting must contain an asterisk | ||
+ | ; Example for creating aaln1/[1-10], aaln2/[1-10], aaln3/[1-10] and aaln6/[1-10]: | ||
+ | ; user=aaln*/1 | ||
+ | ; chans=10 | ||
+ | ; range=1-3,6 | ||
+ | ;range= | ||
+ | |||
+ | ; cluster: bool: This is the gateway to send remote RTP commands to | ||
+ | ; Do not activate this functionality unless you know very well what it does | ||
+ | ; as it disrupts other based RTP protocols | ||
+ | ;cluster=no | ||
+ | |||
+ | ; voicechans: string: The range of channels used for voice (data) transfer | ||
+ | ; Channel intervals may be specified by separating the margins using the '-' character | ||
+ | ; Individual channels or channel intervals may be separated by '.' | ||
+ | ; Duplicate or not strict positive channel numbers are not allowed | ||
+ | ; If specified the highest circuit number is used as number of PSTN channels | ||
+ | ; E.g. 1-15.17-31 or 1-23 or 1.2.3-15.17.18-30.31 | ||
+ | ;voicechans= | ||
+ | |||
+ | ; chans: int: Number of PSTN circuits to create in span | ||
+ | ; Defaults to 1 or highest voicechan declared | ||
+ | ;chans=1 | ||
+ | |||
+ | ; offset: int: Offset of circuit code relative to start in span | ||
+ | ;offset=0 | ||
+ | |||
+ | ; increment: integer: How much will increment this span the circuit number in | ||
+ | ; the group it belongs to | ||
+ | ; Defaults to 32 if chans is 30 or 31 (E1), 24 if chans is 23 (T1), number of | ||
+ | ; circuits in all other cases | ||
+ | ;increment= | ||
+ | |||
+ | ; clearconn: bool: Clear all connections of remote endpoints when initialized | ||
+ | ;clearconn=no | ||
+ | |||
+ | ; bearer: keyword: Default bearer encoding | ||
+ | ; Allowed values: mulaw, alaw | ||
+ | ; If bearer is set a default encoding is assumed on the circuit side and a | ||
+ | ; B: e:mu or B: e:A line is added only if the circuit data format changes | ||
+ | ; Normally the default bearer is not set so a B: line is added when needed | ||
+ | ;bearer= | ||
+ | |||
+ | ; req_dtmf: keyword: When to request DTMF notification from gateway | ||
+ | ; Allowed values: | ||
+ | ; none - do not request to be notified about DTMF events | ||
+ | ; once - emit RQNT once when connecting the circuit (default) | ||
+ | ; more - emit RQNT on connection and after each notification received | ||
+ | ;req_dtmf=once | ||
+ | |||
+ | ; forward_rtp: bool: Support to forward RTP directly to protocols that support it | ||
+ | ; The actual direct RTP forwarding is still negotiated in routing | ||
+ | ;forward_rtp=yes for digital gateways, no for analogic | ||
+ | |||
+ | ; forward_sdp: bool: Also include the raw SDP in the RTP forward offer | ||
+ | ;forward_sdp=no | ||
− | |||
− | [[ | + | |
+ | ===Examples=== | ||
+ | |||
+ | Configuration for a Mediant MP-114 FXS analog gateway. | ||
+ | |||
+ | mgcpca.conf: | ||
+ | |||
+ | [general] | ||
+ | ; Central European Time, +0100 | ||
+ | tzoffset=3600 | ||
+ | |||
+ | [engine] | ||
+ | request_ack=no | ||
+ | send_provisional=no | ||
+ | |||
+ | [endpoint] | ||
+ | |||
+ | [gw mp114] | ||
+ | host=10.0.0.1 | ||
+ | address=10.0.0.1 | ||
+ | user=ACgw0 | ||
+ | chans=4 | ||
+ | default=no | ||
+ | clearconn=yes | ||
+ | |||
+ | |||
+ | analog.conf: | ||
+ | |||
+ | [mediant] | ||
+ | type=FXS | ||
+ | spans=mp116 | ||
+ | callsetup=before | ||
+ | ringback=yes | ||
+ | |||
+ | |||
+ | regexroute.conf: | ||
+ | |||
+ | [priorities] | ||
+ | prerouteall=yes | ||
+ | |||
+ | [contexts] | ||
+ | ; set caller number depending on line on Mediant | ||
+ | ${address}^mediant/\([0-3]\)$=;caller=18\1 | ||
+ | |||
+ | [default] | ||
+ | ; enable RTP forwarding if supported by caller channel | ||
+ | ${rtp_forward}possible=;rtp_forward=true | ||
+ | ; perform overlapped dial | ||
+ | ^off-hook$=external/nodata/overlapped.php;accept_call=true | ||
+ | ; route 18x to the corresponding port | ||
+ | ^18\([0-3]\)$=analog/mediant/\1 | ||
+ | ; ... | ||
+ | ; If we reached this point and not using overlapped dialing return without route | ||
+ | ${overlapped}yes^=return | ||
+ | ; If number is too long to be possibly valid error out | ||
+ | .\{20\}=-;error=noroute | ||
+ | ; Let the dialer know there may be other routes | ||
+ | .*=;error=incomplete | ||
+ | |||
+ | '''See also''' | ||
+ | |||
+ | * [http://docs.yate.ro/wiki/Analog Analog | Analog module] | ||
+ | * [[Ysigchan|Signaling module]] | ||
+ | * [[Configure Mediant MGCP]] | ||
+ | * [[Configure Cisco MGCP]] |
Latest revision as of 14:20, 26 October 2017
This module implements the Call Agent part of MGCP allowing Yate to control analog or digital Media Gateways.
The resources of these gateways appear as voice circuits so you need to reference them in the analog or signaling module.
Specific information is available for configuring digital voice trunks for Mediant and Cisco gateways.
[edit] Configuration file
mgcpca.conf: [general] ; This section sets global variables of the MGCP Call Agent module ; priority: int: Priority of the chan.rtp message handler ;priority=80 ; tzoffset: int: Timezone offset from GMT in seconds for sending Caller ID ; Positive to go East, negative to go West ; Examples: CET=3600, EST=-18000 ; This parameter is reloadable ;tzoffset=0 [engine] ; These parameters are used to initialize the MGCP Engine ; enabled: bool: Enable the MGCP engine ;enabled=yes ; address: ipaddress: Local IP address to bind to, default all interfaces ;address=0.0.0.0 ; port: int: UDP port to bind, set to zero to use default MGCP CA port (2727) ;port= ; request_ack: bool: Request an Acknowledge of the transactions ;request_ack=yes ; send_provisional: bool: Send 1xx provisional answers to the requests ;send_provisional=yes [endpoint] ; Settings for the local endpoint ; user: string: The user part of the local endpoint ;user=yate ; host: string: The host part of the local endpoint, default engine's address ;host= ; port: int: Declared local port, defaults to engine's port ;port= [codecs] ; This section allows to individually enable or disable the codecs ; default: bool: Enable all unlisted codecs by default if a transcoder exists ;default=enable ; mulaw: bool: Companded-only G711 mu-law (PCMU/8000) ;mulaw=default ; alaw: bool: Companded-only G711 a-law (PCMU/8000) ;alaw=default ; gsm: bool: European GSM 06.10 (GSM/8000) ;gsm=default ; lpc10: bool: Linear Prediction Codec (LPC/8000) ;lpc10=default ; ilbc: bool: Internet Low Bandwidth Codec (iLBC/8000) ;ilbc=default ; amr: bool: Adaptive Multi-Rate 3GPP (AMR/8000) ;amr=default ; slin: bool: Signed Linear 16-bit uncompressed (L16/8000) ;slin=default ; g723: bool: ITU G.723 all variations (G723/8000) ;g723=default ; g726: bool: ITU G.726 32-bit (G726-32/8000) ;g726=default ; g728: bool: ITU G.728 all variations (G728/8000) ;g728=default ; g729: bool: ITU G.729 all variations (G729/8000) ;g729=default ; g729_annexb: bool: G.729 Annex B (VAD) support default (if not in SDP) ; NOTE: RFC 3555 specifies the default should be yes ;g729_annexb=no ; amr_octet: bool: Octet aligned AMR RTP payload default (if not in SDP) ; NOTE: RFC 4867 (and older 3267) specifies the default is bandwidth efficient ;amr_octet=no [hacks] ; This section holds the dirty stuff required to work with some broken ; implementations ; ; ilbc_forced: string: Format to force as iLBC, can be: ilbc20 or ilbc30 ;ilbc_forced= ; ; ilbc_default: string: Format to use for iLBC when packetization is unknown ;ilbc_default=ilbc30 ; g729_annexb: bool: Force G.729 Annex B support when parsing the SDP ;g729_annexb= ; ignore_sdp_port: bool: Ignore SDP changes if only the port is different ; This allows preserving the local RTP session and port ;ignore_sdp_port=no ;[gw PUT_NAME_HERE] ; One gw ... section is required for each gateway we control ; The gateway name is a string that can be referenced from other modules ; user: string: Remote MGCP resource name ;user= ; host: ipaddress: IP address or hostname of the gateway, mandatory ;host= ; port: int: Remote port to send packets to ;port=2427 ; address: ipaddress: IP address of the gateway, if present will override ; resolving the host name and will immediately make the span operational ; without waiting for a remote RSIP ;address= ; version: string: Protocol name and version to use initially, if left blank ; will autodetect from first received RSIP, until then uses MGCP 1.0 ; Depending on remote capabilities and settings it is possible to use the SGCP ; or TGCP protocols too. ;version= ; range: string: Range of gateways to create using this section as a template ; If range is not empty the "user" setting must contain an asterisk ; Example for creating aaln1/[1-10], aaln2/[1-10], aaln3/[1-10] and aaln6/[1-10]: ; user=aaln*/1 ; chans=10 ; range=1-3,6 ;range= ; cluster: bool: This is the gateway to send remote RTP commands to ; Do not activate this functionality unless you know very well what it does ; as it disrupts other based RTP protocols ;cluster=no ; voicechans: string: The range of channels used for voice (data) transfer ; Channel intervals may be specified by separating the margins using the '-' character ; Individual channels or channel intervals may be separated by '.' ; Duplicate or not strict positive channel numbers are not allowed ; If specified the highest circuit number is used as number of PSTN channels ; E.g. 1-15.17-31 or 1-23 or 1.2.3-15.17.18-30.31 ;voicechans= ; chans: int: Number of PSTN circuits to create in span ; Defaults to 1 or highest voicechan declared ;chans=1 ; offset: int: Offset of circuit code relative to start in span ;offset=0 ; increment: integer: How much will increment this span the circuit number in ; the group it belongs to ; Defaults to 32 if chans is 30 or 31 (E1), 24 if chans is 23 (T1), number of ; circuits in all other cases ;increment= ; clearconn: bool: Clear all connections of remote endpoints when initialized ;clearconn=no ; bearer: keyword: Default bearer encoding ; Allowed values: mulaw, alaw ; If bearer is set a default encoding is assumed on the circuit side and a ; B: e:mu or B: e:A line is added only if the circuit data format changes ; Normally the default bearer is not set so a B: line is added when needed ;bearer= ; req_dtmf: keyword: When to request DTMF notification from gateway ; Allowed values: ; none - do not request to be notified about DTMF events ; once - emit RQNT once when connecting the circuit (default) ; more - emit RQNT on connection and after each notification received ;req_dtmf=once ; forward_rtp: bool: Support to forward RTP directly to protocols that support it ; The actual direct RTP forwarding is still negotiated in routing ;forward_rtp=yes for digital gateways, no for analogic ; forward_sdp: bool: Also include the raw SDP in the RTP forward offer ;forward_sdp=no
[edit] Examples
Configuration for a Mediant MP-114 FXS analog gateway.
mgcpca.conf:
[general] ; Central European Time, +0100 tzoffset=3600 [engine] request_ack=no send_provisional=no [endpoint] [gw mp114] host=10.0.0.1 address=10.0.0.1 user=ACgw0 chans=4 default=no clearconn=yes
analog.conf:
[mediant] type=FXS spans=mp116 callsetup=before ringback=yes
regexroute.conf:
[priorities] prerouteall=yes [contexts] ; set caller number depending on line on Mediant ${address}^mediant/\([0-3]\)$=;caller=18\1 [default] ; enable RTP forwarding if supported by caller channel ${rtp_forward}possible=;rtp_forward=true ; perform overlapped dial ^off-hook$=external/nodata/overlapped.php;accept_call=true ; route 18x to the corresponding port ^18\([0-3]\)$=analog/mediant/\1 ; ... ; If we reached this point and not using overlapped dialing return without route ${overlapped}yes^=return ; If number is too long to be possibly valid error out .\{20\}=-;error=noroute ; Let the dialer know there may be other routes .*=;error=incomplete
See also