Weckruf

Ich habe das Skript auch versucht zu installieren (ASterisk 1.10). Wenn ich es richtig verstanden habe, sind aber die anleitungen in den Seiten vorher nicht mehr zwingend aktuell.

Wenn ich auf der "999" anrufe (habe die Beispielskonfiguration auf Seite 1 gneommen) erscheint:

- Executing AGI("SIP/softphone-7012", "wakeup.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/wakeup.agi
-- Playing 'hours' (language 'de')
-- AGI Script wakeup.agi completed, returning 0


Auf dem Softphone klingelt es aber einfach durch und anschließend wird aufgelegt. Syslog zeigt keinerlei Fehler an, das gleich gilt für Asterisklog. Kann mir jemand sagen, wo ich anfangen kann zu suchen?
 
mspachster schrieb:
Wenn ich es richtig verstanden habe, sind aber die anleitungen in den Seiten vorher nicht mehr zwingend aktuell.
Ich weiß nicht, ob das so wie hier beschrieben noch funktioniert.
Kann mir jemand sagen, wo ich anfangen kann zu suchen?
Am besten gehen wir das mal Schritt für Schritt durch.
Wenn du die 999 wählst, sollte sich das Skript melden und zur Eingabe der Weckzeit auffordern. Funktioniert das?

Benno
 
wrrdlbrrmpft schrieb:
Wenn du die 999 wählst, sollte sich das Skript melden und zur Eingabe der Weckzeit auffordern. Funktioniert das?

Eben leider nicht. Die Kommandozeile zeigt zwar an, dass das Script gestartet wurde, aber das Telefon klingelt einfach durch, als ob niemand abgenommen hätte. Ich bin völlig ratlos...
 
Ich versteh jetzt nicht ganz, warum da überhaupt ein Telefon klingelt. Das müsste man mal als erstes klären. Wo klingelt denn ein Telefon?

Dann sehe ich, dass das Skript gestartet und die Stundenabsage abgespielt wird. Anschließend scheint sich das Skript zu beenden. Sind vielleicht irgendwo Zeilenumbrüche im wakeup.agi, wo keine hingehören?

Benno
 
wrrdlbrrmpft schrieb:
Ich versteh jetzt nicht ganz, warum da überhaupt ein Telefon klingelt. Das müsste man mal als erstes klären. Wo klingelt denn ein Telefon?
Benno

Nein, da habe ich mich ungeschickt ausgedrückt: Das anrufende Telefon "tutet" einfach durch (freizeichen), als ob an der Gegenstelle niemand abnehmen würde.

wrrdlbrrmpft schrieb:
Dann sehe ich, dass das Skript gestartet und die Stundenabsage abgespielt wird. Anschließend scheint sich das Skript zu beenden. Sind vielleicht irgendwo Zeilenumbrüche im wakeup.agi, wo keine hingehören?
Benno

Ich kann zumindest keine ungültigen entdecken. Zeilenumbrüche werden mit "\" dargestellt....
 
Ich bin etwas ratlos. Aber probier zunächst mal folgendes.
Füge in wakeup.agi vor Zeile 20
Code:
echo 'ANSWER' > /dev/stdout
read input
ein!
Zur Kontrolle, in Zeile 20 steht
Code:
extension=`echo $agi_extension | sed 's§agi_extension: §§' -`
Wenn das nichts ändert, kannst du auch mal versuchen, die beiden Zeilen direkt nach der ersten Zeile, also nach
Code:
#!/bin/sh
einzufügen.
Und poste mir auch mal die Ausgabe von
sh --version

Dann sehen wir weiter!
Benno
 
Danke erstmal für all die Mühe!

Also die Sprachausgabe sagt:
"Stunden. [Pause]
.......Leider haben Sie keine gültige Nummer gewählt. Bitte versuchen Sie es noch einmal"
Hangup


sh -version:
GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)

Vielleicht liegt es ja auch daran, dass ich es über SIP mache. Wie wäre denn dann der Channel in dem Skript einzustellen (zur Kontrolle)?
 
Zuletzt bearbeitet:
Hat sich das mit dem Tuten erledigt? Wenn ja, wodurch?
mspachster schrieb:
Also die Sprachausgabe sagt:
"Stunden. [Pause]
Das ist schon mal gut. Wenn du jetzt eine zweistellige Zahl eingibst, was passiert dann? Kommt dann auch die Meldung "Leider haben sie keine gültige Nummer usw."? Oder kommt diese Meldung nur, wenn du gar nichts drückst? Denn letzteres wäre normal. Wichtig ist, dass man eine zweistellige Zahl zwischen 00 und 23 eingibt, Betonung auf zweistellig.
GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
Gut!
Der Link auf das Skript geht nicht mehr. Könntest du den vielleicht nochmal posten, damit ich auch sicher sein kann, das aktuelle Skript zu haben?
Die aktuelle Version ist 0.0.4 und gibt es im ersten Beitrag dieses Threads zum Download. Wenn du es auf Fehler überprüfen willst, wende mal folgendes Kommando auf die Datei an:
md5sum wakeup-0.04.tar.gz

Die Prüfsumme, die da rauskommen sollte, ist:
c1d58d4fe880f94275f1fdcc17e53ca2 wakeup-0.04.tar.gz


Benno

EDIT: Mit dem Channel hat das Problem erstmal nichts zu tun. Das kriegen wir dann evtl. später noch.
 
Zuletzt bearbeitet:
Das Einfügen der Zeilen
"echo 'ANSWER' > /dev/stdout
read input"

hat das Problem erstmal gelöst (??).

Wenn ich jetzt die 999 wähle, kommt keine Begrüßung, sondern eben nur die Aussage "stunden". Wenn ich jetzt schnell "1930" eingebe kommt so ungefähr:

"Minuten... 19 Uhr 30...Auf wiedersehen" Hangup.

In der Commandozeile erscheint hierbei:


Jan 4 20:04:32 WARNING[2295]: file.c:475 ast_openstream: File does not exist in any format
Jan 4 20:04:32 WARNING[2295]: file.c:787 ast_streamfile: Unable to open (format alaw): No such file or directory
-- Playing 'digits/30' (language 'de')
Jan 4 20:04:34 WARNING[2295]: file.c:475 ast_openstream: File does not exist in any format
Jan 4 20:04:34 WARNING[2295]: file.c:787 ast_streamfile: Unable to open (format alaw): No such file or directory
 
