9
0
Fork 0
Commit Graph

370 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther d93c84f96e misc: Address warnings coming from clang
* Include stdlib.h before the snmp headers to have a free declaration
* Use sprintf(dest, "%s", str) to avoid format string attacks
* Avoid bogus assignment. This pattern was used for marking something
  as unused in the past.
2013-03-18 19:03:44 +01:00
Holger Hans Peter Freyther e6caed12ca mgcp: Add a log message about the tones that will be queued 2013-02-26 16:48:05 +01:00
Holger Hans Peter Freyther 46c79994e6 mgcp: After the tones are played inform the DTMF state
dtmf_state_played will re-set the playing state. Currently the
first tone was played and then no more tones were scheduled to
be played.
2013-02-26 16:47:48 +01:00
Holger Hans Peter Freyther fb7ae15abe mgcp: Remove unused variable from the callback handling 2013-02-26 16:39:47 +01:00
Holger Hans Peter Freyther 4822c8bc56 isup: Make isup CIC parsing/using work on big endian machines as well
This is a hot fix to make CIC reading (and later status) work on
big endian machines. There might be a more elegant way to do it
and I will explore this later.
2013-02-24 15:10:55 +01:00
Holger Hans Peter Freyther 6808407dcf isup_filter: Add debug and log messages for the filtering
This way one can check the logs if this code path is hit. The
logging normally only occurs for the two messages we are interested
in. It doesn't make sense to reset with a range of 0 so the code
has been re-ordered.
2013-02-24 15:10:49 +01:00
Holger Hans Peter Freyther 5d04481455 mgcp: Fix the vary large jump detection in the code
GCC 3.x on PowerPC correctly highlights that the code is fishy.
Re-reading the RFC 3550 shows that we should subtract it and then
we are in the 16bit range. The probation and re-sync code is still
missing.

GCC:
mgcp/mgcp_network.c:200: warning: comparison is always true due to limited range of data type
2012-12-16 13:23:11 +01:00
Holger Hans Peter Freyther e833478898 isup: Hook the reset scanner before we forward the ISUP message
Scan for two kind of reset messages in the ISUP messages. Forward
them to the mgcp_ss7.
2012-12-16 12:45:58 +01:00
Holger Hans Peter Freyther b35c5c3227 stp: Allow to specify a trunk_name in the application
This trunk name will be used to send RSIP for the trunk on ISUP
resets. Right now each app can be associated only one trunk.
2012-12-16 12:10:32 +01:00
Holger Hans Peter Freyther d04011abc1 stp: Extract the MGCP forwarding code out of the msc_connection
For the ISUP/MGCP handling we will need the same code, extract it
from the msc_connection. For the reading code callback is introduced
that will pass the MGCP message to the higher layer.
2012-12-16 12:10:26 +01:00
Holger Hans Peter Freyther 2df07d549d mgw: Implement the specific RSIP handling
The RSIP has morphed from a global reset, to a per trunk reset and now
it is possible to reset specific ranges on a trunk. This will be used by
the ISUP filter code in the STP.

For legacy range == -1 will be used. This will reset all endpoints
on the trunk. Use OSMO_MAX on endpoint and number of endpoints in case
number_endpoints is 0.

This code will now free everything from the endpoint to endpoint + range
including endpoint+range.
2012-12-16 12:10:26 +01:00
Holger Hans Peter Freyther fe55ed14f7 mgcp: Write a small hint that this special endpoint number handling is broken
It is user defined where the signalling will take place, there might not
be any signalling at all.
2012-12-16 11:33:27 +01:00
Holger Hans Peter Freyther 57e9ca9fe9 mgcp: Use the realloc callback when freeing the endpoint via the VTY
In case the endpoint is allocated and the VTY is used to force it
to be freed use the realloc_cb to make sure that any resources
allocated to it will be freed. The mgcp_ss7 binary will then call
mgcp_ss7_endp_free to free audio encoder resources.
2012-12-16 11:33:27 +01:00
Holger Hans Peter Freyther 2d115d4bbb mgcp: Merge the current MGCP code from OpenBSC
There were several changes in the upstream code. These include
statistics, DTMF/RQNT, changes in the parsing code and re-transmission
handling. The last item is the main reason to do the merge now.
2012-12-16 11:33:27 +01:00
Holger Hans Peter Freyther d74ac33574 dtmf: Schedule DTMF tones for the MTN hardware
Create a simple queue for pending DTMF tones, play them using the
MTN API, and then send the next tones once the playback is complete.
The callback and scheduling is done from the same context so no locking
needs to be done.
2012-12-16 11:33:27 +01:00
Holger Hans Peter Freyther 9b2474490a mgcp: Begin handling of the RQNT message as needed for DTMF
Introduce a callback for the request and forward the signalrequest
to the callback. This is not a full implementation of MGCP RQNT.

