9
0
Fork 0
Commit Graph

363 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 62c50a8046 dtmf: Make the on/off time and transmit power configurable
Make it possible to configure the transmit power. These settings
will be in effect immediately (there is no lock between the two
threads but it is a read only).
2013-05-23 11:13:36 +02:00
Holger Hans Peter Freyther d7d3bba8d6 dtmf: Add tone detection to the event handling
We get a trap for detected tones and then need to query them. Print
the detected characters for now and do not forward them yet.
2013-05-23 10:25:21 +02:00
Holger Hans Peter Freyther 4bc679f3ec mgcp: Return 502 in case the endpoint is allocated.
When an endpoint is allocated we do not have enough resources to
connect it again and this situation is permanent as long as the
endpoint is connected.

Returning 502 might help some switches to release stale audio resources.
2013-05-21 18:00:24 +02:00
Holger Hans Peter Freyther b2e8cfbe8d dtmf: Check the tones that are put into the DTMF scheduler and reject a 0
Playing tones should be printable ascii characters, begin by checking
for NULL (as it happened before) as the first illegal tone. This is
an attempt to make the API more robust and detect errors more early.
2013-05-21 18:00:21 +02:00
Holger Hans Peter Freyther 5d76e957fe dtmf: Make the API more robust and avoid inconsistencies
Because of the issue parsing the MGCP request a '\0' was added to
the queue. This lead to the dtmf scheduler believing that a play
was in progress while the playing code didn't play anything. This
lead to the queue to be stuck and nothing being played at all.

Return the number of tones that should be played and stop using
strlen on the tones.
2013-05-21 17:51:31 +02:00
Holger Hans Peter Freyther 68d5114638 dtmf: Improve the log message and print the number of messages queued
Print the number of log messages that are queued in the error message.
2013-05-21 17:14:12 +02:00
Holger Hans Peter Freyther 72793ec0a9 mgcp: Initialize the tone to CHAR_MAX as this might not be a request
The RQNT message might not contain a 'S:' line with the actual tone
to play. Instead of calling the callback with the 0 as tone just leave
early.

Example:
X: 6B9519B88F0
R: D/[0-9#*](N), G/ft, fxr/t38

Merged from the OpenBSC development tree
2013-05-21 17:13:01 +02:00
Holger Hans Peter Freyther 0ff1c8c548 patching: Add a VTY option to hardcode the assignment complete message
For some equipment it is the easiest to patch the assignment
complete message transported to the MSC. Add a VTY config to
enable this patching, create a testcase that tests that the
original message is truncated. The setting of the VTY option
has been manually tested. The entire system has not been end
to end tested.

Conflicts:
	src/vty_interface.c
2013-05-13 21:17:37 +02:00
Holger Hans Peter Freyther fe1550fed4 patching: Get the struct ss7_application down to the patching routine 2013-05-13 21:17:07 +02:00
Holger Hans Peter Freyther d2fdb2afbf bss patch: Remove stale printf from the code that broke the tests 2013-03-25 13:53:04 +01:00
Holger Hans Peter Freyther 7916cb881d bss patch: Patch all slots with FR2 in the assignment request
* Patch all slots with the FR2 codec. This is the easiest way to
  patch the entire message.
2013-03-25 11:16:13 +01:00
Holger Hans Peter Freyther 63bb411522 bss patching: Add test cases for assignment and assignment complete patching
* Chosen Channel and Speech Version are both optional. Patch them
  separately if they are present.
* Add testcase for the assignment request patching.
2013-03-25 11:16:07 +01:00
Holger Hans Peter Freyther 6cd4e9521d tests: Make the test data static const 2013-03-25 11:16:00 +01:00
Holger Hans Peter Freyther 42cf823e2f 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-11 17:19:18 +01:00
Holger Hans Peter Freyther 5408d96b20 mgcp: Add a log message about the tones that will be queued 2013-02-26 16:48:28 +01:00
Holger Hans Peter Freyther 969b08a526 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:48:28 +01:00
Holger Hans Peter Freyther dcdaadbb8d mgcp: Remove unused variable from the callback handling 2013-02-26 16:48:28 +01:00
Holger Hans Peter Freyther 3fb10918a8 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.
2012-12-17 10:27:02 +01:00
Holger Hans Peter Freyther 767e2f2e15 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.
2012-12-17 10:16:55 +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 a9530059a1 isup: Test some more ISUP messages and that we parse them correctly 2012-12-16 12:10:36 +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 d183052dae TODO: Add some known shortcomings and some talk about what to do. 2012-01-16 11:55:26 +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 f3e9ad01c1 tests: Remove the copy of the 'missing' and use the $(top_srcdir) one 2011-12-04 23:29:46 +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