manager: Fix could not extend string messages.

When shutting down Asterisk that has an active AMI connection, you get
several "failed to extend from %d to %d" messages because use of the
EVENT_FLAG_SHUTDOWN attempts to add all AMI permission strings to the
event.

* Created MAX_AUTH_PERM_STRING to use when creating stack based struct
ast_str variables used with the authority_to_str() and
user_authority_to_str() functions instead of a variety of magic numbers
that could be too small.

* Added a special check for EVENT_FLAG_SHUTDOWN to authority_to_str() so
it will not attempt to add all permission level strings.

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

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

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

Merged revisions 428572 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@428573 f38db490-d61c-443f-a65b-d21fe96a405b
DTMF hooks: Leaving channels need to push any collected digits into the bridge.

Any partially collected DTMF digits for a DTMF hook need to be pushed into
the bridge when a channel leaves the bridging system as if there were a
timeout.

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

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

Merged revisions 428602 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@428603 f38db490-d61c-443f-a65b-d21fe96a405b
test_channel_feature_hooks.c: Fix unit test for DTMF hooks.

Fix the failing /channels/features/test_features_channel_dtmf unit test.

DTMF emulation does not work without a stream of packets to prod the
emulation code.

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

Merged revisions 428604 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@428605 f38db490-d61c-443f-a65b-d21fe96a405b