Manual merge and backport from OpenBSC.
2012-12-16 11:33:27 +01:00
Holger Hans Peter Freyther 611d238a68 mgcp: Add a hack to allow to patch the SSRC
This is a hack and we will need to do this only if a MDCX with
a new IP address is arriving.
2012-12-16 11:33:27 +01:00
Holger Hans Peter Freyther e310310843 mgw: Always disable the writing for the socket notifier, initialize variable
This was spotted while verifying the RSIP code using valgrind.
2012-12-16 11:33:27 +01:00
Holger Hans Peter Freyther 677fd1e5c8 adler: Remove the SCTP hack that we needed to force the adler checksum
Remove the hack that was required for inter-op. The equipment will
migrate to the CRC32 checksum soon.
2012-07-01 17:40:04 +02:00
Holger Hans Peter Freyther 11a1415fc1 syslog: Log all exit paths in this code
There are some exit paths that do not have syslog logging.
2012-06-12 15:50:38 +02:00
Holger Hans Peter Freyther 826390a5ba syslog: Add syslog for the MGCP MTN thread
We can not use the osmocore logging in multiple threads, open a
separate syslog to log errors.
2012-06-12 15:50:31 +02:00
Holger Hans Peter Freyther 4d47451521 mgcp: Always restore the endpoint routing when destroying the endpoint
In case MtnSaAllocate failed the code did not restore the audio routing
when destroying the endpoint. Move the hw_maybe_loop_endp out of the if
statement.
2012-05-11 11:46:31 +02:00
Holger Hans Peter Freyther d56ddfc380 mgcp: Possible fix for using the right DSP resource on the MGCP MGW
This got broken in the previous commit. Use the hw_dsp_port we assigned
to the endpoint instead of the dsp_resource that is one ahead. For the
non loop-on-idle configuration audio routing appears to be broken.
2012-05-11 11:36:19 +02:00
Holger Hans Peter Freyther e1ec4c7047 hw: The DSP resource was one based with the SNMP API, subtract it
* Change the assigning dsp_resource to start with one and increase
  after usage and not before usage (so it becomes the next free
  port).
* Subtract one from dsp_port after we have selected the path. In the
  longer run I should make dsp_resources zero based all the way.