mspachster schrieb:
Das Einfügen der Zeilen
"echo 'ANSWER' > /dev/stdout
read input"
Direkt vor Zeile 20 oder direkt nach Zeile 2? Das wäre für mich wichtig, damit ich das Skript ändern kann.
Wenn ich jetzt die 999 wähle, kommt keine Begrüßung, sondern eben nur die Aussage "stunden". Wenn ich jetzt schnell "1930" eingebe kommt so ungefähr:

"Minuten... 19 Uhr 30...Auf wiedersehen" Hangup.
Ich gebe zu, dass das Skript vielleicht etwas billig ist, aber eine Begrüßung kommt da auch nicht. Es kommt nur die Ansage "Stunden". Dann gibst du die Stunde der Weckzeit ein. Dann kommt die Ansage "Minuten" und du gibst die Minuten der Weckzeit ein. Anschließend wird die Weckzeit nochmal angesagt mit "Auf Wiedersehen!" und fertig.
In der Commandozeile erscheint hierbei:


Jan 4 20:04:32 WARNING[2295]: file.c:475 ast_openstream: File does not exist in any format
Jan 4 20:04:32 WARNING[2295]: file.c:787 ast_streamfile: Unable to open (format alaw): No such file or directory
-- Playing 'digits/30' (language 'de')
Jan 4 20:04:34 WARNING[2295]: file.c:475 ast_openstream: File does not exist in any format
Jan 4 20:04:34 WARNING[2295]: file.c:787 ast_streamfile: Unable to open (format alaw): No such file or directory
Ich weiß jetzt nicht, wo das herkommt. Erstmal egal! Wird ein Callfile angelegt (normalerweise in /tmp/wakeups)? Wenn ja, wie sieht das aus?

Benno
 
wrrdlbrrmpft schrieb:
Direkt vor Zeile 20 oder direkt nach Zeile 2? Das wäre für mich wichtig, damit ich das Skript ändern kann.

Ich habe es vor die Zeile 20 eingefügt.

wrrdlbrrmpft schrieb:
Ich gebe zu, dass das Skript vielleicht etwas billig ist, aber eine Begrüßung kommt da auch nicht. Es kommt nur die Ansage "Stunden". Dann gibst du die Stunde der Weckzeit ein. Dann kommt die Ansage "Minuten" und du gibst die Minuten der Weckzeit ein. Anschließend wird die Weckzeit nochmal angesagt mit "Auf Wiedersehen!" und fertig.

Ah, dann funktioniert es grundsätzlich, denn das kommt.

wrrdlbrrmpft schrieb:
Wird ein Callfile angelegt (normalerweise in /tmp/wakeups)? Wenn ja, wie sieht das aus?

Ja, es heisst "1800.\"Michael\ Ende\"\ \<61\>.call" und hat folgenden Inhalt:
Channel: SIP/pdsoft-c9ee/"Michael Ende" <61>
Callerid: "Weckruf" <999>
MaxRetries: 2
RetryTime: 60
WaitTime: 60
Context: weckruf
Extension: ***
Priority: 1

Leider wird die Datei aber nicht ausgeführt...
 
Hallo mspachster,

