Commit Graph

25400 Commits

Author SHA1 Message Date
Matthew Jordan 9cee08f502 res_corosync: Update module to work with Stasis (and compile)
This patch fixes res_corosync such that it works with Asterisk 12. This
restores the functionality that was present in previous versions of
Asterisk, and ensures compatibility with those versions by restoring the
binary message format needed to pass information from/to them.

The following changes were made in the core to support this:
 * The event system has been partially restored. All event definition and
   event types in this patch were pulled from Asterisk 11. Previously, we had
   hoped that this information would live in res_corosync; however, the
   approach in this patch seems to be better for a few reasons:
   (1) Theoretically, ast_events can be used by any module as a binary
       representation of a Stasis message. Given the structure of an ast_event
       object, that information has to live in the core to be used universally.
       For example, defining the payload of a device state ast_event in
       res_corosync could result in an incompatible device state representation
       in another module.
   (2) Much of this representation already lived in the core, and was not
       easily extensible.
   (3) The code already existed. :-)
 * Stasis message types now have a message formatter that converts their
   payload to an ast_event object.
 * Stasis message forwarders now handle forwarding to themselves. Previously
   this would result in an infinite recursive call. Now, this simply creates a
   new forwarding object with no forwards set up (as it is the thing it is
   forwarding to). This is advantageous for res_corosync, as returning NULL
   would also imply an unrecoverable error. Returning a subscription in this
   case allows for easier handling of message types that are published directly
   to an aggregate topic that has forwarders.

Review: https://reviewboard.asterisk.org/r/3486/

ASTERISK-22912 #close
ASTERISK-22372 #close
........

Merged revisions 414330 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22 12:01:37 +00:00
Richard Mudgett 3bac303dc9 core_unreal: Only block media frames when a generator is on both ends of an unreal channel.
The fix for ASTERISK-12292 was a bit too aggressive.  You could have
generators pointed at each other on local channels but need to get other
kinds of frames such as DTMF or CONNECTED_LINE frames accross.
........

Merged revisions 414269 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 414270 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 414272 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-21 22:24:40 +00:00
Scott Griepentrog 43bd3580e2 pbx.c: prevent potential crash from recursive replace()
Recurisve usage of replace() resulted in corruption of the
temporary string storage and potential crash.  By changing
the string to be allocated separtely per instance, this is
eliminated.

ASTERISK-23650 #comment Reported by: Roel van Meer
ASTERISK-23650 #close

Review: https://reviewboard.asterisk.org/r/3539/
........

Merged revisions 414214 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 414215 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 414216 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-21 19:08:39 +00:00
Paul Belanger 4988d4932b Replace __ast_answer with ast_raw_answer in app_control_answer
While load testing an ARI application, I noticed asterisk was returning HTTP 500
internal server errors on channels/:id/answer.  After talking to #asterisk-dev,
the issue appeared to be a lack of media flowing after __ast_answer() was
called.  So now, we call ast_raw_answer instead and no longer wait for media.

ASTERISK-23758 #close
Review: https://reviewboard.asterisk.org/r/3549/
........

Merged revisions 414195 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-19 19:52:34 +00:00
Matthew Jordan 42a1dee02d Undo r414123
The Test Suite caught a few problems, undoing until those are resolved


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-19 01:10:23 +00:00
Matthew Jordan 17ff4d9282 bridge_native_rtp/bridge_channel: Fix direct media issues due to frame hook
This patch fixes issues with direct media bridges that occur after a blind
transfer. These issues were caught by the (currently failing)
pjsip/transfers/blind_transfer/caller_direct_media test.

The test currently fails primarily for two reasons:
(1) When Bob and Charlie (the transfer target and the transfer destination)
    enter a bridge together, the framehook remains on the transfer target
    channel until both channels are in the bridge. As it consumes voice frames,
    the initial bridge type is a simple bridge. The framehook is removed when
    both channels are in the bridge; however, this does not currently cause the
    bridging framework to re-evaluate the bridge. This patch adds a
    AST_SOFTHANGUP_UNBRIDGE poke to the transfer target channel when a
    framehook is removed so the bridge can re-evaluate itself.

