summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-04-30res_pjsip_outbound_registration: Fix double unref on error return.Joshua Colp
When the PJSIP pjsip_regc_send function is invoked and an error status returned the caller currently decrements the reference count of the client state that it just incremented, assuming the registration callback would not have been invoked. In practice this is not correct. If the failure happens after the transaction has been set up the callback will still be invoked. This will cause the reference count to be incorrectly decremented twice, once by the registration callback and second by the caller of pjsip_regc_send. This change makes it so that whether the callback is invoked or not is known by the caller of pjsip_regc_send. Depending on this it can know whether it is responsible for decrementing the reference count of the client state or not. ASTERISK-25037 #close Reported by: Joshua Colp Change-Id: I749dc12f3a22115c49c5d7d95ff42a5fa45319de
2015-04-29Merge "ARI: Fix missing dependencies."Matt Jordan
2015-04-29Merge "res_fax: allow 2400 transmission rate according to v.27ter standard"Matt Jordan
2015-04-29main/rtp_engine: Fix DTLS double-free introduced by 0b6410c4f8Matt Jordan
The patch in 0b6410c4f8 did correctly fix a memory leak of the DTLS structures in the RTP engine. However, when a 'core reload' is issued, a double free of the memory pointed to by the char *'s in the DTLS configuration struct can occur, as ast_rtp_dtls_cfg_free does not set the pointers to NULL when they are freed. This patch sets those pointers to NULL, preventing a second call to ast_rtp_dtls_cfg_free from corrupting memory. ASTERISK-25022 Change-Id: I820471e6070a37e3c26f760118c86770e12f6115
2015-04-29Merge "cdr/cdr_csv.c: Add missing space after comma."Mark Michelson
2015-04-29res_fax: allow 2400 transmission rate according to v.27ter standardKevin Harwell
A previous set of patches (see: ASTERISK-22790 & ASTERISK-23231) made it so a v.27 modem was not allowed to have a minimum transmission rate of 2400 bits per second. This reverts all or some of those patches since according to the v.27ter standard a rate of 2400 bits per second is also supported. One of the original patches also added 9600 bits per second support for v.27. This patch also removes that since v.27ter only supports 2400/4800 bits per second. Also, since Asterisk specifically supports v.27ter the enum was renamed to better reflect this. ASTERISK-24955 #close Reported by: Matt Jordan Change-Id: I4b9dfb6bf7eff08463ab47ee1a74224f27cae733
2015-04-29Merge "Astobj2: Add ao2_weakproxy_ref_object function."Matt Jordan
2015-04-29Merge "res_pjsip_outbound_registration: Don't fail on delayed processing."Joshua Colp
2015-04-29Astobj2: Add ao2_weakproxy_ref_object function.Corey Farrell
This function allows code to run ao2_ref against the real object associated with a weakproxy. It is useful when all of the following conditions are true: * You have a pointer to weakproxy. * You do not have or need a pointer to the real object. * You need to ensure the real object exists and is not destroyed during a process. In this case it's wasteful to store a pointer to the real object just for the sake of releasing it later. Change-Id: I38a319b83314de75be74207a8771aab269bcca46
2015-04-29Merge "Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE."Mark Michelson
2015-04-29res_pjsip_outbound_registration: Don't fail on delayed processing.Mark Michelson
Odd behaviors have been observed during outbound registrations. The most common problem witnessed has been one where a request with authentication credentials cannot be created after receiving a 401 response. Other behaviors include apparently processing an incorrect SIP response. Inspecting the code led to an apparent issue with regards to how we handle transactions in outbound registration code. When a response to a REGISTER arrives, we save a pointer to the transaction and then push a task onto the registration serializer. Between the time that we save the pointer and push the task, it's possible for the transaction to be destroyed due to a timeout. It's also possible for the address to be reused by the transaction layer for a new transaction. To allow for authentication of a REGISTER request to be authenticated after the transaction has timed out, we now hold a reference to the original REGISTER request instead of the transaction. The function for creating a request with authentication has been altered to take the original request instead of the transaction where the original request was sent. ASTERISK-25020 Reported by Mark Michelson Change-Id: I756c19ab05ada5d0503175db9676acf87c686d0a
2015-04-29res_sorcery_config: Fix build issue due to syntax error.Joshua Colp
Change-Id: Ic8322f04e37842848ad72cf2871bd0378f67c4ac
2015-04-29Merge "chan_pjsip: Creating Channel Causes Asterisk to Crash When Duplicate ↵Matt Jordan
AOR Sections Exist in pjsip.conf"
2015-04-29Merge topic 'ASTERISK-25027'Matt Jordan
* changes: res_pjsip: Remove incorrect MODULEINFO from presence_xml.c. Git Migration: Create doc/rest-api when needed.
2015-04-29Merge "Build System: Prevent unneeded changes to asterisk/buildopts.h."Matt Jordan
2015-04-29ARI: Fix missing dependencies.Corey Farrell
ARI modules that are generated by 'make ari-stubs' are all dependent on res_ari_model. Additionally some of the same modules depend on one or more res_stasis_* modules. ASTERISK-25027 #close Reported by: Corey Farrell Change-Id: I8e07fe7e81fedacb87232f2b6f8b5f47927b4153
2015-04-29res_pjsip: Remove incorrect MODULEINFO from presence_xml.c.Corey Farrell
Remove incorrect MODULEINFO block and unneeded header includes from presence_xml.c. ASTERISK-25027 Reported by: Corey Farrell Change-Id: I977c609ab9d1fe05373027c4138900f6985990eb
2015-04-29Git Migration: Create doc/rest-api when needed.Corey Farrell
Create the directory './doc/rest-api' at the start of 'make ari-stubs' to prevent an error when documentation is generated. The directory is also added to git ignores. ASTERISK-25027 Reported by: Corey Farrell Change-Id: Iaccc7f0138501c23aa78feaca2f3cce9e68cbc1b
2015-04-29Merge "chan_iax2: Ensure that IAX flags are 64 bits."Joshua Colp
2015-04-29Build System: Prevent unneeded changes to asterisk/buildopts.h.Corey Farrell
* Add AST_DEVMODE to BUILDOPTS * Use BUILDOPTS to generate AST_BUILDOPT_SUM. * Remove loop that defined AST_MODULE_* These changes ensure that only ABI effecting options are considered for AST_BUILDOPT_SUM. This also reduces unneeded full system rebuilds caused by enabling or disabling one module that another is dependent on. ASTERISK-25028 #close Reported by: Corey Farrell Change-Id: I2c516d93df9f6aaa09ae079a8168c887a6ff93a2
2015-04-29Git Conversion: Switch Non-C files to ASTERISK_REGISTER_FILE.Corey Farrell
This switches files used to generate other sources to use the new ASTERISK_REGISTER_FILE macro. ASTERISK-25026 #close Reported by: Corey Farrell Change-Id: Ieb2537b83421cad07c8955e5f90c405ccf079740
2015-04-28Merge "res_pjsip_outbound_registration: Add debugging messages."Joshua Colp
2015-04-28Merge "CHANGES: Add missing spaces."Mark Michelson
2015-04-28chan_iax2: Ensure that IAX flags are 64 bits.Yousf Ateya
Flags are 64 bits. Without LLU suffix the value of 1<<31 is negative. Although it doesn't have an effect on the current implementation, it will be problem if more flags are added. Change-Id: Ic290c81cfbbbf062872392d99d3322932cc49487
2015-04-28chan_pjsip: Creating Channel Causes Asterisk to Crash When Duplicate AORAshley Sanders
Sections Exist in pjsip.conf This patch modifies the current loading strategy of the pjsip configuration. If duplicate sections (e.g. sections containing the same [id/type]) are defined in [pjsip.conf], the loader will consider the configuration for the given type as invalid when the duplicate section is encountered. The entire configuration (including what was previously loaded) for the duplicate [id/type] sections will be rejected and destroyed, an error message is logged and the load processing for the given stops. ASTERISK-24996 Reported By: Ashley Sanders Change-Id: I35090ca4cd40f1f34881dfe701a329145c347aef
2015-04-28chan_vpb: Fix compile error due to use of ASTERISK_FILE_VERSION.Richard Mudgett
Change-Id: I51179e2a83937423676da522b766f1126de4059e
2015-04-28res_pjsip_outbound_registration: Add debugging messages.Mark Michelson
When problems occur regarding outbound registrations, it currently is difficult to debug. Most off-nominal paths had warning messages, but sometimes we want to know what's going on before hitting the off-nominal path. This patch adds lots of debugging output that should give a clearer picture of what is happening with regards to outbound registrations. ASTERISK-25020 Reported by Mark Michelson Change-Id: I577bde7860be0a6c872b5bcb4d5047340bf45d45
2015-04-28Merge "Example script for scan-build (the llvm static analyzer)"Joshua Colp
2015-04-28res_rtp_asterisk: Resolve 2 discrete memory leaks in DTLSSteve Davies
ao2 ref leak in res_rtp_asterisk.c when a DTLS policy is created. The resources are linked into a table, but the original alloc refs are never released. ast_strdup leak in rtp_engine.c. If ast_rtp_dtls_cfg_copy() is called twice on the same destination struct, a pointer to an alloc'd string is overwritten before the string is free'd. ASTERISK-25022 Reported by: one47 Change-Id: I62a8ceb8679709f6c3769136dc6aa9a68202ff9b
2015-04-28Merge "cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk ↵Joshua Colp
Version"
2015-04-28Merge "Astobj2: Allow reference debugging to be enabled/disabled by config."Matt Jordan
2015-04-28cdr/cdr_csv.c: Add missing space after comma.Rodrigo Ramírez Norambuena
Change-Id: I3866a20019b1a3a2f10fe36640053929330b0fcb
2015-04-27CHANGES: Add missing spaces.Rodrigo Ramírez Norambuena
Change-Id: I534ea0f22759e3633585dfa9b145b4a284efe67f
2015-04-27Astobj2: Allow reference debugging to be enabled/disabled by config.Corey Farrell
* The REF_DEBUG compiler flag no longer has any effect on code that uses Astobj2. It is used to determine if reference debugging is enabled by default. Reference debugging can be enabled or disabled in asterisk.conf. * Caller information is provided in logger errors for ao2 bad magic numbers. * Optimizes AO2 by merging internal functions with the public counterpart. This was possible now that we no longer require a dual ABI. ASTERISK-24974 #close Reported by: Corey Farrell Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
2015-04-27res_pjsip: Fix SEGV on pending-qualify contactsGeorge Joseph
Permanent contacts that hadn't been qualified yet were missing their contact_status entries causing SEGVs when running CLI commands. This patch makes sure that contact_statuses are created for both dynamic and permanent contacts when they are created. It also adds checks in the CLI code to make sure there's a contact_status, just in case. ASTERISK-25018 #close Reported-by: Ivan Poddubny Tested-by: Ivan Poddubny Tested-by: George Joseph Change-Id: I3cc13e5cedcafb24c400368b515b02d7fb81e029
2015-04-27cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk VersionRodrigo Ramírez Norambuena
Add new column to INSERT new columns added in cdr 1.8 version. The columns are: * peeraccount * linkedid * sequence This feature is configurable in cdr_odbc.conf using a new configuration option, 'newcdrcolumns'. ASTERISK-24976 #close Change-Id: Ibe0c7540a88305c6012786f438a0813ad8b19127
2015-04-26channels/chan_skinny: Fix compilation error introduced in f8e21a1adfMatt Jordan
A typo in commit f8e21a1adf resulted in a compilation error in chan_skinny. This patch fixes the typo. ASTERISK-24917 Change-Id: Id7f4ad1fe948eb2408622e80c27936ce4516c33c
2015-04-26Merge "Clang: Fix some more tautological-compare warnings."Matt Jordan
2015-04-24Merge "app_confbridge: Default the template option to a compatible default ↵Matt Jordan
profile."
2015-04-24Merge "res_pjsip_outbound_authenticator: Increase CSeq on authed requests."Matt Jordan
2015-04-24app_confbridge: Default the template option to a compatible default profile.Kevin Harwell
Confbridge dynamic profiles did not have a default profile unless you explicitly used Set(CONFBRIDGE(bridge,template)=default_bridge). If a template was not set prior to the bridge being created then some options were left with no default values set. This patch makes it so the default templates are set to the default bridge and user profiles. ASTERISK-24749 #close Reported by: philippebolduc Change-Id: I1bd6e94b38701ac2112d842db68de63d46f60e0a
2015-04-24Merge "CHANGES remove tab space"Joshua Colp
2015-04-24Merge "CREDITS: Update credits for Olle Johansson"Joshua Colp
2015-04-24CREDITS: Update credits for Olle JohanssonOlle E. Johansson
Change-Id: I8f3d0a6c3f1075a1f7d8308593394611a96749de
2015-04-24res_pjsip_outbound_authenticator: Increase CSeq on authed requests.Mark Michelson
The way PJSIP generates an authenticated request is to use a previous request as a template. This means that the authenticated request will have the same Call-ID, From header (including tag), and CSeq as the original request. PJSIP generates a new branch on the Via header to indicate that this is a new transaction, though. There are some SIP implementations, though, that do not notice the change in the branch and therefore will match the authed request to the original request's transaction. Since the CSeq is the same, the server will repeat the response it sent to the original request. This patch aids interoperability by increasing the CSeq of the authed request by one. ASTERISK-24845 #close Reported by: Carl Fortin Tested by: Carl Fortin Change-Id: I39c4ca52e688a9f83bcc1878371334becdc5be01
2015-04-24Clang: Fix some more tautological-compare warnings.Diederik de Groot
clang can warn about a so called tautological-compare, when it finds comparisons which are logically always true, and are therefor deemed unnecessary. Exanple: unsigned int x = 4; if (x > 0) // x is always going to be bigger than 0 Enum Case: Each enumeration is its own type. Enums are an integer type but they do not have to be *signed*. C leaves it up to the compiler as an implementation option what to consider the integer type of a particu- lar enumeration is. Gcc treats an enum without negative values as an int while clang treats this enum as an unsigned int. rmudgett & mmichelson: cast the enum to (unsigned int) in assert. The cast does have an effect. For gcc, which seems to treat all enums as int, the cast to unsigned int will eliminate the possibility of negative values being allowed. For clang, which seems to treat enums without any negative members as unsigned int, the cast will have no effect. If for some reason in the future a negative value is ever added to the enum the assert will still catch the negative value. ASTERISK-24917 Change-Id: Ief23ef68916192b9b72dabe702b543ecfeca0b62
2015-04-24Example script for scan-build (the llvm static analyzer)Diederik de Groot
- Added Pre-amble (Options / Flags / Usage Example / GNU License) - Extended Configurability - Made Executable ASTERISK-24917 Change-Id: I70405fe54e4be7dbfbcb62e291690069b88617a8
2015-04-24Merge "res_pjsip_t38: Don't crash on authenticated reinvite after originated ↵Matt Jordan
T.38 FAX."
2015-04-23Merge "Clang: change previous tautological-compare fixes."Mark Michelson
2015-04-23res_pjsip_t38: Don't crash on authenticated reinvite after originated T.38 FAX.Mark Michelson
When Asterisk originates a channel to an application, the channel is hung up once the application finishes executing. When the application in question is SendFax, the Asterisk PJSIP code will attempt to reinvite the T.38 session to audio after the FAX completes. The hangup of the channel happens in the midst of this reinvite transaction. In most circumstances, this works out okay because the BYE is delayed until the reinvite transaction can complete. However, if the reinvite that Asterisk sends receives a 401/407 response, then Asterisk's attempt to re-send the reinvite with authentication will fail. This is because the session supplement in res_pjsip_t38 makes the assumption that the channel on the session will always be non-NULL. Since the channel has been hung up, though, the channel is now NULL. Attempting to operate on the channel causes a crash. This patch fixes the issue by ensuring that the channel on the session is not NULL before attempting to mess with the T.38 framehook. This patch also contains some corrections for comments that were incorrect and really confused me when I first started looking at the code. ASTERISK-25004 #close Reported by Mark Michelson Change-Id: Ic5a1230668369dda4bb13524098aed9306ab45a0