Commit Graph

1491 Commits

Author SHA1 Message Date
Harald Welte 6622ed077c 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.
2022-10-17 21:19:26 +02:00
Harald Welte e8fbf511e3 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)
2022-09-11 14:29:56 +02:00
Harald Welte 203ee7a1d4 iax: Support the new CALLINGANI2 IE
This was introduced in Asterisk IAX2 in
3072c540bb
2022-09-11 14:29:50 +02:00
Harald Welte dc005d1fad 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)
2022-03-08 14:19:19 +01:00
Harald Welte 02ab7441ae preserve transfer-capability in Q.931 -> Q.931 calls
This is important so udi/rdi doesn't get converted to speech.
2022-03-08 08:26:42 +01:00
Harald Welte 4679853a20 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
2022-03-08 08:26:42 +01:00
oana 71206f078c Add support for building and running multiple instances of the same script.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6542 acf43c95-373e-0410-b603-e72c3f656dc1
2022-02-09 10:59:28 +00:00
marian 6cb563308f Added array method used to push strings from list.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6536 acf43c95-373e-0410-b603-e72c3f656dc1
2022-01-11 09:02:27 +00:00
marian 26ee35ea63 Fixed JSON reference resolve string comparison bug revealed by new compiler.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6528 acf43c95-373e-0410-b603-e72c3f656dc1
2021-11-25 18:02:25 +00:00
marian a95f965a0c Fixed JSON replaceReferences bug: check if object was already found when no replacements are done in it. Improved debug.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6526 acf43c95-373e-0410-b603-e72c3f656dc1
2021-10-27 12:43:59 +00:00
marian dead60e861 Added support for JSON Path (find value in object by path). Fixed JSON.stringify(): avoid crashing on circular references, replace already found objects by their path reference. Report path in Engine.dump_r for already found objects.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6525 acf43c95-373e-0410-b603-e72c3f656dc1
2021-10-27 10:22:53 +00:00
paulc 16462dbbd1 Changed priority of the JS specific operators.
Fixes problems introduced by Rev. 6511


git-svn-id: http://yate.null.ro/svn/yate/trunk@6515 acf43c95-373e-0410-b603-e72c3f656dc1
2021-08-16 10:52:48 +00:00
paulc a964723b52 Added missing precedence of the nullish operator.
Aligned operators precedence with JS.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6511 acf43c95-373e-0410-b603-e72c3f656dc1
2021-08-11 10:52:33 +00:00
marian 62217132de Improved debug.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6509 acf43c95-373e-0410-b603-e72c3f656dc1
2021-08-04 07:35:53 +00:00
paulc 11bcd6a7f8 Implemented the nullish concatenation and assignment operators.
Implemented the missing logical operation plus assignment.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6504 acf43c95-373e-0410-b603-e72c3f656dc1
2021-07-08 14:53:44 +00:00
paulc 885ed0b8ae Be systemmatic in adding the Param_ prefix to unknown parameters.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6503 acf43c95-373e-0410-b603-e72c3f656dc1
2021-07-06 11:54:01 +00:00
marian f7ce4dc6f0 Fixed bug: put alaw/mulaw in rtpmap dictionary start for proper matching when parsing receivd SDP.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6484 acf43c95-373e-0410-b603-e72c3f656dc1
2021-04-19 11:46:57 +00:00
marian 0b8f9b48cc Added SDP support for stereo slin/alaw/mulaw.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6483 acf43c95-373e-0410-b603-e72c3f656dc1
2021-04-19 10:02:58 +00:00
paulc 76c0d7ed08 Add the "name" property to functions.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6480 acf43c95-373e-0410-b603-e72c3f656dc1
2021-04-16 13:03:57 +00:00
paulc 19ec4ab0eb Added Object.global() to access the script's global object.
Write numbers to JSON using their internal string representation.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6478 acf43c95-373e-0410-b603-e72c3f656dc1
2021-04-16 09:57:46 +00:00
oana fdff04abd5 Clone a JsFunction when first assigned into another variable.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6477 acf43c95-373e-0410-b603-e72c3f656dc1
2021-04-12 08:55:18 +00:00
paulc b482039d8a Made behavior of Math abs, min and max more consistent with the standard.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6471 acf43c95-373e-0410-b603-e72c3f656dc1
2021-03-29 10:34:12 +00:00
paulc 6908f576cd Added support for retrieving the call stack and the call context.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6469 acf43c95-373e-0410-b603-e72c3f656dc1
2021-03-26 12:17:41 +00:00
oana 398a02fbad Add optional name parameter to ExpWrapper constructor.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6468 acf43c95-373e-0410-b603-e72c3f656dc1
2021-03-26 12:01:58 +00:00
oana 4a1090c2d6 Fix Object.keys() evaluation on object of type Message of Engine.Hashlist: use the object list of field names when possible.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6467 acf43c95-373e-0410-b603-e72c3f656dc1
2021-03-19 14:20:48 +00:00
marian 2122b71bf1 Avoid crash in javascript array concat() called for array(s) with holes (missing indexes).
git-svn-id: http://yate.null.ro/svn/yate/trunk@6463 acf43c95-373e-0410-b603-e72c3f656dc1
2021-03-03 13:59:52 +00:00
paulc 51b6cf6bfa Fixed several issues exposed by the Microsoft compiler.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6459 acf43c95-373e-0410-b603-e72c3f656dc1
2021-02-09 14:08:19 +00:00
paulc b6e3dc4304 Do not reset RTP timestamp offset after a sequence resync.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6458 acf43c95-373e-0410-b603-e72c3f656dc1
2021-01-28 13:38:55 +00:00
oana f9309ac9ed Fix issue introduced by commit 6442: make ExpNull::copy() method to have the same signature as the one from ExpWrapper in order to override it.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6455 acf43c95-373e-0410-b603-e72c3f656dc1
2020-11-20 16:02:02 +00:00
oana b971c2465a Add hashing functions for uint32, uint64 and pointer types.
Use pointer hashing function in accessing list that tracks JS objects.