mit dem Channel hat es bei mir so auch noch nicht funktioniert. Schau die die Zeile mal genau an; was da drin steht ist der temporäre channel deines anrufes; aussehen müsste es so:
Channel: SIP/pdsoft
ich habe bei mir das ganze so:
wakeup.php
PHP:
#!/usr/bin/php -q
<?php
{
    // Version 1.10 2005-09-20
    // ------------
    // CONFIG Parms
    // ------------
    
    // If the application is having problems you can log to this file
    $parm_error_log = '/tmp/wakeup.log';
    
    // Set to 1 to turn on the log file
    $parm_debug_on = 1;	
    
    // This is where the Temporary WakeUp Call Files will be created
    $parm_temp_dir = '/tmp';
    
    // This is where the WakeUp Call Files will be moved to when finished
    $parm_call_dir = '/var/spool/asterisk/outgoing';

    // How many times to try the call
    $parm_maxretries = 3;
    
    // How long to keep the phone ringing
    $parm_waittime = 60;		// How long to keep the phone ringing
    
    // Number of seconds between retries
    $parm_retrytime = 60;
    
    // Caller ID of who the wakeup call is from Change this to the extension you want to display on the phone
    $parm_wakeupcallerid = '"WakeUpCall" <44>';
    
    
    // Set to 1 to use the Channel
    // Set to 0 for Caller ID,  Caller IS is assumed just a number ### or "Name Name" <##>
    // The big difference is using caller ID will call ANY phone with that extension number
    // Where using Channel will only wake up the one specific phone
    $parm_chan_ext = 0;

    // ----------------------------------------------------
    // Which application to run when the call is connected.  
    $parm_application = 'MusicOnHold';
	$parm_data = '';

	// -- Use this for the ANNOY application
	//$parm_application = 'AGI';
	//$parm_data = 'wakeconfirm.agi';
    // ----------------------------------------------------

    
    //-------------------
    // END CONFIG PARMS
    //-------------------
    
    GLOBAL	$stdin, $stdout, $stdlog, $result, $parm_debug_on, $parm_test_mode;
    
    // These setting are on the WIKI pages http://www.voip-info.org
    ob_implicit_flush(false);
    set_time_limit(30);
    error_reporting(0);
    
    $stdin = fopen( 'php://stdin', 'r' );
    $stdout = fopen( 'php://stdout', 'w' );
    
    // You will see a whole bunch of this its for development or if you change anything and
    // want to write to a log file in the TMP directory
    if ($parm_debug_on)
    {
        $stdlog = fopen( $parm_error_log, 'w' );
        fputs( $stdlog, "---Start---\n" );
    }
    
    
    // ASTERISK * Sends in a bunch of variables, This accepts them and puts them in an array
    // http://www.voip-info.org/tiki-index.php?page=Asterisk%20AGI%20php
    while ( !feof($stdin) ) 
    {
        $temp = fgets( $stdin );
        
        if ($parm_debug_on)
            fputs( $stdlog, $temp );
        
        // Strip off any new-line characters
        $temp = str_replace( "\n", "", $temp );
        
        $s = explode( ":", $temp );
        $agivar[$s[0]] = trim( $s[1] );
        if ( ( $temp == "") || ($temp == "\n") )
        {
            break;
        }
    } 
    
    
    // There are two ways to contact a phone, by its channel or by its local 
    // extension number.  This next session will extract both sides
    
    // split the Channel  SIP/11-3ef4  or Zap/4-1 into is components
    $channel = $agivar[agi_channel];
    if (preg_match('.^([a-zA-Z]+)/([0-9]+)([0-9a-zA-Z-]*).', $channel, $match) )
    {
        $sta = trim($match[2]);
        $chan = trim($match[1]);
    }
    
    
    
    // Go Split the Caller ID into its components
    $callerid = $agivar[agi_callerid];
    
    // First look for the Extension in <####> 
    if (preg_match('/<([ 0-9]+)>/', $callerid, $match) )
    {
        $cidn = trim($match[1]);
    }
    else	// Did not find the <##...> look for the first number in the string to use as CID
    {
        if (preg_match('/([0-9]+)/', $callerid, $match) )
        {
            $cidn = trim($match[1]);
        }
        else
            $cidn = -1;		// I'm saying an error no caller id # found
    }
    
    
    
    // Check if we have an outstanding Wakeup Call file
    if ( $parm_chan_ext )
        $dir_check = "$chan.$sta.call";
    else
        $dir_check = "ext.$cidn.call";
    
    if ($parm_debug_on)
        fputs( $stdlog, "Checking Directory [$parm_call_dir] Check=[$dir_check]\n" );
    
    
    
    // I started to think we could have many outstanding wakup calls, but then
    // it got very confusing on how to delete just one of them.  I wasn't about
    // to prompt each and every one.  So I went back to JUST ONE wakeup call
    // But this will get a list of all of them incase of problems
    $outc=0;
    $dir_handle = opendir( $parm_call_dir );
    while( $file = readdir($dir_handle ) )
    {
        if ($parm_debug_on)
            fputs( $stdlog, "File=$file\n" );
        
        // Check if we have an outstanding wakup call
        if (strstr( $file, $dir_check ) )
            $out[$outc++] = $file;
        
    }
    closedir( $dir_handle );
    
    
    //=========================================================================
    // This is where we interact with the caller.  Answer the phone and so on
    //=========================================================================
    
    
    $rc = execute_agi( "ANSWER ");
    
    sleep(1);	// Wait for the channel to get created and RTP packets to be sent
				// On my system the welcome you would only hear 'elcome'  So I paused for 1 second

    


    if ( !$rc[result] )
        $rc = execute_agi( "STREAM FILE welcome \"\" ");
    
    // They have an outstanding wakup call
    if ( $outc )
    {
        $i = 0;
        while ( $out[$i] )
        {
            
            $wtime = strtok( $out[$i], '.' );
            
            if ($parm_debug_on)
                fputs( $stdlog, "wakeup found=$out[0] saying time $wtime\n" );
            
            
            say_wakeup( $wtime );
            $i++;
            
        }
        
    }
    
    
    // Check if any outstanding wakeup calls 
    if ( $outc )
    {
        // Start prompting them if they want to create or delete a wakeup call
        while ( !$rc[result] )
        {
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE for-wakeup-call \"12\" ");
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE press-1 \"12\" ");
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE to-cancel-wakeup \"12\" ");
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE press-2 \"12\" ");
            if ( !$rc[result] )
            {
                $rc = execute_agi( "WAIT FOR DIGIT 15000");
            }
            if ( $rc[result] != -1 )
            {
                if ( $rc[result] == 49 || $rc[result] == 50 )
                {
                    ; // Do nothing
                }
                else
                {
                    // This was just for fun, if they press something other than 1 or 2
                    $rc[result] = 0;
                    $rc = execute_agi( "STREAM FILE you-dialed-wrong-number \"\" ");
                    $rc = execute_agi( "STREAM FILE wrong-try-again-smarty \"\" ");
                }
                
            }
        }
    }
    else	// Default to Creating a wakeup call
        $rc[result] = '49';
    // Process which key they pressed
    //  I check most of my Return Codes incase the call is hung up
    //
    //  Being a phone person, I want to be able to skip the prompts, so I allow for entry over
    //  The prompts.  Makes for more code, but make for quicker entry after you know what to key
    //
    switch( $rc[result] )
    {
    case '49':	// Pressed 1  - This is to schedule a NEW wakeup call
        {
            $rc[result] = 0;
            while ( !$rc[result] )
            {
                $rc = execute_agi( "STREAM FILE please-enter-the \"0123456789\" ");
                
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE time \"0123456789\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE for \"0123456789\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE your \"0123456789\" ");
                
                // If we get here, they haven't pressed anything yet.
                if ( !$rc[result] )
                    $rc = execute_agi( "GET DATA wakeup-call 15000 4");
                
                if ( $rc[result] != -1 )
                {


                    if ($parm_debug_on)
                        fputs( $stdlog, "We have num digits:" . strlen( $rc[result]) . "- $rc[result] \r\n\r\n" );


                    // This check how many digits, if 2 then they pre-pressed a digit, 
                    // Otherwise it will be 4
                    if ( strlen( $rc[result] ) == 2 )
                    {
                        $num= $rc[result]-48;
                        while ( strlen($num) < 4 && $rc[result] > 0 )
                        {
                            $rc = execute_agi( "WAIT FOR DIGIT 15000");
                            if ( $rc[result] >= 48 && $rc[result] <= 57 )
                                $num .= $rc[result] - 48;
                            else	
                                $rc[result] = 0;
                            
                        }
                        if (strlen($num) == 4 )
                            $rc[result] = $num;
                    }

                    if ($parm_debug_on)
                        fputs( $stdlog, "Checking Results [$rc[result]] \r\n\r\n" );

                    // They entered 4 digits,  check if its a valid time or they hung up
                    if ( $rc[result] > 2359 || strlen( $rc[result]) < 4 || substr($rc[result],2,2) > 59 || $rc[result] < 0)
                    {
                        $rc[result] = 0;
                        //$rc = execute_agi( "STREAM FILE invalid \"\" ");
                        //$rc = execute_agi( "STREAM FILE time \"\" ");
                        $rc = execute_agi( "STREAM FILE please-try-again \"\" ");
                    }

                    if (strlen( $rc[result] ) == 4 && $rc[result] == 0 )
                        $rc[result] = -2;	// Special 00:00 time
                    
                }	
            }
            
            if ( $rc[result] == -2 )
                $rc[result] = '0000';	
            else if ( $rc[result] == -1 )
                exit;			// The user hung up
            
            
            
            // Save the time entered
            $wtime = $rc[result];
            
            
            // We don't know who the user is, so if its less than 1300 it could be AM or PM, so prompt
            // them for am pm
            if ( $wtime != -1 && $wtime < 1300 )
            {
                $rc[result] = 0;
                while ( !$rc[result] )
                {
                    
                    if ( !$rc[result] )
                        $rc = execute_agi( "GET DATA 1-for-am-2-for-pm 15000 1");
                    
                }	
                
                switch( $rc[result] )
                {
                case '1':			// Set to AM should be under 1159 or less
                    if ( $wtime > 1159 )
                        $wtime -= 1200;
                    $rc[result] = 0;
                    break;
                    
                case '2':			// Set to PM should be equal or over 1200
                    if ( $wtime < 1159 )
                        $wtime += 1200;
                    $rc[result] = 0;
                    break;
                }
            }
            
            
            // At this point we have a millitary time in the $wtime variable
            if ( $parm_chan_ext )
			{
                $wakefile = "$parm_temp_dir/$wtime.$chan.$sta.call";
				$callfile = "$parm_call_dir/$wtime.$chan.$sta.call";
			}
            else
			{
                $wakefile = "$parm_temp_dir/$wtime.ext.$cidn.call";
                $callfile = "$parm_call_dir/$wtime.ext.$cidn.call";
			}            

            if ($parm_debug_on)
                fputs( $stdlog, "Wakeup File [$wakefile]\n" );
            
            // Open up a wakeup file to write it out.
            $wuc = fopen( $wakefile, 'w');
            
            if ( $wuc )
            {
                // Delete any old Wakeup call files this one will override 
                for ($i=0; $i < $outc; $i++ )
                {
                    if( file_exists( "$parm_call_dir/$out[$i]" ) )
                    {
                        if ($parm_debug_on)
                            fputs( $stdlog, "Unlinking Old File [$parm_call_dir/$out[$i]]\n" );
                        
                        unlink( "$parm_call_dir/$out[$i]" );
                    }
                }
                
                // I've noticed that the other WAKEUP example has a different format.  This worked for me
                // Here is where we either make the call to the Extension or the Channel.  Extension
                // is the better way to go, but required the caller ID information.  Where Channel
                // should always get you back to where you were called from, provided its on your system
                if ( $parm_chan_ext )
                    fputs( $wuc, "channel: $chan/$sta\n" );
                else
                    fputs( $wuc, "channel: Local/$cidn@$agivar[agi_context]\n" );
                
                fputs( $wuc, "maxretries: $parm_maxretries\n");
                fputs( $wuc, "retrytime: $parm_retrytime\n");
                fputs( $wuc, "waittime: $parm_waittime\n");
                fputs( $wuc, "callerid: $parm_wakeupcallerid\n");

				fputs( $wuc, "application: $parm_application\n");
				fputs( $wuc, "data: $parm_data\n");
                
                fclose( $wuc );
		
				$w = getdate();

				$w['hours']   = substr( $wtime, 0, 2 );
				$w['minutes'] = substr( $wtime, 2, 2 );
				
				$time_wakeup = mktime( substr( $wtime, 0, 2 ), substr( $wtime, 2, 2 ), 0, $w[mon], $w[mday], $w[year] );

				$time_now = time( );

                if ($parm_debug_on)
                    fputs( $stdlog, 'time_wakeup=' . date('l dS \of F Y h:i:s A', $time_wakeup) . " ($time_wakeup) | time_now=" . date('l dS \of F Y h:i:s A',$time_now) . " ($time_now)\n" );

				if ( $time_wakeup <= $time_now )
					$time_wakeup += 86400; // Add One Day on

                if ($parm_debug_on)
                    fputs( $stdlog, 'Setting WAKEUP file to =' . date('l dS \of F Y h:i:s A', $time_wakeup) . " - $time_wakeup\n" );


				touch( $wakefile, $time_wakeup, $time_wakeup );

				rename( $wakefile, $callfile );
				
            }
            else
            {
                // Couldn't open the file.  Make sure you created the /var/lib/asterisk/wakeups directory
                if ($parm_debug_on)
                    fputs( $stdlog, "Error opening file [$wakefile]\n" );
                
                $rc = execute_agi( "STREAM FILE something-terribly-wrong \"\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE goodbye \"\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "HANGUP");
                exit;
            }
            
            //  If we have a caller ID  and waking up by extension say the extension number
            if ( $cidn && $parm_chan_ext == 0 )
            {
                $rc = execute_agi( "STREAM FILE for \"\" ");
                
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE extension \"\" ");
                
                                    
                if ( !$rc[result] )
                    $rc = execute_agi( "SAY DIGITS $cidn \"\" ");
                
            }
            
            say_wakeup( $wtime );
            $rc[result] = 0;
            
        }
        break;
        
        // This is the END Of a new wakeup call
        
        
        case '50':	// Pressed 2 - Delete old wakeup calls
            {
                // Go through the list of old files and unlink/delete them
                for ($i=0; $i < $outc; $i++ )
                {
                    if( file_exists( "$parm_temp_dir/$out[$i]" ) )
                    {
                        if ($parm_debug_on)
                            fputs( $stdlog, "Unlinking Wakeup File [$parm_temp_dir/$out[$i]]\n" );
                        
                        unlink( "$parm_temp_dir/$out[$i]" );
                    }
                }
                
                // If Caller ID and recording by Extension then say the extension
                if ( $cidn && $parm_chan_ext == 0 )
                {
                    $rc = execute_agi( "STREAM FILE for \"\" ");
                    
                    if ( !$rc[result] )
                        $rc = execute_agi( "STREAM FILE extension \"\" ");
                    
                    
                    $L = strlen( $cidn );
                    
                    for( $i = 0; $i < $L && !$rc[result]; $i++ )
                    {
                        $cid_digits = substr( $cidn, $i, 1 );
                        
                        if ( !$rc[result] )
                            $rc = execute_agi( "SAY NUMBER $cid_digits \"\" ");
                    }
                }
                
                $rc = execute_agi( "STREAM FILE wakeup-call-cancelled \"\" ");
                
                
            }
            break;
            
    }
    
    if ( !$rc[result] )
        $rc = execute_agi( "STREAM FILE goodbye \"\" ");
    if ( !$rc[result] )
        $rc = execute_agi( "HANGUP");
    if ($parm_debug_on)
        fclose($stdlog);
    exit;
}


