New AGI format in asterisk 16

Unlike asterisk 13, asterisk 16 responds with Output: lines rather
than Follows: lines, so cope with this addition.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
diff --git a/include/AastraAsterisk.class.php b/include/AastraAsterisk.class.php
index cba4b4f..1cdad38 100644
--- a/include/AastraAsterisk.class.php
+++ b/include/AastraAsterisk.class.php
@@ -121,15 +121,15 @@
         		while($buffer != '')
         			{
           			$a = strpos($buffer, ':');
-          			if($a)
+				if($a)
           				{
             				if(!count($parameters)) // first line in a response?
             					{
+					$parameters['data'] = '';
               				$type=strtolower(substr($buffer, 0, $a));
               				if(substr($buffer,$a+2)=='Follows')
               					{
                 					# A follows response means there is a multiline field that follows.
-                					$parameters['data'] = '';
                 					$buff=fgets($this->socket, 4096);
                 					while(substr($buff, 0, 6) != '--END ')
                 						{
@@ -140,7 +140,12 @@
             					}
 
             				# Store parameter in $parameters
-            				$parameters[substr($buffer,0,$a)]=substr($buffer,$a+2);
+					$key = substr($buffer, 0, $a);
+					$value = substr($buffer, $a+2);
+					if ($key == 'Output') {
+					    $parameters['data'] .= $value."\n";
+					}
+					$parameters[$key]=$value;
           				}
           			$buffer=trim(fgets($this->socket,4096));
         			}
@@ -157,7 +162,7 @@
           			case 'response':
             				break;
           			default:
-            				$this->log('Unhandled response packet from Manager: '.$type);
+					error_log('Unhandled response packet from Manager: '.$type);
             				break;
         			}
       			} while($type!='response' && !$timeout);