(2) When a channel leaves a native RTP bridge, it may be leaving due to being
    hung up. Sending a re-INVITE to a channel that is about to be hung up is
    not nice - in fact, there's a good chance we'll send the BYE request before
    the channel has had a chance to send back a 200 OK. To be somewhat nicer,
    this patch adds a function to channel.h that allows the bridging framework
    to query for exactly why a channel is leaving a bridge via the channel's
    soft hangup flags. This allows it to only send the re-INVITE if there's a
    chance the channel will survive the native bridging experience.

Review: https://reviewboard.asterisk.org/r/3535/
........

Merged revisions 414122 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-18 20:38:02 +00:00
Richard Mudgett 4c252096ef chan_dahdi: Fix analog dialtone detection.
* Check if waitingfordt (waitfordialtone) is enabled in dahdi_read() to
allow the DSP to operate early enough to detect dialtone.

* Made use the correct variable in my_check_waitingfordt().

ASTERISK-23709 #close
Reported by: Steve Davies
Patches:
      dialtone_detect_fix (license #5012) patch uploaded by Steve Davies

Review: https://reviewboard.asterisk.org/r/3534/
........

Merged revisions 414067 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 414068 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 414069 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-16 20:06:59 +00:00
Richard Mudgett 6e2e38083d sig_pri.c: Pull the pri_dchannel() PRI_EVENT_RING case into its own function.
* Populate the CALLERID(ani2) value (and the special CALLINGANI2 channel
variable) with the ANI2 value in addition to the PRI specific ANI2 channel
variable.

* Made complete snapshot staging with the channel lock held.  All channel
snapshots need to be done while the channel lock is held.
........

Merged revisions 414050 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 414051 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-16 17:32:44 +00:00
Richard Mudgett d8c559a0dc app_meetme: Fix overwrite of DAHDI conference data structure.
Starting a conference recording using the admin menu overwrites the DAHDI
conference data structure used to modify the admin user's conference mute
mode.

* Made no longer pass the user's DAHDI conference data structure into the
menu functions.  The menu now uses its own DAHDI conference data
structure to start the recording channel.

* Moved the unlock conf->playlock to before playing the conf-full message.
No sense keeping the lock while that prompt is playing.  The user is never
going to get into the conference at that point.
........

Merged revisions 413991 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413992 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413993 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-15 22:02:32 +00:00
Walter Doekes 8fd6a88633 res_musiconhold: Minor cleanup.
Fix a few free()'s that should be ast_free()'s. Reverted an old
workaround that isn't necessary. Reorder a tiny bit of code.
Remove a bit of commented-out code.

Review: https://reviewboard.asterisk.org/r/3536/
........

Merged revisions 413894 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413895 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413896 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-14 15:41:42 +00:00
Jonathan Rose e81b873fa2 chan_sip: Add TLS and SRTP status to CLI command 'sip show channel'
ASTERISK-23564 #close
Reported by: Patrick Laimbock
Review: https://reviewboard.asterisk.org/r/3474/
........

Merged revisions 413876 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413877 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13 18:09:13 +00:00
Walter Doekes 0eda637fc4 h264: Fix H264 SDP payload format.
https://tools.ietf.org/html/rfc3984#section-8.1 says profile-level-id
takes 3 bytes in base16 (6 hex digits).

This fixes video setup in certain cases.

ASTERISK-23664 #close
ASTERISK-23664 #comment Patch r3530.patch uploaded by Guillaume Maudoux.
Review: https://reviewboard.asterisk.org/r/3530/
........

Merged revisions 413791 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413792 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13 13:53:28 +00:00
Walter Doekes f66e9d6c9e rtp: Fix case typo in H263+ mime.
http://tools.ietf.org/html/rfc3555#section-4.2.6 says the canonical
mime subtype is "H263-1998", not "h263-1998". Original code was added
in r183101 on 2009-03-19 02:26:50 +0100.

This fixes issues with Polycom phones.

ASTERISK-23665 #close
ASTERISK-23665 #comment Patch r3529.patch uploaded by Guillaume Maudoux, backported by me.
Review: https://reviewboard.asterisk.org/r/3529/
........

Merged revisions 413787 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413788 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413789 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13 13:39:21 +00:00
Richard Mudgett 8b6ab4782a chan_dahdi/sig_pri: Prevent unnecessary PROGRESS events when overlap dialing is enabled.
When overlap dialing is enabled, the lack of inband audio available
information in the SETUP_ACKNOWLEDGE events causes an interoperability
problem with SIP.  sig_pri doesn't know if there is dialtone present when
a SETUP_ACKNOWLEDGE is received so it assumes it is there and posts an
AST_CONTROL_PROGRESS frame.  The SIP channel driver then sends out a 183
Session Progress and blocks the desired 180 Ringing message when the
ALERTING message comes in.

* Made the configure script detect if the installed version of libpri
supports the SETUP_ACKNOWLEDGE enhancements.

* Using the new API, made generate an AST_CONTROL_PROGRESS frame on an
incoming SETUP_ACKNOWLEDGE message when the message indicates inband audio
is present instead of assuming that dialtone is present.

* Using the new API, made SETUP_ACKNOWLEDGE send out an inband audio
available indication only if dialtone is expected.  The change also makes
the fallback behaviour of sending the PROGRESS message better by sending
it only if dialtone is expected.

* Changed receiving a PROCEEDING message to not generate an
AST_CONTROL_PROGRESS frame if the progress indication ie indicates
non-end-to-end-ISDN.  This helps interoperability with SIP.

* Changed sending a PROCEEDING message in response to an
AST_CONTROL_PROCEEDING frame to not indicate inband audio available.  It
was silly to do so anyway because the channel driver doesn't know if
inband audio is even available.  This helps interoperability with SIP.

This patch and a corresponding change in libpri work together to allow
Asterisk to control the inband audio available progress indication ie on
the SETUP_ACKNOWLEDGE message when dialtone is present.

AST-1338 #close
Reported by: Tyler Stewart

Review: https://reviewboard.asterisk.org/r/3521/
........

Merged revisions 413714 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413765 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413771 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13 00:35:31 +00:00
Richard Mudgett 552dbe531e Fix compiler warning from GCC 4.10 fixup.
........

Merged revisions 413766 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-13 00:23:45 +00:00
Jonathan Rose 643a7f02d6 app_chanspy: Fix a test that was failing on account of r413551
ASTERISK-23381 #close
ASTERISK-23381 #comment Reported by: Robert Moss
Review: https://reviewboard.asterisk.org/r/3505/
........

Merged revisions 413710 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413712 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-12 22:33:28 +00:00
Joshua Colp d134150be2 framehooks: Add callback for determining if a hook is consuming frames of a specific type.
In the past framehooks have had no capability to determine what frame types a hook
is actually interested in consuming. This has meant that code has had to assume they
want all frames, thus preventing native bridging.

This change adds a callback which allows a framehook to be queried for whether it
is consuming a frame of a specific type. The native RTP bridging module has also
been updated to take advantange of this, allowing native bridging to occur when
previously it would not.

ASTERISK-23497 #comment Reported by: Etienne Lessard
ASTERISK-23497 #close

Review: https://reviewboard.asterisk.org/r/3522/
........

Merged revisions 413681 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-11 02:09:10 +00:00
Joshua Colp e2ed86e4ca Undoing framehook support. Issues were uncovered by Bamboo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-11 01:09:06 +00:00
Joshua Colp 3b3e4b9b95 framehooks: Add callback for determining if a hook is consuming frames of a specific type.
In the past framehooks have had no capability to determine what frame types a hook
is actually interested in consuming. This has meant that code has had to assume they
want all frames, thus preventing native bridging.

This change adds a callback which allows a framehook to be queried for whether it
is consuming a frame of a specific type. The native RTP bridging module has also
been updated to take advantange of this, allowing native bridging to occur when
previously it would not.

ASTERISK-23497 #comment Reported by: Etienne Lessard
ASTERISK-23497 #close

Review: https://reviewboard.asterisk.org/r/3522/
........

Merged revisions 413650 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-10 18:50:17 +00:00
Kinsey Moore 21949def8e Fix 32bit build for func_env
........

Merged revisions 413592 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413595 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413597 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09 23:18:21 +00:00
Kinsey Moore abd3e4040b Allow Asterisk to compile under GCC 4.10
This resolves a large number of compiler warnings from GCC 4.10 which
cause the build to fail under dev mode. The vast majority are
signed/unsigned mismatches in printf-style format strings.
........

Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09 22:49:26 +00:00
Richard Mudgett f3b55da1b8 http.c: Remove dead code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09 18:15:34 +00:00
Jonathan Rose 5770483217 app_chanspy: Fix a bug where Barge mode could fail
If the barge audiohook was attached prior to the spyee and its peer
actually being bridged, the audiohook would not be applied and the
connected peer would not be able to hear audio from the spy when the
spy is in barge mode.

(closes issue ASTERISK-23381)
Reported by: Robert Moss
Review: https://reviewboard.asterisk.org/r/3505/
........

Merged revisions 413551 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413556 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09 17:03:41 +00:00
Joshua Colp f2ca3438e7 app_queue: Extend documentation for various Manager actions and events.
........

Merged revisions 413485 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413486 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413487 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-08 00:36:38 +00:00
Mark Michelson 68066907e1 Ensure that presence state is decoded properly on Asterisk startup.
The CustomPresence provider callback will automatically base64 decode
stored data if the 'e' option was present when the state was set. However,
since the provider callback was bypassed on Asterisk startup, encoded
presence subtypes and messages were being sent instead. This fix makes
it so the provider callback is always used when providing presence
state updates.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-07 21:58:37 +00:00
Richard Mudgett a92f0a9e83 app_confbridge: Fixed "CBAnn" channels not going away.
Fixed a ref leak in conf_handle_talker_cb() everytime the conference
bridge was found to report a channel's talker status change.  The
resulting leak caused the "CBAnn" channels and the conference bridge to
never be destroyed.

Thanks to Richard Kenner on the asterisk-user's list for locating the
problem.

Reported by: Richard Kenner
........

Merged revisions 413454 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-07 20:59:13 +00:00
Richard Mudgett 90b9413a0d app_confbridge: Fix ref leak in CLI "confbridge kick" command.
Fixed ref leak in the CLI "confbridge kick" command when the channel to be
kicked was not in the conference.
........

Merged revisions 413451 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413452 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-07 20:39:29 +00:00
Mark Michelson 2d572eafb9 Fix encoding of custom prepare extra data.
Patches:
	res_config_odbc-take2.patch by John Hardin (License #6512)
........

Merged revisions 413396 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413397 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413398 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-07 17:56:04 +00:00
Mark Michelson 065bd7d703 Improve XML sanitization in NOTIFYs, especially for presence subtypes and messages.
Embedded carriage return line feed combinations may appear in presence subtypes
and messages since they may be derived from user input in an instant messenger
client. As such, they need to be properly escaped so that XML parsers do not
vomit when the messages are received.
........

Merged revisions 413372 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-07 15:29:18 +00:00
Mark Michelson 9eae6c3f5b Check for an act on failures to update contacts during registration.
There was an underlying issue in a realtime backend where database updates
would fail. Since we were not checking for failure, we would end up in a
strange state where the old database entry was still present but Asterisk
thought that it had been updated. Now when an entry fails to update, we
print a warning and delete the old contact from sorcery so there is no
mismatch between foreground and backend state.

Patches:
	res_pjsip_registrar.patch by John Hardin (License #6512)
........

Merged revisions 413358 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-06 17:47:20 +00:00
Mark Michelson 3f5d4516bd Ensure that all parts of SQL UPDATEs and DELETEs are encoded.
Patches:
	res_config_odbc.patch by John Hardin (License #6512)
........

Merged revisions 413304 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413305 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413306 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-06 17:12:19 +00:00
Mark Michelson 795ed566d9 Blocked revisions 413282
........
Correct variable traversal logic in res_config_odbc's update_odbc function.

Closes issue ASTERISK-23675
Reported by Leando Dardini
Patches:
	asterisk-23675-odbc-linkedlist-traversal_12.diff uploaded by Michael L. Young (license #5026)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-02 20:37:00 +00:00
Mark Michelson ff1841fcfb Prevent crashes in res_config_odbc due to uninitialized string fields.
Patches:
    odbc-crash.patch by John Hardin (License #6512)
........

Merged revisions 413241 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413251 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413258 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-02 20:28:23 +00:00
Mark Michelson ff1658ed3b Return the number of rows affected by a SQL insert, rather than an object ID.
The realtime API specifies that the store callback is supposed to return the number
of rows affected. res_config_pgsql was instead returning an Oid cast as an int, which
during any nominal execution would be cast to 0. Returning 0 when more than 0 rows were
inserted causes problems to the function's callers.

To give an idea of how strange code can be, this is the necessary code change to fix
a device state issue reported against chan_pjsip in Asterisk 12+. The issue was that
the registrar would attempt to insert contacts into the database. Because of the 0
return from res_config_pgsql, the registrar would think that the contact was not successfully
inserted, even though it actually was. As such, even though the contact was query-able
and it was possible to call the endpoint, Asterisk would "think" the endpoint was unregistered,
meaning it would report the device state as UNAVAILABLE instead of NOT_INUSE.

The necessary fix applies to all versions of Asterisk, so even though the bug reported
only applies to Asterisk 12+, the code correction is being inserted into 1.8+.

Closes issue ASTERISK-23707
Reported by Mark Michelson
........

Merged revisions 413224 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 413225 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413226 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-02 20:07:08 +00:00
Richard Mudgett 119599407b res_pjsip_refer: Add Referred-By header on INVITE for blind transfers.
Per rfc3892, the Referred-By header in a REFER must be copied into the
referenced request (IE.  The outgoing INVITE to the transfer target).

* Automatically put the Referred-By header in the outgoing INVITE message
if the SIPREFERREDBYHDR channel variable is defined with a value.

* Made chan_sip.c:get_refer_info() set SIPREFERREDBYHDR for inheritance so
chan_pjsip has a better chance to interoperate.

* Fixed refer_blind_callback() and refer_incoming_refer_request() to not
modify the data in the pointer returned by pjsip_msg_find_hdr_by_name().
It seems wrong to modify that data since the calling routine doesn't own
the buffer.

ASTERISK-23501 #close
Reported by: John Bigelow

Review: https://reviewboard.asterisk.org/r/3514/
........

Merged revisions 413210 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-02 16:39:58 +00:00
Jonathan Rose 57372e61d2 Parking: Add 'AnnounceChannel' argument to manager action 'Park'
(closes ASTERISK-23397)
Reported by: Denis
Review: https://reviewboard.asterisk.org/r/3446/
........

Merged revisions 413196 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-02 16:06:40 +00:00
Mark Michelson 120ac66df9 Make behavior of the PRESENCE_STATE 'e' option more consistent.
When writing presence state, if 'e' is specified, then the presence state will
be stored in the astdb encoded. However, consumers of presence state events or those
that query for the presence state will be given decoded information. If base64 encoding
is desired for consumers, then the information can be base64-encoded manually and the
'e' option can be omitted.

closes issue ASTERISK-23671
Reported by Mark Michelson

Review: https://reviewboard.asterisk.org/r/3482



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-01 16:21:09 +00:00
Mark Michelson fc4c5ca3de Remove unnecessary repetition checks from res_pjsip_exten_state
The PBX core already takes care of ensuring that repeated state changes
are not communicated to exten state consumers. Because the check in res_pjsip_exten_state
was incomplete, it was causing valid presence state changes not to be sent out. For instance,
if the presence state did not change but the message or subtype did, then no presence-related
NOTIFY request would be sent out.

closes issue ASTERISK-23672
Reported by Mark Michelson
........

Merged revisions 413173 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-01 15:47:49 +00:00
Joshua Colp 45a7132480 res_pjsip: Add the ability to configure ciphers based on name.
Previously this code would only accept the OpenSSL identifier instead
of the documented name.

ASTERISK-23498 #close
ASTERISK-23498 #comment Reported by: Anthony Messina

Review: https://reviewboard.asterisk.org/r/3491/
........

Merged revisions 413159 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-01 12:31:20 +00:00
Richard Mudgett 20750e261b chan_sip.c: Fixed off-nominal message iterator ref count and alloc fail issues.
* Fixed early exit in sip_msg_send() not destroying the message iterator.

* Made ast_msg_var_iterator_next() and ast_msg_var_iterator_destroy()
tolerant of a NULL iter parameter in case ast_msg_var_iterator_init()
fails.

* Made ast_msg_var_iterator_destroy() clean up any current message data
ref.

* Made struct ast_msg_var_iterator, ast_msg_var_iterator_init(),
ast_msg_var_iterator_next(), ast_msg_var_unref_current(), and
ast_msg_var_iterator_destroy() use iter instead of i.

* Eliminated RAII_VAR usage in res_pjsip_messaging.c:vars_to_headers().
........

Merged revisions 413139 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413142 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30 21:03:29 +00:00
Joshua Colp f2a060f502 chan_pjsip: Fix deadlock when retrieving call-id of channel.
If a task was in-flight which required the channel or bridge lock
it was possible for the synchronous task retrieving the call-id
to deadlock as it holds those locks.

After discussing with Mark Michelson the synchronous task was
removed and the call-id accessed directly. This should be safe as
each object involved is guaranteed to exist and the call-id will
never change.
........

Merged revisions 413140 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30 20:39:17 +00:00
Kinsey Moore a7fc217837 Websocket: Add session locking and delay close
This resolves a race condition where data could be written to a NULL
FILE pointer causing a crash as a websocket connection was in the
process of shutting down by adding locking to websocket session writes
and by deferring session teardown until session destruction.

(closes issue ASTERISK-23605)
Review: https://reviewboard.asterisk.org/r/3481/
Reported by: Matt Jordan
........

Merged revisions 413123 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413124 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30 13:08:07 +00:00
Joshua Colp 10f4d0f65d res_stasis: Add progress indications to operations which perform media.
This change fixes operations which did not account for the fact that they may
be executed on channels which have not been answered. These operations will
now indicate progress when invoked.

ASTERISK-23560 #close
ASTERISk-23560 #comment Reported by: Jan Svoboda

Review: https://reviewboard.asterisk.org/r/3495/
........

Merged revisions 413121 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30 12:42:42 +00:00
Joshua Colp 7378d3e054 res_pjsip_sdp_rtp: Fix issue where sending a hold SDP twice could cause an unhold.
This change fixes a bug where if an SDP with media address and sendonly was
received twice the underlying call would go off hold, instead of remaining on hold.
This occured because the code did not properly take into account that the SDP
may contain both a valid media address and the sendonly attribute.

The code now examines the sendonly attribute and media address first, so if the
SDP is received again no change will occur.

ASTERISK-23558 #comment Reported by: John Bigelow

Review: https://reviewboard.asterisk.org/r/3472/
........

Merged revisions 413119 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30 12:39:11 +00:00
Joshua Colp 56ca10c7f1 chan_pjsip: Add support for picking up calls in the configured pickup group.
AST-1363

Review: https://reviewboard.asterisk.org/r/3478/
........

Merged revisions 413117 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-30 12:32:12 +00:00
George Joseph c6ed85748c Add "destroy" implementation for spinlock.
The original commit for spinlock was missing "destroy" implementations.
Most of them are no-ops but phtread_spin and pthread_mutex do need their
locks destroyed.
........

Merged revisions 413102 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-29 15:10:24 +00:00
Joshua Colp 2e39da35d0 chan_pjsip: Implement core ability to get Call-ID of a channel.
This changes implement the "get_pvt_uniqueid" which is used to return the
technology specific unique identifier. In the case of SIP this is the Call-ID
of the dialog.

Review: https://reviewboard.asterisk.org/r/3480/
........

Merged revisions 413088 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-29 11:27:14 +00:00
Kinsey Moore f7caf4e249 Bridging: Don't lock NULL bridges
When bridge locking was added for bridge snapshot creation, some
locations where bridge locking was added were not guaranteed to
actually have a bridge and locking NULL AO2 objects tends to cause
segfaults. This ensures that NULL bridges aren't locked.
........

Merged revisions 413073 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-28 20:07:37 +00:00
Mark Michelson 7dd64ff993 Add DeviceStateChanged and PresenceStateChanged AMI events.
These events are controlled by two new modules, res_manager_devicestate
and res_manager_presencestate.

Review: https://reviewboard.asterisk.org/r/3417



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-28 14:40:21 +00:00
Igor Goncharovskiy d3433771c9 Introducing changes proposed to chan_unistim driver:
1) Added the unistim.conf variable dtmf_duration which can select the DTMF playback duration from 0ms to 150ms (0 is off and is the new default)
2) Enabled the transmission of month names, which are sent with the date and changed the dateformat variable to accept the values 0-3 as per the UNISTIM standard (2 & 3 match the previous 1 & 2 formats).
3) Enabled the "Mute" packet so muting microphone works as expected and microphone muted for all calls while LED light on
4) Changed Duree to Timer on i2004 display

(closes issue ASTERISK-23592)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-28 07:43:33 +00:00