// ----------------------------------------------
// This will say military time in AM/PM format
// ----------------------------------------------
function say_wakeup( $wtime )
{
    GLOBAL	$stdin, $stdout, $stdlog, $parm_debug_on;
    
    $pm = 0;
    
    if ($wtime > 1159 )
    {
        $wtime -=1200;
        $pm = 1;
    }
    
    if ($wtime <= 59 )
        $wtime += 1200;
    
    if ( strlen( $wtime ) == 3 )
        $wtime = '0' . $wtime;
    
    
    $h = substr( $wtime, 0, 2 );
    $h1 = substr( $wtime, 0, 1 );
    $h2 = substr( $wtime, 1, 1 );
    $m = substr( $wtime, 2, 2 );
    $m1 = substr( $wtime, 2, 1);
    $m2 = substr( $wtime, 3, 1);
    
    
    if ($parm_debug_on)
        fputs( $stdlog, "Wakeup time is set to $wtime\n" );
    
    $rc = execute_agi( "STREAM FILE rqsted-wakeup-for \"\" ");
    
    if ( !$rc[result] )
    {
        if ( $h1 == 0 ) 
            $rc = execute_agi( "SAY NUMBER $h2 \"\"");
        else
            $rc = execute_agi( "SAY NUMBER $h \"\"");
        
        if ( !$rc[result] )
        {
            if ($m == 0 )
                $rc = execute_agi( "STREAM FILE digits/oclock \"\" ");
            else
            {		
                if ( $m1 == 0 ) 
                {
                    $rc = execute_agi( "STREAM FILE digits/oh \"\" ");
                    $rc = execute_agi( "SAY NUMBER $m2 \"\" ");
                }
                else
                    $rc = execute_agi( "SAY NUMBER $m \"\"");
            }
            if ( !$rc[result] )
            {
                if ( $pm )
                    $rc = execute_agi( "STREAM FILE digits/p-m \"\" ");
                else
                    $rc = execute_agi( "STREAM FILE digits/a-m \"\" ");
            }
        }
    }	
}


