Commit Graph

6345 Commits

Author SHA1 Message Date
Harald Welte 3701992c74 ISUP: support transfer capability interworking with Q.931
A Q.931 call has the 'transfer-cap' attribute set to 'udi' for data
calls.  The ISUP module must pick this up and encode it in the
UseServiceInformation IE to preserve this vital information.  Inversely,
a call arriving via ISUP must put its transfer-capability into the
'transfer-cap' attribute, so that when it's routed to Q.931 it is
preserved.

Without this transfer-capability transparency, no UDI/RDI data calls
or ISDN video calls can transition on the Q931/ISUP boundary

See also https://github.com/yatevoip/yate/issues/12
2023-12-03 16:19:41 +01:00
Harald Welte a66e3dd9de zapcard: Fix consume erros in ZapCircuit
Patch written by mtelegin, rebased onto modern yate

Bug report:
https://web.archive.org/web/20220819114119/http://yate.null.ro/mantis/view.php?id=143

During the call between SIP phone and phone connected to FXS port on Digium TDM400P has been occured a lot of clicks on FXS port. Log files contains messages like "Buffer overrun ... Resource temporarily unavailable" and "Consumer errors: 29. Lost: 13920/262320". The fix is applied in patch. Tested only on Digium analog card TDM400P
2023-12-03 13:26:47 +00:00
Manawyrm 099b17459c zapcard: revert buffer length back to 160 (20ms)
while the smaller buffer length had a positive impact on
ISDN data calls, it breaks yate's handling of SIP/RTP to TDM calls.
Yate will start to emit 16ms packets with a buffer length of 128,
which will lead to broken call audio with many SIP providers.
2023-12-03 14:10:05 +01:00
Harald Welte 498dc6bcc7 processCalledNo: Fix typo / copy+paste error
Surely, the treatment of the *called* party type/plan should
not depend on the *calling* party type/plan.
2023-12-03 11:41:46 +01:00
Manawyrm 22aabade2d amrnbcodec/efrcodec: switch from ETSI amrnb to libopencore-amrnb 2023-10-08 16:44:43 +00:00
Martin Lang 48eb7da9d2 Callfork: Inconsistent group progression
Callforks support three types of call legs:
- regular
- auxiliar
- persistent

These different types change the behavior of how groups progress.
If no regular calls are left in a group, the fork progresses
immediately to the next group, drops all auxiliar children and keeps
the persistent ones. However, there is inconsistent behavior depending
on whether the creation of a call leg is successful or not.

Currently, the check if there are regular calls left in the current
group is only implemented in lostSlave(). So, if you have a group
with one persistent member (ringback) and one regular member, you can
observe different behavior in the case that routing for the member fails
and in the situation that the call is started but then rejected on a remote
end.

If the regular member is remote, forkSlave() will succeed and initiate a sip
call. The callContinue() function will return. Then, the sip call might fail
because the remote member is offline. Now lostSlave() is called, the module
detects that this was the last regular member and immediately progresses
to the next group.

If the regular member, however, is local, the routing knows that the member
is offline and fails. In this case forkSlave() will fail. Nonetheless, forks = 1
because creation of the persistent slave (ringback) was succesful. Consequently,
the call continues but it is ringing nowhere. In case that the next group is timed,
the caller will just hear the ringback for a while. If the next group isn't timed
but expected to progress if all calls in the current group have failed, the call
is actually stuck and the caller will hear the ringback indefinately while it is
nowhere ringing.

This patch fixes this behavior by checking if regular call legs are active before
returning from callContinue(). If this isn't the case, it will trigger progression
to the next group immediately.
2023-10-03 11:15:12 +02:00
Martin Lang bdaa62cd1e callfork: Fix error propagation
If all fork children fail before any channel can
be created, the fork will always fail with error code
500. However, we can have such a situation because
all participants are offline and the routing returns
the respective error code.

In order to mitigate this, we update the error code
of the call.execute message of the fork. So, in the case
that all children fail before any channel can be established,
the caller will see the error code of the last child.
In an all-offline scenario this would be 404.
2023-10-03 11:15:03 +02:00
Manawyrm 6fa07fb632 Add new clearmode codec support for data calls
This new codec will get handled like RFC4040 in yrtpchan, ysipchan
and will just be handled as alaw audio in zapcard/DAHDI.

