- Jan 09, 2023
-
-
George Joseph authored
----------------- This commit reinstates MES with some casting fixes to the functions in time.h that convert between doubles and timeval structures. The casting issues were causing incorrect timestamps to be calculated which caused transcoding from/to G722 to produce bad or no audio. ASTERISK-30391 ----------------- This module has been updated to provide additional quality statistics in the form of an Asterisk Media Experience Score. The score is avilable using the same mechanisms you'd use to retrieve jitter, loss, and rtt statistics. For more information about the score and how to retrieve it, see https://wiki.asterisk.org/wiki/display/AST/Media+Experience+Score * Updated chan_pjsip to set quality channel variables when a call ends. * Updated channels/pjsip/dialplan_functions.c to add the ability to retrieve the MES along with the existing rtcp stats when using the CHANNEL dialplan function. * Added the ast_debug_rtp_is_allowed and ast_debug_rtcp_is_allowed checks for debugging purposes. * Added several function to time.h for manipulating time-in-samples and times represented as double seconds. * Updated rtp_engine.c to pass through the MES when stats are requested. Also debug output that dumps the stats when an rtp instance is destroyed. * Updated res_rtp_asterisk.c to implement the calculation of the MES. In the process, also had to update the calculation of jitter. Many debugging statements were also changed to be more informative. * Added a unit test for internal testing. The test should not be run during normal operation and is disabled by default. Change-Id: I4fce265965e68c3fdfeca55e614371ee69c65038
-
George Joseph authored
This reverts commit d454801c. Reason for revert: Issue when transcoding to/from g722 Change-Id: I09f49e171b1661548657a9ba7a978c29d0b5be86
-
- Jan 03, 2023
-
-
George Joseph authored
When Asterisk receives a new websocket conenction, it creates a new pjsip transport for it and copies connection data into it. The transport manager then uses the remote IP address and port on the transport to create a monitor for each connection. However, the remote port wasn't being copied, only the IP address which meant that the transport manager was creating only 1 monitoring entry for all websocket connections from the same IP address. Therefore, if one of those connections failed, it deleted the transport taking all the the connections from that same IP address with it. * We now copy the remote port into the created transport and the transport manager behaves correctly. ASTERISK-30369 Change-Id: Ib506d40897ea6286455ac0be4dfbb0ed43b727e1
-
Holger Hans Peter Freyther authored
Do not crash when a URL has no path component as in this case the ast_uri_path function will return NULL. Make the code cope with not having a path. The below would crash > media cache create http://google.com /tmp/foo.wav Thread 1 "asterisk" received signal SIGSEGV, Segmentation fault. 0x0000ffff836616cc in strrchr () from /lib/aarch64-linux-gnu/libc.so.6 (gdb) bt #0 0x0000ffff836616cc in strrchr () from /lib/aarch64-linux-gnu/libc.so.6 #1 0x0000ffff43d43a78 in file_extension_from_string (str=<optimized out>, buffer=buffer@entry=0xffffca9973c0 "", capacity=capacity@entry=64) at res_http_media_cache.c:288 #2 0x0000ffff43d43bac in file_extension_from_url_path (bucket_file=bucket_file@entry=0x3bf96568, buffer=buffer@entry=0xffffca9973c0 "", capacity=capacity@entry=64) at res_http_media_cache.c:378 #3 0x0000ffff43d43c74 in bucket_file_set_extension (bucket_file=bucket_file@entry=0x3bf96568) at res_http_media_cache.c:392 #4 0x0000ffff43d43d10 in bucket_file_run_curl (bucket_file=0x3bf96568) at res_http_media_cache.c:555 #5 0x0000ffff43d43f74 in bucket_http_wizard_create (sorcery=<optimized out>, data=<optimized out>, object=<optimized out>) at res_http_media_cache.c:613 #6 0x0000000000487638 in bucket_file_wizard_create (sorcery=<optimized out>, data=<optimized out>, object=<optimized out>) at bucket.c:191 #7 0x0000000000554408 in sorcery_wizard_create (object_wizard=object_wizard@entry=0x3b9f0718, details=details@entry=0xffffca9974a8) at sorcery.c:2027 #8 0x0000000000559698 in ast_sorcery_create (sorcery=<optimized out>, object=object@entry=0x3bf96568) at sorcery.c:2077 #9 0x00000000004893a4 in ast_bucket_file_create (file=file@entry=0x3bf96568) at bucket.c:727 #10 0x00000000004f877c in ast_media_cache_create_or_update (uri=0x3bfa1103 "https://google.com", file_path=0x3bfa1116 "/tmp/foo.wav", metadata=metadata@entry=0x0) at media_cache.c:335 #11 0x00000000004f88ec in media_cache_handle_create_item (e=<optimized out>, cmd=<optimized out>, a=0xffffca9976b8) at media_cache.c:640 ASTERISK-30375 #close Change-Id: I6a9433688cb5d3d4be8758b7642d923bdde6c273
-
George Joseph authored
This module has been updated to provide additional quality statistics in the form of an Asterisk Media Experience Score. The score is avilable using the same mechanisms you'd use to retrieve jitter, loss, and rtt statistics. For more information about the score and how to retrieve it, see https://wiki.asterisk.org/wiki/display/AST/Media+Experience+Score * Updated chan_pjsip to set quality channel variables when a call ends. * Updated channels/pjsip/dialplan_functions.c to add the ability to retrieve the MES along with the existing rtcp stats when using the CHANNEL dialplan function. * Added the ast_debug_rtp_is_allowed and ast_debug_rtcp_is_allowed checks for debugging purposes. * Added several function to time.h for manipulating time-in-samples and times represented as double seconds. * Updated rtp_engine.c to pass through the MES when stats are requested. Also debug output that dumps the stats when an rtp instance is destroyed. * Updated res_rtp_asterisk.c to implement the calculation of the MES. In the process, also had to update the calculation of jitter. Many debugging statements were also changed to be more informative. * Added a unit test for internal testing. The test should not be run during normal operation and is disabled by default. ASTERISK-30280 Change-Id: I458cb9a311e8e5dc1db769b8babbcf2e093f107a
-
- Dec 20, 2022
-
-
Naveen Albert authored
Currently, there is no Caller ID available to us when checking for an extension match when handling INVITEs. As a result, extension patterns that depend on the Caller ID are not matched and calls may be incorrectly rejected. The Caller ID is not available because the supplement that adds Caller ID to the session does not execute until after this check. Supplement callbacks cannot yet be executed at this point since the session is not yet in the appropriate state. To fix this without impacting existing behavior, the Caller ID number is now retrieved before attempting to pattern match. This ensures pattern matching works correctly and there is no behavior change to the way supplements are called. ASTERISK-28767 #close Change-Id: Iec7f5a3b90e51b65ccf74342f96bf80314b7cfc7
-
Ben Ford authored
When a call is put on hold and it has moh_passthrough and rtp_timeout set on the endpoint, the wrong timeout will be used. rtp_timeout_hold is expected to be used, but rtp_timeout is used instead. This change adds a couple of checks for locally_held to determine if rtp_timeout_hold needs to be used instead of rtp_timeout. ASTERISK-30350 Change-Id: I7b106fc244332014216d12bba851cefe884cc25f
-
Igor Goncharovsky authored
Fix aor lookup on sip path addition. Issue happens in case of dialing with @ and overriding user part of RURI. ASTERISK-30100 #close Reported-by: Yury Kirsanov Change-Id: I3f2c42a583578c94397b113e32ca3ebf2d600e13
-
- Dec 13, 2022
-
-
Alexandre Fournier authored
The `ast_geoloc_datastore_add_eprofile` function does not return 0 on success, it returns the size of the underlying datastore. This means that the datastore will be freed and its pointer set to NULL when no error occured at all. ASTERISK-30346 Change-Id: Iea9b209bd1244cc57b903b9496cb680c356e4bb9
-
Joshua C. Colp authored
When adding AOC to an outgoing response the code assumed that a body would exist for comparing the Content-Type. This isn't always true. The code now checks to make sure the response has a body before checking the Content-Type. ASTERISK-21502 Change-Id: Iaead371434fc3bc693dad487228106a7d7a5ac76
-
- Dec 09, 2022
-
-
Michael Kuron authored
chan_sip supported sending AOC-D and AOC-E information in SIP INFO messages in an "AOC" header in a format that was originally defined by Snom. In the meantime, ETSI TS 124 647 introduced an XML-based AOC format that is supported by devices from multiple vendors, including Snom phones with firmware >= 8.4.2 (released in 2010). This commit adds a new res_pjsip_aoc module that inserts AOC information into outgoing messages or sends SIP INFO messages as described below. It also fixes a small issue in res_pjsip_session which didn't always call session supplements on outgoing_response. * AOC-S in the 180/183/200 responses to an INVITE request * AOC-S in SIP INFO (if a 200 response has already been sent or if the INVITE was sent by Asterisk) * AOC-D in SIP INFO * AOC-D in the 200 response to a BYE request (if the client hangs up) * AOC-D in a BYE request (if Asterisk hangs up) * AOC-E in the 200 response to a BYE request (if the client hangs up) * AOC-E in a BYE request (if Asterisk hangs up) The specification defines one more, AOC-S in an INVITE request, which is not implemented here because it is not currently possible in Asterisk to have AOC data ready at this point in call setup. Once specifying AOC-S via the dialplan or passing it through from another SIP channel's INVITE is possible, that might be added. The SIP INFO requests are sent out immediately when the AOC indication is received. The others are inserted into an appropriate outgoing message whenever that is ready to be sent. In the latter case, the XML is stored in a channel variable at the time the AOC indication is received. Depending on where the AOC indications are coming from (e.g. PRI or AMI), it may not always be possible to guarantee that the AOC-E is available in time for the BYE. Successfully tested AOC-D and both variants of AOC-E with a Snom D735 running firmware 10.1.127.10. It does not appear to properly support AOC-S however, so that could only be tested by inspecting SIP traces. ASTERISK-21502 #close Reported-by:
Matt Jordan <mjordan@digium.com> Change-Id: Iebb7ad0d5f88526bc6629d3a1f9f11665434d333
-
Joshua C. Colp authored
When passing a JSON body to the 'create' channel route it would be converted into Asterisk variables, but never freed resulting in a memory leak. This change makes it so that the variables are freed in all cases. ASTERISK-30344 Change-Id: I924dbd866a01c6073e2d6fb846ccaa27ef72d49d
-
Marcel Wagner authored
This fixes a small typo in the from_domain documentation on the endpoint documentation ASTERISK-30328 #close Change-Id: Ia6f0897c3f5cab899ef2cde6b3ac07265b8beb21
-
Naveen Albert authored
Adds support for the capture agent name field of the Homer protocol to Asterisk by allowing users to specify a name that will be sent to the HEP server. ASTERISK-30322 #close Change-Id: I6136583017f9dd08daeb8be02f60fb8df4639a2b
-
- Dec 08, 2022
-
-
Naveen Albert authored
Some SIP devices use an empty extension for PLAR functionality. Rather than rejecting these empty extensions, we now use the s extension for such calls to mirror the existing PLAR functionality in Asterisk (e.g. chan_dahdi). ASTERISK-30265 #close Change-Id: I0861a405cd49bbbf532b52f7b47f0e2810832590
-
Marcel Wagner authored
Updates the documentation for the 'contact_user' field to point out the default outbound contact if no contact_user is specified 's' ASTERISK-30316 #close Change-Id: I61f24fb9164e4d07e05908a2511805281874c876
-
Naveen Albert authored
The commit that rearchitected media formats, a2c912e9 (ASTERISK_23114) introduced a regression by improperly translating code in res_adsi.c. In particular, the pointer to the frame buffer was initialized at the top of adsi_careful_send, rather than dynamically updating it for each frame, as is required. This resulted in the first frame being repeatedly sent, rather than advancing through the frames. This corrupted the transmission of the CAS to the CPE, which meant that CPE would never respond with the DTMF acknowledgment, effectively completely breaking ADSI functionality. This issue is now fixed, and ADSI now works properly again. ASTERISK-29793 #close Change-Id: Icdeddf733eda2981c98712d1ac9cddc0db507dbe
-
Naveen Albert authored
Adds support for custom URI and header parameters in the From header in PJSIP. Parameters can be both set and read using this function. ASTERISK-30150 #close Change-Id: Ifb1bc3c512ad5f6faeaebd7817f004a2ecbd6428
-
- Dec 03, 2022
-
-
George Joseph authored
It was possible for a module that registered for transport monitor events to pass in a pjsip_transport that had already been freed. This caused pjsip_transport_events to crash when looking up the monitor for the transport. The fix is a two pronged approach. 1. We now increment the reference count on pjsip_transports when we create monitors for them, then decrement the count when the transport is going to be destroyed. 2. There are now APIs to register and unregister monitor callbacks by "transport key" which is a string concatenation of the remote ip address and port. This way the module needing to monitor the transport doesn't have to hold on to the transport object itself to unregister. It just has to save the transport_key. * Added the pjsip_transport reference increment and decrement. * Changed the internal transport monitor container key from the transport->obj_name (which may not be unique anyway) to the transport_key. * Added a helper macro AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR() that fills a buffer with the transport_key using a passed-in pjsip_transport. * Added the following functions: ast_sip_transport_monitor_register_key ast_sip_transport_monitor_register_replace_key ast_sip_transport_monitor_unregister_key and marked their non-key counterparts as deprecated. * Updated res_pjsip_pubsub and res_pjsip_outbound_register to use the new "key" monitor functions. NOTE: res_pjsip_registrar also uses the transport monitor functionality but doesn't have a persistent object other than contact to store a transport key. At this time, it continues to use the non-key monitor functions. ASTERISK-30244 Change-Id: I1a20baf2a8643c272dcf819871d6c395f148f00b
-
- Nov 29, 2022
-
-
Maximilian Fridrich authored
This PR contains two relatively separate changes in channel.c and res_pjsip_session.c which ensure that topology changes are not ignored in cases where they should be handled. For channel.c: The function ast_channel_request_stream_topology_change only triggers a stream topology request change indication, if the channel's topology does not equal the requested topology. However, a channel could be in a state where it is currently "negotiating" a new topology but hasn't updated it yet, so the topology request change would be lost. Channels need to be able to handle such situations internally and stream topology requests should therefore always be passed on. In the case of chan_pjsip for example, it queues a session refresh (re-INVITE) if it is currently in the middle of a transaction or has pending requests (among other reasons). Now, ast_channel_request_stream_topology_change always indicates a stream topology request change even if the requested topology equals the channel's topology. For res_pjsip_session.c: The function resolve_refresh_media_states does not process stream state changes if the delayed active state differs from the current active state. I.e. if the currently active stream state has changed between the time the sip session refresh request was queued and the time it is being processed, the session refresh is ignored. However, res_pjsip_session contains logic that ensures that session refreshes are queued and re-queued correctly if a session refresh is currently not possible. So this check is not necessary and led to some session refreshes being lost. Now, a session refresh is done even if the delayed active state differs from the current active state and it is checked whether the delayed pending state differs from the current active - because that means a refresh is necessary. Further, the unit test of resolve_refresh_media_states was adapted to reflect the new behavior. I.e. the changes to delayed pending are prioritized over the changes to current active because we want to preserve the original intention of the pending state. ASTERISK-30184 Change-Id: Icd0703295271089057717006730b555b9a1d4e5a
-
- Nov 16, 2022
-
-
Joshua C. Colp authored
The "RECORD FILE" command in res_agi has its own implementation for actually doing the recording. This has resulted in it not actually obeying the option "transmit_silence" when recording. This change causes it to now send silence if the option is enabled. ASTERISK-30314 Change-Id: Ib3a85601ff35d1b904f836691bad8a4b7e957174
-
- Oct 31, 2022
-
-
Mike Bradeen authored
When a websocket (or potentially any stateful connection) is quickly created then destroyed, it is possible that the qualify thread will destroy the transaction before the initialzing thread is finished with it. Depending on the timing, this can cause an assertion within pjsip. To prevent this, ast_send_stateful_response will now create the group lock and add a reference to it before creating the transaction. While this should resolve the crash, there is still the potential that the contact will not be cleaned up properly, see:ASTERISK~29286. As a result, the contact has to 'time out' before it will be removed. ASTERISK-28689 Change-Id: Id050fded2247a04d8f0fc5b8a2cf3e5482cb8cee
-
- Oct 28, 2022
-
-
Igor Goncharovsky authored
Current registration code use pjsip_parse_uri to verify outbound_proxy that is different from the reading this option for the endpoint. This made value with multiple proxies invalid for registration pjsip settings. Removing URI validation helps to use registration through multiple proxies. ASTERISK-30217 #close Change-Id: I064558e66f04b9f3260c46181812a01349761357
-
- Oct 27, 2022
-
-
Naveen Albert authored
Fix compilation errors caused by using size_t instead of uintmax_t and non-portable format specifiers. ASTERISK-30273 #close Change-Id: I363e6057ef84d54b88af80d23ad6147eef9216ee
-
Henning Westerholt authored
Currently chan_pjsip on receiving a re-INVITE without SDP will only return the codecs that are previously negotiated and not offering all enabled codecs. This causes interoperability issues with different equipment (e.g. from Cisco) for some of our customers and probably also in other scenarios involving 3PCC infrastructure. According to RFC 3261, section 14.2 we SHOULD return all codecs on a re-INVITE without SDP The PR proposes a new parameter to configure this behaviour: all_codecs_on_empty_reinvite. It includes the code, documentation, alembic migrations, CHANGES file and example configuration additions. ASTERISK-30193 #close Change-Id: I69763708d5039d512f391e296ee8a4d43a1e2148
-
Naveen Albert authored
The PJSIP notify CLI commands allow for using "options" configured in pjsip_notify.conf. This allows these same options to be used in AMI actions as well. Additionally, as part of this improvement, some repetitive common code is refactored. ASTERISK-30263 #close Change-Id: Ie4496b322b63b61eaf9672183a959ab99a04b6b5
-
Naveen Albert authored
Expands the pjsip logger to support the ability to filter by SIP message method. This can make certain types of SIP debugging easier by only logging messages of particular method(s). ASTERISK-30146 #close Co-authored-by:
Sean Bright <sean@seanbright.com> Change-Id: I9c8cbb6fc8686ef21190eb42e08bc9a9b147707f
-
- Oct 26, 2022
-
-
Naveen Albert authored
pjproject does not provide any mechanism of removing event packages, which means that once a subscription handler is registered, it is effectively permanent. pjproject will assert if the same event package is ever registered again, so currently unloading and loading any Asterisk modules that use subscriptions will cause a crash that is beyond our control. For that reason, we now prevent users from being able to unload these modules, to prevent them from ever being loaded twice. ASTERISK-30264 #close Change-Id: I7fdcb1a5e44d38b7ba10c44259fe98f0ae9bc12c
-
- Oct 14, 2022
-
-
Philip Prindeville authored
ASTERISK-30213 #close Change-Id: I4a77143d41615b7c4fc25bb1251c0a9cb87b417a
-
- Oct 11, 2022
-
-
Mike Bradeen authored
Add enum to allow setting optional direction. If set to only one direction, only feed matching-direction frames to the associated slin factory. This prevents mangling the transcoder on non-mixed frames when the READ and WRITE frames would have otherwise required it. Also removes the need to mute or discard the un-wanted frames as they are no longer added in the first place. res_stasis_snoop is changed to use this addition to set direction on audiohook based on spy direction. If no direction is set, the ast_audiohook_init will init this enum to BOTH which maintains existing functionality. ASTERISK-30252 Change-Id: If8716bad334562a5d812be4eeb2a92e4f3be28eb
-
- Oct 10, 2022
-
-
Naveen Albert authored
Adds support for detecting audible ringback tone to the TONE_DETECT function using the p option. ASTERISK-30254 #close Change-Id: Ie2329ff245248768367d26749c285fbe823f6414
-
Philip Prindeville authored
"fname" is passed in as a const char *, but strstr() mangles that into a char *, and we were attempting to modify the string in place. This is an unwanted (and undocumented) side-effect. ASTERISK-30213 Change-Id: Ifa36d352aafeb7f9beec3f746332865c7d21e629
-
Philip Prindeville authored
ASTERISK-30213 Change-Id: I115f5f8942ffcfb23cd2559a55bac8a2eba081e0
-
George Joseph authored
Also added a note to the geolocation.conf.sample file and added a README to the res/res_geolocation/wiki directory. Change-Id: I89c3c5db8c0701b33127993622d5e4f904bddfbc
-
- Sep 29, 2022
-
-
Maximilian Fridrich authored
This patch adds support for mediasec SIP headers and SDP attributes. These are defined in RFC 3329, 3GPP TS 24.229 and draft-dawes-sipcore-mediasec-parameter. The new features are implemented so that a backbone for RFC 3329 is present to streamline future work on RFC 3329. With this patch, Asterisk can communicate with Deutsche Telekom trunks which require these fields. ASTERISK-30032 Change-Id: Ia7f5b5ba42db18074fdd5428c4e1838728586be2
-
- Sep 27, 2022
-
-
Holger Hans Peter Freyther authored
Avoid crashing by skipping invisible bridges and checking the snapshot for a null pointer. In effect this is how the bridges are enumerated in res/ari/resource_bridges.c already. ASTERISK-30239 ASTERISK-30237 Change-Id: I58ef9f44036feded5966b5fc70ae754f8182883d
-
- Sep 26, 2022
-
-
Naveen Albert authored
If geolocation is not in use for an endpoint, the NOTICE log level is currently spammed with messages about this, even though nothing is wrong and these messages provide no real value. These log messages are therefore changed to debugs. ASTERISK-30241 #close Change-Id: I656b355d812f67cc0f0fdf09b00b0e1458598bb4
-
- Sep 22, 2022
-
-
Maximilian Fridrich authored
This patch adds a new option to the 100rel parameter for pjsip endpoints called "peer_supported". When an endpoint with this option receives an incoming request and the request indicated support for the 100rel extension, then Asterisk will send 1xx responses reliably. If the request did not indicate 100rel support, Asterisk sends 1xx responses normally. ASTERISK-30158 Change-Id: Id6d95ffa8f00dab118e0b386146e99f254f287ad
-
- Sep 16, 2022
-
-
George Joseph authored
Fixed "may be used uninitialized" errors in geoloc_config.c. ASTERISK-30234 Change-Id: I1ea336bf7abbc16fa59b75720f0db8f1d960b3d4
-
- Sep 15, 2022
-
-
Philip Prindeville authored
ASTERISK-30226 #close Change-Id: I5695fb0c9521f112f754b8362cff2a8f3eff05c5
-