//--------------------------------------------------
// This function will send out the command and get 
//	the response back
//--------------------------------------------------
function execute_agi( $command )
{
    GLOBAL	$stdin, $stdout, $stdlog, $parm_debug_on;
    
    fputs( $stdout, $command . "\n" );
    fflush( $stdout );
    if ($parm_debug_on)
        fputs( $stdlog, $command . "\n" );
    
    $resp = fgets( $stdin, 4096 );
    
    if ($parm_debug_on)
        fputs( $stdlog, $resp );
    
    if ( preg_match("/^([0-9]{1,3}) (.*)/", $resp, $matches) ) 
    {
        if (preg_match('/result=([-0-9a-zA-Z]*)(.*)/', $matches[2], $match)) 
        {
            $arr['code'] = $matches[1];
            $arr['result'] = $match[1];
            if (isset($match[3]) && $match[3])
                $arr['data'] = $match[3];
            return $arr;
        } 
        else 
        {
            if ($parm_debug_on)
                fputs( $stdlog, "Couldn't figure out returned string, Returning code=$matches[1] result=0\n" );	
            $arr['code'] = $matches[1];
            $arr['result'] = 0;
            return $arr;
        }
   	} 
    else 
    {
        if ($parm_debug_on)
            fputs( $stdlog, "Could not process string, Returning -1\n" );
        $arr['code'] = -1;
        $arr['result'] = -1;
        return $arr;
    }
} 
?>
 
Danke für den Hinweis, aber leider werden bei dem Php-Skript munter deutsche und englische Ansagen durcheinander abgespielt und in der Kommandozeile erscheint ebenfalls

Jan 5 19:41:37 WARNING[3477]: file.c:475 ast_openstream: File does not exist in any format
Jan 5 19:41:37 WARNING[3477]: file.c:787 ast_streamfile: Unable to open (format alaw): No such file or directory
-- Playing 'digits/3-and' (language 'de')
Jan 5 19:41:38 WARNING[3477]: file.c:475 ast_openstream: File does not exist in any format
Jan 5 19:41:38 WARNING[3477]: file.c:787 ast_streamfile: Unable to open (format alaw): No such file or directory

Mist...
 
Fehlerkorrektur

Mona hat mich auf einen Fehler beim löschen hingewiesen - THX