The zapcard code will set the udi bearer cap to any calls with the
clearmode format (which would get sent via SIP/SDP).
2023-09-19 18:29:40 +02:00
Manawyrm cb016b244f zapcard: ioctl SetAudioMode to false, ensuring a clear data channel 2023-09-19 18:29:40 +02:00
Manawyrm 4b47b724ba zapcard: use DAHDI_POLICY_WHEN_FULL for B-channel buffers 2023-09-19 18:29:40 +02:00
Manawyrm 9ac675d324 miniwebrtc: add aarch64 support
miniwebrtc fails to compile on aarch64/arm64 because the architecture isn't known
this change adds the required configuration for arm64
2023-09-19 18:29:40 +02:00
Manawyrm 71113b9727 Add new span parameter to zapcard, removing the need for offset calculations
DAHDI has nice readable names for each span, there's no need to do any channel
calculations by hand. This change searches for a span with the specified name
and will use it's offset as the channel offset.

[octoi]
type=E1
offset=279

[auerswald]
type=E1
offset=31

becomes:

[octoi]
type=E1
span=trunkdev/octoi/0

[auerswald]
type=E1
span=TE8/0/2

which should be more reliable and less error-prone in the long run.
2023-09-19 18:29:40 +02:00
Harald Welte 1bad0f5194 q931: If we're the network, channelID in ALERTING/CALL_PROC/CONNECT is mandatory
The user may suggest a given channel in the SETUP, but it's not legal
for the network to return a non-mandatory ChannelID.

See Q.931 Section 5.1.2 (B-channel selection - Originating):

The selected B-channel is indicated in the Channel identification information
element coded as "channel is indicated, no acceptable alternative" in the first
message returned by the network in response to the SETUP message (i.e. a SETUP
ACKNOWLEDGE or CALL PROCEEDING message)

In an earlier commit I had only fixed SETUP ACK, but missed that this is
a more general problem that needs addressing in whatever is the first
message containing a channelID yate sends in response to the SETUP.
2023-09-19 18:29:40 +02:00
Harald Welte 071d635fc6 iax: ENCRYPTION IE is 2 bytes, not 1 byte
yiax wrongly assumed that the ENCRYPTION IE is a single byte,
while in reality it is 16bit / 2 bytes.

It has been two bytes ever since it was introduced in Asterisk in 2004.