2012-01-23 16:30:16 +01:00
Holger Hans Peter Freyther c96c57b8d5 mgcp: Implement to loop timeslots when not used for audio
Deal with broken ISUP switches and allow to loop endpoints
when they are not connected. Introduce an option to do it.
2012-01-22 11:44:33 +01:00
Holger Hans Peter Freyther 765c48aba7 mgcp: Move to using the NexusWare API for Timeslot config 2012-01-22 11:43:39 +01:00
Holger Hans Peter Freyther 77ffc93742 mgcp: Rename from snmp to hw in variables and function name. 2012-01-22 11:41:54 +01:00
Holger Hans Peter Freyther 8aaaa406bb mgcp: Move the SNMP file to _hw.c to move to the NexusAPI 2012-01-22 11:40:35 +01:00
Holger Hans Peter Freyther 60bc8e7dab mtp: Allow to send SCCP/ISUP to a specific endpoint
For a linkset define where SCCP/ISUP should be send. This config
should probably move up to the application part when real work on
the routing is done. Right now the sccp_opc/sccp_dpc need to stay
inside the mtp_layer3.c to be able to send a TFA for the reachable
OPC and it is easier to keep both (dpc/opc) in the same file.
2012-01-16 11:51:18 +01:00
Holger Hans Peter Freyther 53559b39e5 mtp: Provide the method with the OPC and DPC
We want to submit on a link set but want to provide the OPC and
DPC of the callers choice.
2012-01-16 09:57:06 +01:00
Holger Hans Peter Freyther 104280700a mtp: Name the parameter opc instead of just PC 2012-01-16 09:55:42 +01:00
Holger Hans Peter Freyther a59af64126 ss7: Make the forwarding methods static 2012-01-16 09:54:09 +01:00
Holger Hans Peter Freyther d87ef3bc66 vty: Add show msc [NR] to specify an optional MSC nr 2011-11-28 10:16:38 +01:00
Holger Hans Peter Freyther c5e8f08303 msc: Make 'show msc' show the primary msc connection again
Revert an accidental change when introducing show mscs. We want
show msc to be like it was before.
2011-11-25 17:26:44 +01:00
Holger Hans Peter Freyther fffdd76f56 msc: Only take down the link if it is up
If the link was never started and we send a SIGUSR2
we would start the link. Don't do it.
2011-11-25 17:24:59 +01:00
Holger Hans Peter Freyther 31d6597c3f vty: Introduce show mscs to show all mscs 2011-11-25 16:23:43 +01:00
Holger Hans Peter Freyther ade60edd5f msc: Only unregister the fd when we have a valid fd 2011-11-25 15:32:45 +01:00
Holger Hans Peter Freyther 6853567564 bss: Patch CC messages with bearer capabilities to contain AMR 3
* This changes bss_patch_filter_msg to return -1 or BSS_FILTER_DTAP
  for DTAP messages. This way app_forward_sccp should continue to behave
  the same besides now looking into DTAP messages.
* Introduce a direction in case we want to advertize FR into the BSS
  side and HR into the other direction.
* Patch AMR HR3 and Fullrate/Halfrate capabilities in the Bearer
  Capabilities. Add a test case that is patching the bearer capabilities
2011-11-24 11:07:37 +01:00
Holger Hans Peter Freyther 1ab8961450 bss_patch: Remove magic number and use define for BSSAP management 2011-11-23 19:25:10 +01:00
Holger Hans Peter Freyther 7eaf6fb9f9 sccp: PC -> PointCode and we remove them to avoid routing issues 2011-11-23 18:38:30 +01:00
Holger Hans Peter Freyther df38eb1b4c rate_ctr: Initialize the rate_ctr to update them properly
This way we get proper information about packets per second/hour
and minute. Right now we only count the total.
2011-11-20 13:26:31 +01:00
Holger Hans Peter Freyther e616863190 misc: Address various compiler warnings in the code 2011-11-20 11:11:01 +01:00
Holger Hans Peter Freyther fd8513d8c3 mgcp: Increase number of endpoints that can be blocked
For the Virtual Trunk we have more than 31 endpoints. Increase the
number by a large factor here.
2011-10-07 17:39:57 +02:00
Holger Hans Peter Freyther 7158822985 mgcp: Skip blocked endpoints in the show mgcp command 2011-09-19 23:46:55 +02:00
Holger Hans Peter Freyther 2facdb7943 msc: Do not run ping/pong timers by default
The current ping/pong timeout is 0 which means the MSC connection
will be taken down almost immediately. Set it to -1 to disable sending
pings and waiting for the pong.
2011-09-19 23:31:45 +02:00
Holger Hans Peter Freyther d786928221 mgcp: Improve the show mgcp command to print the domain name
For virtual trunk's we only have the virtual domain name they
are serving. Print that instead of the trunk->nr which has no
meaning in this context.
2011-09-19 23:26:11 +02:00
Holger Hans Peter Freyther ca5254b29c mgcp: Write the vtrunk using mgcp_write_vtrunk_extra 2011-09-19 13:41:05 +02:00
Holger Hans Peter Freyther b1dfc462df cellmgr: Patch the MGCP messages and replace the domain name
Replace the domain name with a new name domain that can be configured
via the VTY interface.
2011-09-15 19:30:20 +02:00
Holger Hans Peter Freyther 588754c7d3 mgcp: Reset the local endpoint with the domain name configured 2011-09-15 13:23:00 +02:00
Holger Hans Peter Freyther 040c6bcb25 mgcp: Reset endpoints via the trunk config instead of all of them
This change is coming from OpenBSC and was adjusted to mgcp_ss7
2011-09-14 22:32:59 +02:00
Holger Hans Peter Freyther fa15805e81 mgcp: Fix the indention of the trunk/vtrunk extra items
Use two spaces for the config items on the level of the
TRUNK/VTRUNK node to follow the normal items.
2011-09-14 22:30:05 +02:00
Holger Hans Peter Freyther d3b8d5f4d1 mgcp: Fix the naming of the various audio volume/gain parameters
The problem has been here for a while, fix the parsing of the
generated config file
2011-09-14 22:29:17 +02:00
Holger Hans Peter Freyther f574cec745 mgcp: Introduce multiple virtual trunks
A virtual trunk is identified by a virtual domain name.
2011-09-14 22:29:14 +02:00
Holger Hans Peter Freyther 96cc57af80 mgcp: Generate the ConnId per trunk base
MGCP RFC 3435 does not specify that the Connection Id must be
generated with any kind of random. It must uniquely identify
the connection of an endpoint. So we can make it per trunk group
or could even have it per endpoint.