das Verzeichnis beim löschen eines calls war falsch angegeben;
Hier die korrigierte Version :
PHP:
#!/usr/bin/php -q
<?php
{
    // Version 1.10 2005-09-20
    // ------------
    // CONFIG Parms
    // ------------
    
    // If the application is having problems you can log to this file
    $parm_error_log = '/tmp/wakeup.log';
    
    // Set to 1 to turn on the log file
    $parm_debug_on = 1;
    
    // This is where the Temporary WakeUp Call Files will be created
    $parm_temp_dir = '/tmp';
    
    // This is where the WakeUp Call Files will be moved to when finished
    $parm_call_dir = '/var/spool/asterisk/outgoing';

    // How many times to try the call
    $parm_maxretries = 3;
    
    // How long to keep the phone ringing
    $parm_waittime = 60;		// How long to keep the phone ringing
    
    // Number of seconds between retries
    $parm_retrytime = 60;
    
    // Caller ID of who the wakeup call is from Change this to the extension you want to display on the phone
    $parm_wakeupcallerid = '"WakeUpCall" <44>';
    
    
    // Set to 1 to use the Channel
    // Set to 0 for Caller ID,  Caller IS is assumed just a number ### or "Name Name" <##>
    // The big difference is using caller ID will call ANY phone with that extension number
    // Where using Channel will only wake up the one specific phone
    $parm_chan_ext = 0;

    // ----------------------------------------------------
    // Which application to run when the call is connected.  
    $parm_application = 'MusicOnHold';
	$parm_data = '';

	// -- Use this for the ANNOY application
	//$parm_application = 'AGI';
	//$parm_data = 'wakeconfirm.agi';
    // ----------------------------------------------------

    
    //-------------------
    // END CONFIG PARMS
    //-------------------
    
    GLOBAL	$stdin, $stdout, $stdlog, $result, $parm_debug_on, $parm_test_mode;
    
    // These setting are on the WIKI pages http://www.voip-info.org
    ob_implicit_flush(false);
    set_time_limit(30);
    error_reporting(0);
    
    $stdin = fopen( 'php://stdin', 'r' );
    $stdout = fopen( 'php://stdout', 'w' );
    
    // You will see a whole bunch of this its for development or if you change anything and
    // want to write to a log file in the TMP directory
    if ($parm_debug_on)
    {
        $stdlog = fopen( $parm_error_log, 'w' );
        fputs( $stdlog, "---Start---\n" );
    }
    
    
    // ASTERISK * Sends in a bunch of variables, This accepts them and puts them in an array
    // http://www.voip-info.org/tiki-index.php?page=Asterisk%20AGI%20php
    while ( !feof($stdin) ) 
    {
        $temp = fgets( $stdin );
        
        if ($parm_debug_on)
            fputs( $stdlog, $temp );
        
        // Strip off any new-line characters
        $temp = str_replace( "\n", "", $temp );
        
        $s = explode( ":", $temp );
        $agivar[$s[0]] = trim( $s[1] );
        if ( ( $temp == "") || ($temp == "\n") )
        {
            break;
        }
    } 
    
    
    // There are two ways to contact a phone, by its channel or by its local 
    // extension number.  This next session will extract both sides
    
    // split the Channel  SIP/11-3ef4  or Zap/4-1 into is components
    $channel = $agivar[agi_channel];
    if (preg_match('.^([a-zA-Z]+)/([0-9]+)([0-9a-zA-Z-]*).', $channel, $match) )
    {
        $sta = trim($match[2]);
        $chan = trim($match[1]);
    }
    
    
    
    // Go Split the Caller ID into its components
    $callerid = $agivar[agi_callerid];
    
    // First look for the Extension in <####> 
    if (preg_match('/<([ 0-9]+)>/', $callerid, $match) )
    {
        $cidn = trim($match[1]);
    }
    else	// Did not find the <##...> look for the first number in the string to use as CID
    {
        if (preg_match('/([0-9]+)/', $callerid, $match) )
        {
            $cidn = trim($match[1]);
        }
        else
            $cidn = -1;		// I'm saying an error no caller id # found
    }
    
    
    
    // Check if we have an outstanding Wakeup Call file
    if ( $parm_chan_ext )
        $dir_check = "$chan.$sta.call";
    else
        $dir_check = "ext.$cidn.call";
    
    if ($parm_debug_on)
        fputs( $stdlog, "Checking Directory [$parm_call_dir] Check=[$dir_check]\n" );
    
    
    
    // I started to think we could have many outstanding wakup calls, but then
    // it got very confusing on how to delete just one of them.  I wasn't about
    // to prompt each and every one.  So I went back to JUST ONE wakeup call
    // But this will get a list of all of them incase of problems
    $outc=0;
    $dir_handle = opendir( $parm_call_dir );
    while( $file = readdir($dir_handle ) )
    {
        if ($parm_debug_on)
            fputs( $stdlog, "File=$file\n" );
        
        // Check if we have an outstanding wakup call
        if (strstr( $file, $dir_check ) )
            $out[$outc++] = $file;
        
    }
    closedir( $dir_handle );
    
    
    //=========================================================================
    // This is where we interact with the caller.  Answer the phone and so on
    //=========================================================================
    
    
    $rc = execute_agi( "ANSWER ");
    
    sleep(1);	// Wait for the channel to get created and RTP packets to be sent
				// On my system the welcome you would only hear 'elcome'  So I paused for 1 second

    


    if ( !$rc[result] )
        $rc = execute_agi( "STREAM FILE welcome \"\" ");
    
    // They have an outstanding wakup call
    if ( $outc )
    {
        $i = 0;
        while ( $out[$i] )
        {
            
            $wtime = strtok( $out[$i], '.' );
            
            if ($parm_debug_on)
                fputs( $stdlog, "wakeup found=$out[0] saying time $wtime\n" );
            
            
            say_wakeup( $wtime );
            $i++;
            
        }
        
    }
    
    
    // Check if any outstanding wakeup calls 
    if ( $outc )
    {
        // Start prompting them if they want to create or delete a wakeup call
        while ( !$rc[result] )
        {
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE for-wakeup-call \"12\" ");
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE press-1 \"12\" ");
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE to-cancel-wakeup \"12\" ");
            if ( !$rc[result] )
                $rc = execute_agi( "STREAM FILE press-2 \"12\" ");
            if ( !$rc[result] )
            {
                $rc = execute_agi( "WAIT FOR DIGIT 15000");
            }
            if ( $rc[result] != -1 )
            {
                if ( $rc[result] == 49 || $rc[result] == 50 )
                {
                    ; // Do nothing
                }
                else
                {
                    // This was just for fun, if they press something other than 1 or 2
                    $rc[result] = 0;
                    $rc = execute_agi( "STREAM FILE you-dialed-wrong-number \"\" ");
                    $rc = execute_agi( "STREAM FILE wrong-try-again-smarty \"\" ");
                }
                
            }
        }
    }
    else	// Default to Creating a wakeup call
        $rc[result] = '49';
    // Process which key they pressed
    //  I check most of my Return Codes incase the call is hung up
    //
    //  Being a phone person, I want to be able to skip the prompts, so I allow for entry over
    //  The prompts.  Makes for more code, but make for quicker entry after you know what to key
    //
    switch( $rc[result] )
    {
    case '49':	// Pressed 1  - This is to schedule a NEW wakeup call
        {
            $rc[result] = 0;
            while ( !$rc[result] )
            {
                $rc = execute_agi( "STREAM FILE please-enter-the \"0123456789\" ");
                
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE time \"0123456789\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE for \"0123456789\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE your \"0123456789\" ");
                
                // If we get here, they haven't pressed anything yet.
                if ( !$rc[result] )
                    $rc = execute_agi( "GET DATA wakeup-call 15000 4");
                
                if ( $rc[result] != -1 )
                {


                    if ($parm_debug_on)
                        fputs( $stdlog, "We have num digits:" . strlen( $rc[result]) . "- $rc[result] \r\n\r\n" );


                    // This check how many digits, if 2 then they pre-pressed a digit, 
                    // Otherwise it will be 4
                    if ( strlen( $rc[result] ) == 2 )
                    {
                        $num= $rc[result]-48;
                        while ( strlen($num) < 4 && $rc[result] > 0 )
                        {
                            $rc = execute_agi( "WAIT FOR DIGIT 15000");
                            if ( $rc[result] >= 48 && $rc[result] <= 57 )
                                $num .= $rc[result] - 48;
                            else	
                                $rc[result] = 0;
                            
                        }
                        if (strlen($num) == 4 )
                            $rc[result] = $num;
                    }

                    if ($parm_debug_on)
                        fputs( $stdlog, "Checking Results [$rc[result]] \r\n\r\n" );

                    // They entered 4 digits,  check if its a valid time or they hung up
                    if ( $rc[result] > 2359 || strlen( $rc[result]) < 4 || substr($rc[result],2,2) > 59 || $rc[result] < 0)
                    {
                        $rc[result] = 0;
                        //$rc = execute_agi( "STREAM FILE invalid \"\" ");
                        //$rc = execute_agi( "STREAM FILE time \"\" ");
                        $rc = execute_agi( "STREAM FILE please-try-again \"\" ");
                    }

                    if (strlen( $rc[result] ) == 4 && $rc[result] == 0 )
                        $rc[result] = -2;	// Special 00:00 time
                    
                }	
            }
            
            if ( $rc[result] == -2 )
                $rc[result] = '0000';	
            else if ( $rc[result] == -1 )
                exit;			// The user hung up
            
            
            
            // Save the time entered
            $wtime = $rc[result];
            
            
            // We don't know who the user is, so if its less than 1300 it could be AM or PM, so prompt
            // them for am pm
            if ( $wtime != -1 && $wtime < 1300 )
            {
                $rc[result] = 0;
                while ( !$rc[result] )
                {
                    
                    if ( !$rc[result] )
                        $rc = execute_agi( "GET DATA 1-for-am-2-for-pm 15000 1");
                    
                }	
                
                switch( $rc[result] )
                {
                case '1':			// Set to AM should be under 1159 or less
                    if ( $wtime > 1159 )
                        $wtime -= 1200;
                    $rc[result] = 0;
                    break;
                    
                case '2':			// Set to PM should be equal or over 1200
                    if ( $wtime < 1159 )
                        $wtime += 1200;
                    $rc[result] = 0;
                    break;
                }
            }
            
            
            // At this point we have a millitary time in the $wtime variable
            if ( $parm_chan_ext )
			{
                $wakefile = "$parm_temp_dir/$wtime.$chan.$sta.call";
				$callfile = "$parm_call_dir/$wtime.$chan.$sta.call";
			}
            else
			{
                $wakefile = "$parm_temp_dir/$wtime.ext.$cidn.call";
                $callfile = "$parm_call_dir/$wtime.ext.$cidn.call";
			}            

            if ($parm_debug_on)
                fputs( $stdlog, "Wakeup File [$wakefile]\n" );
            
            // Open up a wakeup file to write it out.
            $wuc = fopen( $wakefile, 'w');
            
            if ( $wuc )
            {
                // Delete any old Wakeup call files this one will override 
                for ($i=0; $i < $outc; $i++ )
                {
                    if( file_exists( "$parm_call_dir/$out[$i]" ) )
                    {
                        if ($parm_debug_on)
                            fputs( $stdlog, "Unlinking Old File [$parm_call_dir/$out[$i]]\n" );
                        
                        unlink( "$parm_call_dir/$out[$i]" );
                    }
                }
                
                // I've noticed that the other WAKEUP example has a different format.  This worked for me
                // Here is where we either make the call to the Extension or the Channel.  Extension
                // is the better way to go, but required the caller ID information.  Where Channel
                // should always get you back to where you were called from, provided its on your system
                if ( $parm_chan_ext )
                    fputs( $wuc, "channel: $chan/$sta\n" );
                else
                    fputs( $wuc, "channel: Local/$cidn@$agivar[agi_context]\n" );
                
                fputs( $wuc, "maxretries: $parm_maxretries\n");
                fputs( $wuc, "retrytime: $parm_retrytime\n");
                fputs( $wuc, "waittime: $parm_waittime\n");
                fputs( $wuc, "callerid: $parm_wakeupcallerid\n");

				fputs( $wuc, "application: $parm_application\n");
				fputs( $wuc, "data: $parm_data\n");
                
                fclose( $wuc );
		
				$w = getdate();

				$w['hours']   = substr( $wtime, 0, 2 );
				$w['minutes'] = substr( $wtime, 2, 2 );
				
				$time_wakeup = mktime( substr( $wtime, 0, 2 ), substr( $wtime, 2, 2 ), 0, $w[mon], $w[mday], $w[year] );

				$time_now = time( );

                if ($parm_debug_on)
                    fputs( $stdlog, 'time_wakeup=' . date('l dS \of F Y h:i:s A', $time_wakeup) . " ($time_wakeup) | time_now=" . date('l dS \of F Y h:i:s A',$time_now) . " ($time_now)\n" );

				if ( $time_wakeup <= $time_now )
					$time_wakeup += 86400; // Add One Day on

                if ($parm_debug_on)
                    fputs( $stdlog, 'Setting WAKEUP file to =' . date('l dS \of F Y h:i:s A', $time_wakeup) . " - $time_wakeup\n" );


				touch( $wakefile, $time_wakeup, $time_wakeup );

				rename( $wakefile, $callfile );
				
            }
            else
            {
                // Couldn't open the file.  Make sure you created the /var/lib/asterisk/wakeups directory
                if ($parm_debug_on)
                    fputs( $stdlog, "Error opening file [$wakefile]\n" );
                
                $rc = execute_agi( "STREAM FILE something-terribly-wrong \"\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE goodbye \"\" ");
                if ( !$rc[result] )
                    $rc = execute_agi( "HANGUP");
                exit;
            }
            
            //  If we have a caller ID  and waking up by extension say the extension number
            if ( $cidn && $parm_chan_ext == 0 )
            {
                $rc = execute_agi( "STREAM FILE for \"\" ");
                
                if ( !$rc[result] )
                    $rc = execute_agi( "STREAM FILE extension \"\" ");
                
                                    
                if ( !$rc[result] )
                    $rc = execute_agi( "SAY DIGITS $cidn \"\" ");
                
            }
            
            say_wakeup( $wtime );
            $rc[result] = 0;
            
        }
        break;
        
        // This is the END Of a new wakeup call
        
        
        case '50':	// Pressed 2 - Delete old wakeup calls
            {
                // Go through the list of old files and unlink/delete them
                for ($i=0; $i < $outc; $i++ )
                {
		if ($parm_debug_on)
        		fputs( $stdlog, "Checking Directory [$parm_call_dir] Check=[$parm_call_dir/$out[$i]]\n" );
                    if( file_exists( "$parm_call_dir/$out[$i]" ) )
                    {
                        if ($parm_debug_on)
                            fputs( $stdlog, "Unlinking Wakeup File [$parm_temp_dir/$out[$i]]\n" );
                        
                        unlink( "$parm_call_dir/$out[$i]" );
                    }
                }
                
                // If Caller ID and recording by Extension then say the extension
                if ( $cidn && $parm_chan_ext == 0 )
                {
                    $rc = execute_agi( "STREAM FILE for \"\" ");
                    
                    if ( !$rc[result] )
                        $rc = execute_agi( "STREAM FILE extension \"\" ");
                    
                    
                    $L = strlen( $cidn );
                    
                    for( $i = 0; $i < $L && !$rc[result]; $i++ )
                    {
                        $cid_digits = substr( $cidn, $i, 1 );
                        
                        if ( !$rc[result] )
                            $rc = execute_agi( "SAY NUMBER $cid_digits \"\" ");
                    }
                }
                
                $rc = execute_agi( "STREAM FILE wakeup-call-cancelled \"\" ");
                
                
            }
            break;
            
    }
    
    if ( !$rc[result] )
        $rc = execute_agi( "STREAM FILE goodbye \"\" ");
    if ( !$rc[result] )
        $rc = execute_agi( "HANGUP");
    if ($parm_debug_on)
        fclose($stdlog);
    exit;
}


