Skip to content

Commit 1ca5492

Browse files
committed
Merge pull request #31 from marcelog/v2.0.0
V2.0.0
2 parents 319a960 + 31f9c59 commit 1ca5492

File tree

147 files changed

+17567
-2235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+17567
-2235
lines changed

.codeclimate.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
engines:
2+
duplication:
3+
enabled: true
4+
config:
5+
languages:
6+
- php
7+
fixme:
8+
enabled: false
9+
phpcodesniffer:
10+
enabled: true
11+
phpmd:
12+
enabled: true
13+
14+
ratings:
15+
paths:
16+
- "**.php"
17+
18+
exclude_paths:
19+
- test/**/*

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: php
2+
php:
3+
- '5.4'
4+
- '5.5'
5+
- '5.6'
6+
- '7.0'
7+
8+
before_script:
9+
- phpenv config-add test/resources/php.ini
10+
11+
install:
12+
- composer install
13+
14+
script:
15+
- vendor/bin/phing build
16+
17+
after_script:
18+
- travis_retry php vendor/bin/coveralls -v
19+
- vendor/bin/test-reporter
20+
21+
addons:
22+
code_climate:
23+
repo_token: 568675e210a5bfc69593877127f7297bab3150dc4d26692bd19bc49c75bd2c14

README.Autoloader

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 71 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,53 @@
1-
Introduction
2-
============
1+
[![License](https://poser.pugx.org/marcelog/PAGI/license)](https://packagist.org/packages/marcelog/PAGI)
2+
[![Latest Stable Version](https://poser.pugx.org/marcelog/PAGI/v/stable)](https://packagist.org/packages/marcelog/PAGI)
3+
[![Documentation Status](https://readthedocs.org/projects/pami/badge/?version=latest)](http://pami.readthedocs.org/en/latest/?badge=latest)
4+
5+
[![Build Status](https://travis-ci.org/marcelog/PAGI.svg)](https://travis-ci.org/marcelog/PAGI)
6+
[![Coverage Status](https://coveralls.io/repos/marcelog/PAGI/badge.svg?branch=master&service=github)](https://coveralls.io/github/marcelog/PAGI?branch=master)
7+
[![Code Climate](https://codeclimate.com/github/marcelog/PAGI/badges/gpa.svg)](https://codeclimate.com/github/marcelog/PAGI)
8+
[![Issue Count](https://codeclimate.com/github/marcelog/PAGI/badges/issue_count.svg)](https://codeclimate.com/github/marcelog/PAGI)
9+
10+
# Introduction
11+
312
This framework is intended to simply making ivr applications using Asterisk's
413
AGI, providing a nice level of abstraction over what an IVR should look like
514
from a developers' perspective.
615

716
Resources:
817

9-
* [Complete PAGI/PAMI talk for the PHP Conference Argentina 2013](http://www.slideshare.net/mgornstein/phpconf-2013). Check the slide notes for the complete text :)
1018
* [Main Site](http://marcelog.github.com/PAGI)
19+
* [API](https://github.com/marcelog/PAGI/blob/master/doc/ApiIndex.md)
20+
* [Complete PAGI/PAMI talk for the PHP Conference Argentina 2013](http://www.slideshare.net/mgornstein/phpconf-2013). Check the slide notes for the complete text :)
1121
* [In-depth tutorial](http://marcelog.github.com/articles/pagi_tutorial_create_voip_telephony_application_for_asterisk_with_agi_and_php.html)
1222
* [An example IVR application that includes unit tests is available here](https://github.com/marcelog/Pagi-App-And-Test-Example)
13-
* [API](http://ci.marcelog.name:8080/job/PAGI/javadoc/)
14-
* [CI (Jenkins)](http://ci.marcelog.name/ provides API, metrics, and distributables).
15-
* [Packagist Home](http://packagist.org/packages/marcelog/pagi)
1623
* [Professional Telephony Applications at hand](http://sdjournal.org/a-practical-introduction-to-functional-programming-with-php-sdj-issue-released/) The march edition of [Software Developer Journal](http://sdjournal.org/) features a complete article about writing telephony applications with PAMI and PAGI.
1724

18-
Contact me
19-
----------
20-
If you have any questions, issues, feature requests, or just want to report
21-
your "success story", or maybe even say hi, please send an email to marcelog@gmail.com
25+
# Installing
26+
Add this library to your [Composer](https://packagist.org/) configuration. In
27+
composer.json:
28+
```json
29+
"require": {
30+
"marcelog/pagi": "2.*"
31+
}
32+
```
2233

23-
Included Example
24-
----------------
25-
Please see **docs/examples** for all the included examples.
34+
# Quickstart
2635

2736
You can start by *docs/examples/quickstart* for a very basic example. You'll need something like this in your dialplan:
2837

2938
[default]
3039
exten => 1,1,AGI(/path/to/PAGI/docs/examples/quickstart/run.sh,a,b,c,d)
3140
exten => 1,n,Hangup
3241

33-
Available via Composer
34-
----------------------
35-
Just add the package "marcelog/pagi":
36-
37-
{
38-
"require": {
39-
"marcelog/pagi": "dev-master"
40-
},
41-
"repositories": [
42-
{
43-
"type": "pear",
44-
"url": "http://pear.apache.org/log4php/"
45-
}]
46-
}
47-
48-
Packagist URL: (http://packagist.org/packages/marcelog/pagi)
49-
50-
Available via PEAR
51-
------------------
52-
You can now easily install PAGI by issuing:
53-
54-
pear channel-discover pear.marcelog.name
55-
pear install marcelog/PAGI
56-
57-
or
42+
# Testing IVR applications
5843

59-
pear install marcelog/PAGI-X.Y.Z
60-
just replace X.Y.Z by the release version you'd like to install :)
61-
62-
See the [pear channel](http://pear.marcelog.name/)
63-
64-
Available as PHAR
65-
-----------------
66-
Just go to the [Jenkins server](http://ci.marcelog.name) and grab the latest
67-
phar distribution from the PAGI job.
68-
69-
Testing IVR applications
70-
========================
7144
A mocked pagi client is included to easily test your ivr applications. See
7245
**docs/examples/mock** to see an example of how to use it.
7346

74-
Nodes
75-
=====
47+
# Features
48+
49+
## Nodes
50+
7651
For a tutorial about nodes, see [this article](http://marcelog.github.com/articles/pagi_node_call_flow_easy_telephony_application_for_asterisk_php.html)
7752

7853
Simple Call Flow Nodes are available (see **docs/examples/node/example.php**). Using
@@ -100,17 +75,17 @@ callback, etc. For an example, see docs/examples/nodecontroller/example.php
10075

10176
An article about the node controller is available [here](http://marcelog.github.com/articles/making_your_ivr_nodes_call_flow_with_pagi_and_php_asterisk.html)
10277

103-
AutoDial
104-
========
78+
## AutoDial
79+
10580
CallFiles are supported. You can also schedule a call in the future.
10681

107-
Fax
108-
===
82+
## Fax
83+
10984
Sending and receiving faxes is supported using spandsp (applications SendFax
11085
and ReceiveFax).
11186

112-
Available Facades
113-
=================
87+
## Available Facades
88+
11489
* PAGI\Client\CDR: Provided to access cdr variables.
11590
* PAGI\Client\ChannelVariables: Provided to access channel variables and asterisk
11691
environment variables.
@@ -121,11 +96,11 @@ environment variables.
12196
* PAGI\Logger\Asterisk: Provides access to asterisk logger (see logger.conf in
12297
your asterisk installation).
12398

124-
Results
125-
=======
99+
## Results
100+
126101
For every operation, a Result is provided. Some operations decorate this
127102
Result to add functionality, like PlayResult, ReadResult, etc. For example,
128-
a stream file will return a PlayResult, which decorates a ReadResult which
103+
a stream file will return a PlayResult, which decorates a ReadResult which
129104
in turn, decorated a Result.
130105

131106
* PAGI\Client\DialResult
@@ -134,23 +109,41 @@ in turn, decorated a Result.
134109
* PAGI\Client\PlayResult
135110
* PAGI\Client\FaxResult
136111

137-
Debugging, logging
138-
==================
139-
You need [log4php](http://logging.apache.org/log4php/). Just make sure you
140-
copy it to the include_path and PAGI will pick it up from there (the
141-
directory *src/main/php* is the one that needs to be in the include_path).
142-
143-
Developers
144-
==========
145-
* build.xml is a phing build file, not ant.
146-
* It's very possible that you may need to edit build.properties.
147-
* Available main targets: all, build, test, report.
148-
* Tools run: phpdoc, phploc, phpcs, phpmd, phpcpd, phpdepend, phpunit.
149-
* Setup your installation by editing pear and php paths in build.properties
150-
* Run phing install-dependencies this will install pear and everything needed
151-
to run phing tests and metrics.
152-
* Copy resources/php.ini.example to resources/php.ini and edit it.
153-
* Run phing all
112+
## Debugging, logging
113+
114+
You can optionally set a [PSR-3](http://www.php-fig.org/psr/psr-3/) compatible logger:
115+
```php
116+
$pagi->setLogger($logger);
117+
```
118+
119+
By default, the client will use the [NullLogger](http://www.php-fig.org/psr/psr-3/#1-4-helper-classes-and-interfaces).
120+
121+
# Developers
122+
This project uses [phing](https://www.phing.info/). Current tasks include:
123+
* test: Runs [PHPUnit](https://phpunit.de/).
124+
* cs: Runs [CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).
125+
* doc: Runs [PhpDocumentor](http://www.phpdoc.org/).
126+
* md: runs [PHPMD](http://phpmd.org/).
127+
* build: This is the default task, and will run all the other tasks.
128+
129+
## Running a phing task
130+
To run a task, just do:
131+
132+
```sh
133+
vendor/bin/phing build
134+
```
135+
136+
## Contributing
137+
To contribute:
138+
* Make sure you open a **concise** and **short** pull request.
139+
* Throw in any needed unit tests to accomodate the new code or the
140+
changes involved.
141+
* Run `phing` and make sure everything is ok before submitting the pull
142+
request (make phpmd and CodeSniffer happy, also make sure that phpDocumentor
143+
does not throw any warnings, since all our documentation is automatically
144+
generated).
145+
* Your code must comply with [PSR-2](http://www.php-fig.org/psr/psr-2/),
146+
CodeSniffer should take care of that.
154147

155148
LICENSE
156149
=======

UPGRADING-FROM-1.8

Lines changed: 0 additions & 16 deletions
This file was deleted.

build.properties

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)