The code does not support multiple connections on the same endpoint
right now but the spec allows it.
2011-09-14 22:28:13 +02:00
Holger Hans Peter Freyther 42e44a9e5e mgcp: Introduce a command that will just block the default ports
It can be difficult to find the Timeslot/Multiplex for a higher
number virtual trunk. This would be used by default, but normally
the endpoint would be blocked on the switch already.
2011-09-14 22:28:13 +02:00
Holger Hans Peter Freyther dea0ccc7fc mgcp: Add VTY commands to block endpoints instead of having this hardcoded
Instead of assuming which endpoints are blocked there is now a VTY
command to block those. Clean up the init of the trunks, the only difference
between Virtual and E1 is in the way to calculate the start port.

Reduce the number of endpoints to 32, 31 is the last one that can be
used on the E1 trunk, otherwise we move into TS 0 of the following trunk.
2011-09-14 01:58:40 +02:00
Holger Hans Peter Freyther c2bb077a48 mgcp: Split creation of endpoints and static port allocation
Create the endpoints as soon as possible, configure static ports
after we are through with the parsing of the VTY config.
2011-09-14 00:23:22 +02:00
Holger Hans Peter Freyther e72139a6f3 mgcp: Remove the endp_offset that was introduced due coding stupidity
The endpoint offset is needed for two reasons, first the API is 0
based here while we are normally 1 based, second because of the trunks
the first usable endpoint would be '2' (0 is CRC, 1 is signalling), but
this endpoint offset falls apart when we would block timeslots inside
this range.