This misunderstanding probably arose from RFC5456 which erroneosly
states that the length of this IE is 0x01 while its body is 2 bytes
long (See Section 8.6.34 at https://datatracker.ietf.org/doc/html/rfc5456)
2023-09-19 18:29:40 +02:00
Harald Welte d313646712 iax: Support the new CALLINGANI2 IE
This was introduced in Asterisk IAX2 in
3072c540bb
2023-09-19 18:29:40 +02:00
Harald Welte f727a1dd3a q931: If we're the network, channelID in SETUP ACK is mandatory
The user may suggest a given channel in the SETUP, but it's not legal
for the network to return a non-mandatory ChannelID.

See Q.931 Section 5.1.2 (B-channel selection - Originating):

The selected B-channel is indicated in the Channel identification information
element coded as "channel is indicated, no acceptable alternative" in the first
message returned by the network in response to the SETUP message (i.e. a SETUP
ACKNOWLEDGE or CALL PROCEEDING message)
2023-09-19 18:29:40 +02:00
Harald Welte 3020ff51ed preserve transfer-capability in Q.931 -> Q.931 calls
This is important so udi/rdi doesn't get converted to speech.
2023-09-19 18:29:40 +02:00
Harald Welte 6f336a336a q931: sendSetupAck: Don't encode a BRI channel selection in PRI
If yate is operating in the 'network' role of a PRI interface,
it must send a valid ChannelID InformationElement in the SETUP ACK.

However, current yate code is encoding the channel selection field
of said information element wrong, as it unconditionally looks up
the s_dict_channelIDSelect_BRI (instead of _PRI).

This fixes a regression introduced in 2009 in the following commit:

commit 05b717e0b9
Author: paulc <paulc@acf43c95-373e-0410-b603-e72c3f656dc1>
Date:   Mon Mar 2 18:51:30 2009 +0000

ISDN BRI support, most Andrei's (andrei@null.ro) work.
Fixes and new features throughout the signalling engine.
it-svn-id: http://yate.null.ro/svn/yate/trunk@2505 acf43c95-373e-0410-b603-e72c3f656dc1
2023-09-19 18:29:40 +02:00
Ioana Stanciu ef0d8d4c6a Fix SIP packet capturing for TCP.
Wait for whole SIP packet to be received/sent before sending it to the capture.
Capturing at socket level would send HEP packets containing SIP fragments.
2023-06-23 17:57:00 +03:00
marian 2d156f31ec Increased output buffer size. Allow it to be defined at compile time. 2023-06-19 09:16:53 +03:00
Ioana Stanciu b2b11e5e0d Fix compilation of HEP3 on older compilers. 2023-06-13 15:28:10 +03:00
marian 497b42121a Silenced compile time unused function warning in alsachan.
Improved debug.
2023-06-01 14:39:30 +03:00
marian d820fed4b8 Added RWLockPool class.
Added atomic number class(es).
Pass atomic operation availability to everybody in configure script.
Use atomic number in NamedCounter.
Use atomic number for MessageHandler unsafe. Fixes concurrent increment introduced by RLock usage in dispatcher.
2023-05-31 15:54:22 +03:00
marian a30704254c Silenced some compiler warnings (null printf string argument, unused function). 2023-05-30 09:55:45 +03:00
Ioana Stanciu 99cc9740b7 Update copyright for shell scripts. 2023-05-29 14:47:07 +03:00
marian 7ca0164860 Moved formats changed debug message to a lower level. 2023-05-26 16:46:25 +03:00
marian c45f3a0345 Set debug enabler in SDP media.
Lowered debug level for media debug messages.
2023-05-26 15:28:49 +03:00
marian a590b6083f Use separate RWLock(s) (for handlers, queue, posthooks) in message dispatcher.
Added command (status dispatcher handlers <name>) used to show installed handlers info.
2023-05-26 14:56:22 +03:00
marian b4af14c418 Fixed owner check for Mutex and RWLock: compare thread pointer instead of name.
Improved debug.
2023-05-26 14:30:28 +03:00
marian bde151edba Added extra javascript shared vars getVars() parameter indicating detection and return of boolean values. 2023-05-26 14:30:28 +03:00
Ioana Stanciu 6336ddffd3 Update copyright for leftover script. 2023-05-23 17:04:17 +03:00
Ioana Stanciu c56216f5a8 Updated copyright notices. 2023-05-23 17:01:06 +03:00
Ioana Stanciu c01a6a4d7e Preserve file permissions when updating copyright notices. 2023-05-23 16:54:49 +03:00
Ioana Stanciu afc46246ca Import commercial version of YATE SIP and SDP implementation. 2023-05-23 15:16:31 +03:00
Ioana Stanciu 3539304e63 Add support for HEP3 packet capture in SIP. 2023-05-23 14:27:45 +03:00
Ioana Stanciu 87bd925d49 Add module for HEP3 packet capture. 2023-05-23 14:22:42 +03:00
marian 7c32acd5b4 Exported matching item dump method in javascript.
Added javascript support to build a random match item.
2023-05-22 16:01:31 +03:00
marian 1efb132281 Fixed matching item list dump. Improved debug. 2023-05-22 16:00:22 +03:00
marian e3f3ba3884 Added support for multiple sniffer rules containing filter/age/params. 2023-05-18 15:25:14 +03:00
marian 4c2de15148 Added String methods used to append using printf.
Added static String methods to be used with plain C strings: starts/end check, skip string or characters in given set.
Added support to build an AutoGenObject not owning the pointer.
MatchingItem: added dump support, added matching parameters, added random matching.
2023-05-18 15:10:38 +03:00
marian 4b9310defc Added missing virtual to Socket::accept(). 2023-05-18 14:48:26 +03:00
Ioana Stanciu 75bd7e1ee6 Add base class for capture packet class.
Add base classes for capturing packets: CaptureInfo and Capture.
Allow installing filter in sockets for sending packets also.
2023-05-15 16:47:07 +03:00
marian c7e3515eed Fixed return of matching item description. 2023-03-31 13:22:08 +03:00
marian ebf8bcc9b2 Added support for multiple filters in MessageHandler.
Added javascript matching item class.
Added javascript support to set multiple filters when installing message handlers.
2023-03-27 16:07:39 +03:00
marian e53907837b Added matching item classes to be used for multiple parameter(s) matching.
Includes support to match using regular expressions and list of matching items.
Conditions may be negated.
2023-03-27 15:55:48 +03:00
marian 3555ac0631 Fixed ObjVector::resize bug: properly calculate number of elements to resize. 2023-03-23 10:41:34 +02:00
marian 3436092371 Added javascript support for callback function set when a message is enqueued by a script. Call the function after message was dispatched. 2023-03-15 16:58:21 +02:00
Ioana Stanciu cc9c0fc206 Re-written the Wireshark message sniffer module. 2023-03-10 13:57:59 +02:00
Ioana Stanciu c55039b3eb Ignore .git directory when creating a tarball.
Fix writing of current hash in file when generating a tarball.
2023-03-09 14:19:46 +02:00
Ioana Stanciu 53ef2e0492 Add forgotten dependencies to srpm-tag and rpm-tag build targets. 2023-03-07 18:33:02 +02:00