osmo-msc/openbsc/include/openbsc/mgcp.h

71 lines
2.2 KiB
C
Raw Normal View History

[mgcp] Add a simple mgcp gateway used for the BSC The python script is a simple call-agent driving the client. Currently it is sending a AuditEndpoint message and is printing the result. The bsc_mgcp.c is a standalone process that will implement a MGCP Gateway for the MSC. On call handling the Call-Agent will ask the Gateway to "CreateConnection" and then this gateway needs to communicate with OpenBSC. Currently CreateConnection,ModifiyConnection,DeleteConnection and Endpoint auditing is implemented. [mgcp] Send RSIP on start and on first receive of any message Ignore the first request and send a RSIP. We do that because we might tunnel UDP through some other things and have no direct way to connect to the call-agent. Also the transaction is not checked and we ignore the response from the call-agent, actually we print the '200 ' or any other value as unhandled... [mgcp] Print the MGCP command next to the response code This allows to see which commands were sent by the server mgcp: Terminate it with a new line [mgcp] Make number of endpoints static... For now this is fixed to the number of endpoints as of the GSM specification... [mgcp] The endpoint names seem to be base 16... use strtoul to parse Use strtoul to parse the base 16 number from the mgw string. [mgcp] Log the endpoints as hex numbers... [mgcp] Only send the RSIP on the first incoming message.. Remove call_agent option (also remove the number from the getopt call). [mgcp] Start couting at 1 for the mgcp [mgcp] Slight attempt to improve the grammar of the strings [mgcp] Share validation routines between DLCX and MDCX [mgcp] Remove help for dead config options [mgcp] Specify a different IN addr in the SDP records In case of NAT traversal be able to listen on a given interface (like 127.0.0.1) but claim to receive data at the beginning of the tunnel. [mgcp] Fix the static copy of the SDP file WIP verify out factoring broken.. [mgcp] Introduce VTY to the mgcp for config file parsing... Parse the MGCP config file via the VTY framework. [mgcp] Handle SDP parameters through VTY.. Currently the payload type, name and rate can be specified in the config file. [mgcp] Add an option to bind all rtp ports early This can be useful for testing and in deployment to make sure no runtime resource limit can be hit. [mgcp] Add some API doc comment [mgcp] Convert the packets of the example server to ascii This will allow to easily patch the call id... to run the server in a loop and make it work with the mediagateway [mgcp] Assign CI_UNUSED... to be more obvious... [mgcp] Use DEBUG and not DEBUGPC and specially not printf Improve the logging a bit in the mgcp [mgcp] Change the fake server to change the call id This assume the call-agent will just increment the id as well.... this is true for our implementation [mgcp] Generate the transaction id dynamically.. This way wireshark will be more happy about it... [mgcp] Recognize responses from the network.. This is just recognizing the response code and then is doing nothing with it. Also change the script to generate response messages... [mgcp] Improve debug messages for CRCX/MDCX.. Log on which ports the media gateway is listening and where the other (server) gateway is located
2009-10-09 05:08:11 +00:00
/* A Media Gateway Control Protocol Media Gateway: RFC 3435 */
/*
* (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
* (C) 2009 by On-Waves
[mgcp] Add a simple mgcp gateway used for the BSC The python script is a simple call-agent driving the client. Currently it is sending a AuditEndpoint message and is printing the result. The bsc_mgcp.c is a standalone process that will implement a MGCP Gateway for the MSC. On call handling the Call-Agent will ask the Gateway to "CreateConnection" and then this gateway needs to communicate with OpenBSC. Currently CreateConnection,ModifiyConnection,DeleteConnection and Endpoint auditing is implemented. [mgcp] Send RSIP on start and on first receive of any message Ignore the first request and send a RSIP. We do that because we might tunnel UDP through some other things and have no direct way to connect to the call-agent. Also the transaction is not checked and we ignore the response from the call-agent, actually we print the '200 ' or any other value as unhandled... [mgcp] Print the MGCP command next to the response code This allows to see which commands were sent by the server mgcp: Terminate it with a new line [mgcp] Make number of endpoints static... For now this is fixed to the number of endpoints as of the GSM specification... [mgcp] The endpoint names seem to be base 16... use strtoul to parse Use strtoul to parse the base 16 number from the mgw string. [mgcp] Log the endpoints as hex numbers... [mgcp] Only send the RSIP on the first incoming message.. Remove call_agent option (also remove the number from the getopt call). [mgcp] Start couting at 1 for the mgcp [mgcp] Slight attempt to improve the grammar of the strings [mgcp] Share validation routines between DLCX and MDCX [mgcp] Remove help for dead config options [mgcp] Specify a different IN addr in the SDP records In case of NAT traversal be able to listen on a given interface (like 127.0.0.1) but claim to receive data at the beginning of the tunnel. [mgcp] Fix the static copy of the SDP file WIP verify out factoring broken.. [mgcp] Introduce VTY to the mgcp for config file parsing... Parse the MGCP config file via the VTY framework. [mgcp] Handle SDP parameters through VTY.. Currently the payload type, name and rate can be specified in the config file. [mgcp] Add an option to bind all rtp ports early This can be useful for testing and in deployment to make sure no runtime resource limit can be hit. [mgcp] Add some API doc comment [mgcp] Convert the packets of the example server to ascii This will allow to easily patch the call id... to run the server in a loop and make it work with the mediagateway [mgcp] Assign CI_UNUSED... to be more obvious... [mgcp] Use DEBUG and not DEBUGPC and specially not printf Improve the logging a bit in the mgcp [mgcp] Change the fake server to change the call id This assume the call-agent will just increment the id as well.... this is true for our implementation [mgcp] Generate the transaction id dynamically.. This way wireshark will be more happy about it... [mgcp] Recognize responses from the network.. This is just recognizing the response code and then is doing nothing with it. Also change the script to generate response messages... [mgcp] Improve debug messages for CRCX/MDCX.. Log on which ports the media gateway is listening and where the other (server) gateway is located
2009-10-09 05:08:11 +00:00
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef OPENBSC_MGCP_H
#define OPENBSC_MGCP_H
#include <osmocore/msgb.h>
#define RTP_PORT_DEFAULT 4000
extern unsigned int rtp_base_port;
[mgcp] Add a simple mgcp gateway used for the BSC The python script is a simple call-agent driving the client. Currently it is sending a AuditEndpoint message and is printing the result. The bsc_mgcp.c is a standalone process that will implement a MGCP Gateway for the MSC. On call handling the Call-Agent will ask the Gateway to "CreateConnection" and then this gateway needs to communicate with OpenBSC. Currently CreateConnection,ModifiyConnection,DeleteConnection and Endpoint auditing is implemented. [mgcp] Send RSIP on start and on first receive of any message Ignore the first request and send a RSIP. We do that because we might tunnel UDP through some other things and have no direct way to connect to the call-agent. Also the transaction is not checked and we ignore the response from the call-agent, actually we print the '200 ' or any other value as unhandled... [mgcp] Print the MGCP command next to the response code This allows to see which commands were sent by the server mgcp: Terminate it with a new line [mgcp] Make number of endpoints static... For now this is fixed to the number of endpoints as of the GSM specification... [mgcp] The endpoint names seem to be base 16... use strtoul to parse Use strtoul to parse the base 16 number from the mgw string. [mgcp] Log the endpoints as hex numbers... [mgcp] Only send the RSIP on the first incoming message.. Remove call_agent option (also remove the number from the getopt call). [mgcp] Start couting at 1 for the mgcp [mgcp] Slight attempt to improve the grammar of the strings [mgcp] Share validation routines between DLCX and MDCX [mgcp] Remove help for dead config options [mgcp] Specify a different IN addr in the SDP records In case of NAT traversal be able to listen on a given interface (like 127.0.0.1) but claim to receive data at the beginning of the tunnel. [mgcp] Fix the static copy of the SDP file WIP verify out factoring broken.. [mgcp] Introduce VTY to the mgcp for config file parsing... Parse the MGCP config file via the VTY framework. [mgcp] Handle SDP parameters through VTY.. Currently the payload type, name and rate can be specified in the config file. [mgcp] Add an option to bind all rtp ports early This can be useful for testing and in deployment to make sure no runtime resource limit can be hit. [mgcp] Add some API doc comment [mgcp] Convert the packets of the example server to ascii This will allow to easily patch the call id... to run the server in a loop and make it work with the mediagateway [mgcp] Assign CI_UNUSED... to be more obvious... [mgcp] Use DEBUG and not DEBUGPC and specially not printf Improve the logging a bit in the mgcp [mgcp] Change the fake server to change the call id This assume the call-agent will just increment the id as well.... this is true for our implementation [mgcp] Generate the transaction id dynamically.. This way wireshark will be more happy about it... [mgcp] Recognize responses from the network.. This is just recognizing the response code and then is doing nothing with it. Also change the script to generate response messages... [mgcp] Improve debug messages for CRCX/MDCX.. Log on which ports the media gateway is listening and where the other (server) gateway is located
2009-10-09 05:08:11 +00:00
/**
* Calculate the RTP audio port for the given multiplex
* and the direction. This allows a semi static endpoint
* to port calculation removing the need for the BSC
* and the MediaGateway to communicate.
*
* Port usage explained:
* base + (multiplex * 2) + 0 == local port to wait for network packets
* base + (multiplex * 2) + 1 == local port for rtcp
*
* The above port will receive packets from the BTS that need
* to be patched and forwarded to the network.
* The above port will receive packets from the network that
* need to be patched and forwarded to the BTS.
*
* We assume to have a static BTS IP address so we can differentiate
* network and BTS.
*
*/
static inline int rtp_calculate_port(int multiplex, int base)
[mgcp] Add a simple mgcp gateway used for the BSC The python script is a simple call-agent driving the client. Currently it is sending a AuditEndpoint message and is printing the result. The bsc_mgcp.c is a standalone process that will implement a MGCP Gateway for the MSC. On call handling the Call-Agent will ask the Gateway to "CreateConnection" and then this gateway needs to communicate with OpenBSC. Currently CreateConnection,ModifiyConnection,DeleteConnection and Endpoint auditing is implemented. [mgcp] Send RSIP on start and on first receive of any message Ignore the first request and send a RSIP. We do that because we might tunnel UDP through some other things and have no direct way to connect to the call-agent. Also the transaction is not checked and we ignore the response from the call-agent, actually we print the '200 ' or any other value as unhandled... [mgcp] Print the MGCP command next to the response code This allows to see which commands were sent by the server mgcp: Terminate it with a new line [mgcp] Make number of endpoints static... For now this is fixed to the number of endpoints as of the GSM specification... [mgcp] The endpoint names seem to be base 16... use strtoul to parse Use strtoul to parse the base 16 number from the mgw string. [mgcp] Log the endpoints as hex numbers... [mgcp] Only send the RSIP on the first incoming message.. Remove call_agent option (also remove the number from the getopt call). [mgcp] Start couting at 1 for the mgcp [mgcp] Slight attempt to improve the grammar of the strings [mgcp] Share validation routines between DLCX and MDCX [mgcp] Remove help for dead config options [mgcp] Specify a different IN addr in the SDP records In case of NAT traversal be able to listen on a given interface (like 127.0.0.1) but claim to receive data at the beginning of the tunnel. [mgcp] Fix the static copy of the SDP file WIP verify out factoring broken.. [mgcp] Introduce VTY to the mgcp for config file parsing... Parse the MGCP config file via the VTY framework. [mgcp] Handle SDP parameters through VTY.. Currently the payload type, name and rate can be specified in the config file. [mgcp] Add an option to bind all rtp ports early This can be useful for testing and in deployment to make sure no runtime resource limit can be hit. [mgcp] Add some API doc comment [mgcp] Convert the packets of the example server to ascii This will allow to easily patch the call id... to run the server in a loop and make it work with the mediagateway [mgcp] Assign CI_UNUSED... to be more obvious... [mgcp] Use DEBUG and not DEBUGPC and specially not printf Improve the logging a bit in the mgcp [mgcp] Change the fake server to change the call id This assume the call-agent will just increment the id as well.... this is true for our implementation [mgcp] Generate the transaction id dynamically.. This way wireshark will be more happy about it... [mgcp] Recognize responses from the network.. This is just recognizing the response code and then is doing nothing with it. Also change the script to generate response messages... [mgcp] Improve debug messages for CRCX/MDCX.. Log on which ports the media gateway is listening and where the other (server) gateway is located
2009-10-09 05:08:11 +00:00
{
return base + (multiplex * 2);
}
int mgcp_parse_config(const char *config_file, struct gsm_network *dummy_network);
struct msgb *mgcp_handle_message(struct msgb *msg);
struct msgb *mgcp_create_rsip(void);
int mgcp_vty_init(void);
/* endpoint managed */
#define MGCP_ENDP_CRCX 1
#define MGCP_ENDP_DLCX 2
#define MGCP_ENDP_MDCX 3
typedef int (*mgcp_change)(int endpoint, int state, int local_rtp, void *);
void mgcp_set_change_cb(mgcp_change cb, void *data);
#endif