Remove the endpoint offset, in each endpoint we will store the HW DSP
Port (1 based API) and then subtract one to get to the 0 based API for
the Simple API. Print a warning when someone is using the endpoint offset.
2011-09-13 22:53:13 +02:00
Holger Hans Peter Freyther fc98ce252e vty: Add a config to enable MGCP command rewriting 2011-09-13 20:08:57 +02:00
Holger Hans Peter Freyther a79aff3f96 sctp: Really apply the MSC workaround
The MSC workaround was added in 5960ba387a
but it has never worked as in 8fd28dbbe6 (earlier)
we were checking for link->conn != conn in the dispatch method. Move the
code over to the generic dispatch and check for NULL.
2011-08-10 06:45:52 +02:00
Holger Hans Peter Freyther cf60a01cd0 sctp: Add VTY command to print details about active SCTP connections
This will print details about each SCTP connection including the
FD and pointer of it.
2011-08-10 06:37:35 +02:00
Holger Hans Peter Freyther f2312cb04c sctp: Check if there is any other connection with the ASP ident
When we get an ASP UP check if there is any other ASP that is
using the same identifier and then complain.
2011-08-10 06:37:35 +02:00
Holger Hans Peter Freyther ab79b9b593 m2ua: Print information about number of SCTP connections
It appears that it is possible to have a stale SCTP connection
and this added LOGL_NOTICE and the VTY interface might help to
identify this situation in the future (the mean time of failure
is about five month).
2011-08-10 06:37:35 +02:00
Holger Hans Peter Freyther c21c0d699f misc: Update code to compil with libosmocore 0.3.2
The DSCCP/DM2UA code still needs to be updated to deal with the
new way to handle these regions in libraries.
2011-07-22 09:00:23 +02:00
Harald Welte ff397edf38 Adopt to recent libosmocore namespace changes and libosmogsm 2011-05-08 10:29:23 +02:00
Holger Hans Peter Freyther edfadaeb3d mgw: Attempt to set the CMR to 5.9kbit/s
This will hopefully make the MTN4200 always use the
5.9kbit change mode.
2011-04-26 18:19:14 +02:00
Holger Hans Peter Freyther b806c14e21 mgcp: Fix the comment in the configuration 2011-03-25 10:46:52 +01:00
Holger Hans Peter Freyther 8e6d4c3414 mgcp: Check if the endpoint is blocked and then reject it
Instead of hardcoding which timeslot is blocked we will just
use the blocked flag in an endpoint. This should fix call
handling for CIC on the trunk config.
2011-03-21 15:14:04 +01:00
Holger Hans Peter Freyther e0dc3e5276 isup: Handle CGUs and respond with a CGUA
We don't let CGUAs pass when handling circuit blocking and
unblocking locally. But we did let a CGU go through and then
we never sent the response back to the sender. Respond to a
CGU with the same content.
2011-03-05 09:50:47 +01:00
Holger Hans Peter Freyther 2068e8cfe3 vty: Remember if isup should be passed through or not. 2011-03-05 09:48:52 +01:00
Holger Hans Peter Freyther d0444e53af mgcp: Fix the initialisation set trunk_type in the caller 2011-03-03 11:50:06 +01:00
Holger Hans Peter Freyther 8941c1d422 isup: Print the linkset nr and name like in other commands. 2011-03-03 08:18:27 +01:00
Holger Hans Peter Freyther 56cba9ab45 ss7: Drop the input of packages as well
We don't want the input change any state on the linkset and will
drop them if we think our application is not reachable.
2011-03-03 01:20:03 +01:00
Holger Hans Peter Freyther 899198ed2e ss7: Move the blocking of outgoing messages into the SS7 app
We are using knowledge of the SS7 application to drop outgoing
packages to force failures on the link and should move this into
the ss7 application.
2011-03-03 01:19:45 +01:00
Holger Hans Peter Freyther d38b87a4c9 ss7: Do not send anything until both linksets in an app are up
We need some way to forward the failure of one link to another but
they are not normally routed so we can not send a TFP. Right now we
will simply stop responding until both links are up. This should make
the SLTM fail and trigger a re-alignment on both sides. The key here
is that the 2 * SLTM timeout needs to be higher than it takes to re-align
the link. I'm not sure this code will work.
2011-03-03 01:19:02 +01:00
Holger Hans Peter Freyther 123147a472 sctp: Mention the link index that got released 2011-03-03 01:13:26 +01:00
Holger Hans Peter Freyther 3574c121ff mtp: Consider the linkset be ready for SCTP after having collected routing data
After the expiry of T18 we should have collected the routing data
from the adjacent links and should be able to send SCCP packages
to remote endpoints.
2011-03-02 23:44:03 +01:00
Holger Hans Peter Freyther ec84e3c1a1 mgcp: Add a go to parent to allow multiple trunks 2011-03-02 22:49:02 +01:00
Holger Hans Peter Freyther 3c8b0f89aa mgcp: Use the blocked attribute to figure out if an endpoint is blocked 2011-03-02 22:22:50 +01:00
Holger Hans Peter Freyther 7e8ee3a4be sctp: Use the right link index when sending messages
Stop using the hardcoded link index and use the link index
of the link.
2011-03-02 22:00:24 +01:00
Holger Hans Peter Freyther 5960ba387a sctp: Handle establish request for a wrong ASP
The MSC we test is not sending an ASP Active when the
link is unblocked. If the m2ua_link has no connection
associated we will forgive the MSC and active it.
2011-03-02 21:56:03 +01:00
Holger Hans Peter Freyther fb5b6dc80e mgcp: Respect the blocked indication fo an endpoint. 2011-03-02 21:49:50 +01:00
Holger Hans Peter Freyther 0d20e0d12f mgcp: Mark certain endpoints as blocked.
Right now for the virtual trunk 0x0 and 0x1F is blocked, for the
E1 like interface we have 0x0 and 0x1 blocked. This should start
to be configurable in the future.
2011-03-02 21:44:01 +01:00
Holger Hans Peter Freyther d523131339 snmp: Fix the configuration and point it to the right thing. 2011-03-02 13:34:43 +01:00
Holger Hans Peter Freyther e592933202 mgcp: Use the 'i' as type for SNMP to help with the code. 2011-03-01 18:00:52 +01:00
Holger Hans Peter Freyther b7299a89cd mgcp: Configure the HSCOMM routing based on the information we have
Configure the routing of audio ports if mgcp_mgw is configured
to do this. This allows to have multiple trunks, make virtual
ports go to a specific trunk as well.
2011-03-01 16:07:54 +01:00
Holger Hans Peter Freyther d384912f76 mgcp: Calculate which dsp resource should be used by the trunks 2011-03-01 16:07:19 +01:00
Holger Hans Peter Freyther 672f321eea mgcp: Calculate the right Audio Processor resource for high endpoints
With this commit we can have more than 30 endpoints that will work. We
ignore the blocked endpoints 0x1 and 0x1f for each trunk and calculate
everything from the right start point.
2011-03-01 13:52:57 +01:00
Holger Hans Peter Freyther dcc3312792 mgcp: Merge OpenBSC MGCP code and update the structure to match it
* Upstream has a separation of BTS and NET side for RTP ports and
  can allocate them dynamically.
