Asterisk PBX PHP Scripts Part 1

I need a script written using PHPAGI that can be called from Asterisk Dialplan. A datetime string will appear as YYYYMMDDHHMMSS. (Year,Month,Days,Hour,Minute and Seconds).

1. Function SubDate() - This function will Subtract two datetime variables and return a number of seconds, minutes, hours, days or a new datetime string. It should be able to handle leap years. Example: SubDate(datetime1, datetime2,seconds|minutes|hours|days|datetime)

2. Function AddDays() - This function will add days to a datetime string and return a new datetime string. AddDays(datetime, increment)

3. Function AddHour() - This function will add 'X' hours to a datetime string. Example: AddHour(datetime, increment)

4. Function AddMin() - This function will add 'X'minutes to a datetime sting. Example: AddMin(datetime, increment).

These are not related to datetime:

5. Function AddFile(<file1> TO <file2>) - This function will concatenate <file1> to the end of <file2>. File1 or 2 will be full path to files including extension. File will be voice files such as .wav, .gsm or ulaw.

6. CopyFile(<file1> TO <file2>) - This function will copy a file1 to file2.

7. DeleteFile(<file>) - This function will delete a file - The name will be the full path to file.

8. ListFiles(<pattern> TO <Database-table> - This function will add to table any files that match pattern. Table fields are file including path, file size, file datetime. Pattern could be var/lib/asterisk/sounds/custom/*.* for example.

9. Lower(string) - This function will convert string or parts of string to lower case. Example Lower("My Name Is Bart") to "my name is bart"

10. MakeDir(<directory>) - This function will create a new directory

11. PrintFile(<message>) - This function will print <message> to printer.

12. ReadFile([-b] <ascii file TO <table>) - this function will read an ascii file to a table. It's assumed that ascii file is delimited with ','. However if -b is used, then it will be delimited with space. The table will already exist.

13 RemoveDir([-r] <directory>) - This function will remove a directory. If -r is set, then it will remove recursively.

14. RenameFile(<file1 TO <file2>) - This function will rename an existing file.

15. Upper(string) - This function convert a string to all upper case.

I think that's all :)


Taidot: Asterisk PBX, Linux, PHP

Näytä lisää: think recursively, string pattern match, string pattern, string match, string b, return path, recursively, php create table, pbx database, pattern string, parts database example, match string, custom voice message, c string pattern, create table php, read pbx php, php asterisk pattern, pbx php script, pbx php, using asterisk, php create function, file2, sting, PHP SCRIPTS, php extension

Tietoa työnantajasta:
( 39 arvostelua ) Buena Park, United States

Projektin tunnus: #509447