// ----------------------------------------------
// This will say military time in AM/PM format
// ----------------------------------------------
function say_wakeup( $wtime )
{
    GLOBAL	$stdin, $stdout, $stdlog, $parm_debug_on;
    
    $pm = 0;
    
    if ($wtime > 1159 )
    {
        $wtime -=1200;
        $pm = 1;
    }
    
    if ($wtime <= 59 )
        $wtime += 1200;
    
    if ( strlen( $wtime ) == 3 )
        $wtime = '0' . $wtime;
    
    
    $h = substr( $wtime, 0, 2 );
    $h1 = substr( $wtime, 0, 1 );
    $h2 = substr( $wtime, 1, 1 );
    $m = substr( $wtime, 2, 2 );
    $m1 = substr( $wtime, 2, 1);
    $m2 = substr( $wtime, 3, 1);
    
    
    if ($parm_debug_on)
        fputs( $stdlog, "Wakeup time is set to $wtime\n" );
    
    $rc = execute_agi( "STREAM FILE rqsted-wakeup-for \"\" ");
    
    if ( !$rc[result] )
    {
        if ( $h1 == 0 ) 
            $rc = execute_agi( "SAY NUMBER $h2 \"\"");
        else
            $rc = execute_agi( "SAY NUMBER $h \"\"");
        
        if ( !$rc[result] )
        {
            if ($m == 0 )
                $rc = execute_agi( "STREAM FILE digits/oclock \"\" ");
            else
            {		
                if ( $m1 == 0 ) 
                {
                    $rc = execute_agi( "STREAM FILE digits/oh \"\" ");
                    $rc = execute_agi( "SAY NUMBER $m2 \"\" ");
                }
                else
                    $rc = execute_agi( "SAY NUMBER $m \"\"");
            }
            if ( !$rc[result] )
            {
                if ( $pm )
                    $rc = execute_agi( "STREAM FILE digits/p-m \"\" ");
                else
                    $rc = execute_agi( "STREAM FILE digits/a-m \"\" ");
            }
        }
    }	
}