* Upstream has gained the concept of trunks. We will now have various
  trunks to connect audio things.

* We will now be able to utilize multiple trunks and have the endpoints
  used properly.
2011-03-01 13:02:29 +01:00
Holger Hans Peter Freyther f3da99ed65 mgcp: Attempt to get the endpoint configuration right
number_endpoints is always one bigger than it needs to be,
subtract the one in the show command, start counting at one.
2011-02-28 17:27:14 +01:00
Holger Hans Peter Freyther 796406beee mgcp: Add code that will attempt to configure the TDM switch 2011-02-28 17:21:49 +01:00
Holger Hans Peter Freyther a2938fee11 sctp: Fix a memory leak on connection failures. 2011-02-25 19:48:24 +01:00
Holger Hans Peter Freyther 718d4ba66c sctp: Only handle traffic with the payload type of M2UA 2011-02-25 19:47:55 +01:00
Holger Hans Peter Freyther 0e6cbc62b2 sctp: Fail if we fail to enable SCTP events on this socket
Without events we don't have access to the SCTP sndrcvinfo and
the ppid in it and we will do bad things like sending M2UA on
PPID 0.
2011-02-25 19:44:22 +01:00
Holger Hans Peter Freyther 639d77b6fb links: Fix the init code for the old cellmgr_ng code 2011-02-25 16:29:45 +01:00
Holger Hans Peter Freyther 03fc66074b counter: Fix the wrong counter size. 2011-02-23 17:41:23 +01:00
Holger Hans Peter Freyther af3faf8a81 vty: Allow to specify 14 bits for the CPC. 2011-02-23 16:59:45 +01:00
Holger Hans Peter Freyther d062f8318e mtp: Call the mtp_link_set always set otherwise things get confusing
In a backtrace it is confusing to see variables called link and link
and one is a mtp_link and the other is a mtp_link_set.
2011-02-23 16:58:15 +01:00
Holger Hans Peter Freyther 765fba3fd0 msc: Remove unused method from the code 2011-02-23 16:54:50 +01:00
Holger Hans Peter Freyther 4c9dd160c3 sccp: The link attribute was never used leading to a crash
Right now we assume that the source of an application with
SCCP state tracking is a linkset. Send the message to that
linkset.
2011-02-23 16:11:21 +01:00