Every command sent by the calling agent or gateway, whether successful or not, requires a response code. The response code is in the header of the response message, and optionally is followed by session description information.
The response header is composed of a response line, followed by zero or more parameter lines, each containing a parameter name letter followed by its value. The response header is composed of a three-digit response code, transaction ID, and optionally followed by commentary. The response header in the following response message shows the response code 200 (successful completion), followed by ID 1204 and the comment:OK.
- 200 1204 OK
- I: FDE234C8
- v=0
- o=- 25678 753849 IN IP4 128.96.41.1
- s=-
- c=IN IP4 128.96.41.1
- t=0 0
- m=audio 3456 RTP/AVP 96
- a=rtpmap:96 G726-32/8000
The ranges of response codes are defined as follows:
Refer to RFC 3661 for detailed information about response codes.
A response to a command is sent to the source address of the command, not to the current notified entity. A media gateway can receive MGCP commands from various network addresses simultaneously, and send back responses to corresponding network addresses. However, it sends all MGCP commands to its current notified entity.