//--------------------------------------------------
// This function will send out the command and get 
//	the response back
//--------------------------------------------------
function execute_agi( $command )
{
    GLOBAL	$stdin, $stdout, $stdlog, $parm_debug_on;
    
    fputs( $stdout, $command . "\n" );
    fflush( $stdout );
    if ($parm_debug_on)
        fputs( $stdlog, $command . "\n" );
    
    $resp = fgets( $stdin, 4096 );
    
    if ($parm_debug_on)
        fputs( $stdlog, $resp );
    
    if ( preg_match("/^([0-9]{1,3}) (.*)/", $resp, $matches) ) 
    {
        if (preg_match('/result=([-0-9a-zA-Z]*)(.*)/', $matches[2], $match)) 
        {
            $arr['code'] = $matches[1];
            $arr['result'] = $match[1];
            if (isset($match[3]) && $match[3])
                $arr['data'] = $match[3];
            return $arr;
        } 
        else 
        {
            if ($parm_debug_on)
                fputs( $stdlog, "Couldn't figure out returned string, Returning code=$matches[1] result=0\n" );	
            $arr['code'] = $matches[1];
            $arr['result'] = 0;
            return $arr;
        }
   	} 
    else 
    {
        if ($parm_debug_on)
            fputs( $stdlog, "Could not process string, Returning -1\n" );
        $arr['code'] = -1;
        $arr['result'] = -1;
        return $arr;
    }
} 
?>
 
Was genau wird denn ausgeührt bei der Zeile:

$parm_application = 'MusicOnHold';

Ich habe nämlich versucht, hier
$parm_application ='Mp3Player(/var/lib/....)';

auszuführen, da kommt aber:

ast_pbx_run_app: No such application 'MP3Player(/var/lib...wakeup.mp3)'
 
versuche mal:
$parm_application ='Mp3Player';
$parm_data = '/var/lib...wakeup.mp3';
 
Vielen Dank für den Tipp!
 
hier eine Möglichkeit per extension.conf Weckrufe wieder zu löschen.
Gelöscht werden alle Weckrufe die von dieser CallerID programmiert wurden.

Code:
;;Weckruf_canceln  
 exten => 998,1,Answer  
 exten => 998,n,Wait(1)  
 exten => 998,n,Playback(weckruf_del)  
 exten => 998,n,TrySystem(rm /tmp/wakeups/*.${CALLERID(number)}.call)  exten => 998,n,Wait(1)  
 exten => 998,n,Playback(vm-goodbye)  
 exten => 998,n,Hangup

Das "weckruf_del.gsm" sollte natürlich bei Euch vorhanden sein, sonst gibet eine Fehlermeldung.
Hier könnt Ihr Euch beliebige Sound-Files erstellen lassen

http://www.nuance.com/realspeak/demo/default.asp

danach dann mit dem Freeware-Tool "Wavepad" umwandeln in ein .gsm.
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.