git-svn-id: http://yate.null.ro/svn/yate/trunk@6448 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-30 13:56:33 +00:00
oana 153f5b35b9 Protect access to object tracking list of the script execution context.
Some objects are created outside of the context.



git-svn-id: http://yate.null.ro/svn/yate/trunk@6447 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-29 16:28:49 +00:00
oana cd07afa11d Bug fix: do not increase code line number when parsing '\n' from a string literal.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6446 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-29 14:46:07 +00:00
oana a4ba57411a Fix code line counting when parsing multi-line string.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6444 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-23 08:11:53 +00:00
oana 63eb336324 Add tracking for Javascript object creation and destruction.
Add command that reports how many objects are still alive that have been created at the reported code line.
Fix constructor for ConfigFile.



git-svn-id: http://yate.null.ro/svn/yate/trunk@6442 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-21 11:01:31 +00:00
paulc a3cfd6581e Fixed parser clamping of large negative numbers.
Added hack to parse floating point numbers but store them as integers.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6440 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-19 09:11:10 +00:00
marian eedf31e959 Added support to dump JsHashList items in print_r and toJSON.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6439 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-14 14:03:56 +00:00
marian c0db0b4817 Added print/dump_r functions used to print/dump a specific variable or script context using flags to filter what to print: props only (default), funcs only ...
git-svn-id: http://yate.null.ro/svn/yate/trunk@6437 acf43c95-373e-0410-b603-e72c3f656dc1
2020-10-14 10:38:31 +00:00
paulc b951faa062 Fixed build for 32 bit platforms.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6431 acf43c95-373e-0410-b603-e72c3f656dc1
2020-09-25 11:36:38 +00:00
oana 664e1391a6 Add command line argument for running YATE with a required affinity.
Add configuration for affinity of RTPGroup threads.



git-svn-id: http://yate.null.ro/svn/yate/trunk@6430 acf43c95-373e-0410-b603-e72c3f656dc1
2020-09-23 13:12:56 +00:00
marian 614ace3007 Fixed documentation.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6421 acf43c95-373e-0410-b603-e72c3f656dc1
2020-08-21 14:03:02 +00:00
marian 6031f15896 Avoid resetting started RTP when handling re-invite/update containing currently used codec.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6420 acf43c95-373e-0410-b603-e72c3f656dc1
2020-08-21 13:58:46 +00:00
marian 10596bdb18 Propagate rtp module debug enabler to library. Propagate rtp wrapper trace id to library. Added support to enable debug of sent/recv data and events.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6416 acf43c95-373e-0410-b603-e72c3f656dc1
2020-07-21 07:39:54 +00:00
marian 7fd35b99be Fixed bug: print a received answer to a request sent without trace id while tracing is enabled. Fixed bug: set channel's trace id when building a dialog message. Added configuration option to enable sip tracing.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6415 acf43c95-373e-0410-b603-e72c3f656dc1
2020-07-15 13:34:04 +00:00
marian 1eae4a0eee Postpone 'fmtp' and 'gpmd' lines processing until codec name is set. Fixes receiving non standard payload number with fmtp/gpmd line set before corresponding 'rtpmap' line.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6409 acf43c95-373e-0410-b603-e72c3f656dc1
2020-05-20 11:19:12 +00:00
oana 636e41a2cd Add support in SIP, SDP, RTP and CDR build for tracing a call.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6406 acf43c95-373e-0410-b603-e72c3f656dc1
2020-04-22 14:18:49 +00:00
oana 670f9746b7 Add Javascript implementation for trace debug methods.
Add a setTraceId() method in Engine that sets the trace ID in current runner. This then activates internally displaying the trace ID for any Engine.debug/output.alarm call from a script.



git-svn-id: http://yate.null.ro/svn/yate/trunk@6403 acf43c95-373e-0410-b603-e72c3f656dc1
2020-04-22 12:05:53 +00:00
oana e337f4bc3a Add option to stop execution of an outgoing call.
Propagate that parameter in dumb channel, tone generator and wave file.
In SIP, simulate going through the whole SIP stack before stopping execution of the call.



git-svn-id: http://yate.null.ro/svn/yate/trunk@6401 acf43c95-373e-0410-b603-e72c3f656dc1
2020-04-22 10:59:48 +00:00
oana 6965bec52f Add Engine methods for retrieving current line of source code being executed, current source file name and the concatenation of both.
Add Message.trace() method for tracking of message handling in JS code.



git-svn-id: http://yate.null.ro/svn/yate/trunk@6397 acf43c95-373e-0410-b603-e72c3f656dc1
2020-04-01 11:47:55 +00:00
paulc 94a3b70b42 Added support for retrieving the timezone at any time, not just now.
Fixed the Javascript Date getTimezoneOffset() result.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6396 acf43c95-373e-0410-b603-e72c3f656dc1
2020-04-01 07:38:14 +00:00
marian 354b2b278d Added capability to disable SDP forward from routing.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6393 acf43c95-373e-0410-b603-e72c3f656dc1
2020-03-09 07:15:06 +00:00