main/bridge_basic: Fix features regressions introduced by r428165
authorMatthew Jordan <mjordan@digium.com>
Fri, 21 Nov 2014 02:17:15 +0000 (02:17 +0000)
committerMatthew Jordan <mjordan@digium.com>
Fri, 21 Nov 2014 02:17:15 +0000 (02:17 +0000)
commit2be984fb1142af6bf33951ee2d29ce2b3dfbd682
treee63a2452bae91f293d8df8806728f9b401ae59ab
parent2f78fde10f265a0e4c18b696678d828e172cf536
main/bridge_basic: Fix features regressions introduced by r428165

In r428165, two bugs were introduced:

* Prior to entering the features retry loop, the buffer that holds the
  collected digits is wiped. However, this inadvertently wipes out the
  first collected digit on the first pass through, which is obtained
  in ast_stream_and_wait. This caused all of the features tests to fail.
* If ast_app_dtget returns a hangup (-1), the loop would retry incorrectly.
  If we detect a hangup, we have to stop trying the feature.

This patch fixes both issues.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/bridge_basic.c