Skip to content

Commit

Permalink
composer issue fixed and documentation updated for diagrams / flowchart
Browse files Browse the repository at this point in the history
  • Loading branch information
nasirbest committed Mar 9, 2017
1 parent 5c981b1 commit e7a0151
Show file tree
Hide file tree
Showing 18 changed files with 158 additions and 61 deletions.
13 changes: 13 additions & 0 deletions CHANGLOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
ICTCore 0.7.5
--------------

Dated: 07-March-2017

* Extension support added for accounts
* Twig based template added for gateway configurations and Application data
* Data and Token libraries updated
* Sip, SMTP and SMPP added as provider sub-type
* Multi tasking support improved for Task and Schedule
* Namespaces and PSR-4 based auto-loading support added
* PhpUnit support added for unit testing

ICTCore 0.7.0
--------------

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ Getting started
Following is an example about sending fax by using ICTCore

// prepare a program with fax document
$programData = array('file_name' => '/some/pdf/file.pdf');
$faxProgram = new Sendfax(null, array('data' => $programData));
$faxProgram = new Sendfax();
$faxProgram->file_name = '/some/pdf/file.pdf';
$faxProgram->save();
$faxProgram->compile();

// create a transmission
$contact_id = 12;
Expand Down
4 changes: 3 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ ICTCore TODOs
1. Complete multi tenant support
2. Route / Billing support
3. Multiple node support / scalability
4. Email and SMS delivery tracking
4. Email and SMS delivery tracking
5. IVR Program, to allow custom scenarios via APIs
5. Campaign support
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"require": {
"jacwright/restserver": "dev-master",
"swiftmailer/swiftmailer": "@stable",
"nategood/httpful": "^0.2.20",
"aza/thread": "^1.1",
"twig/twig": "^1.28"
"twig/twig": "^1.28",
"jacwright/restserver": "dev-master"
},
"autoload": {
"psr-4": {
"ICT\\Core\\": ["core/", "core/lib/"],
"ICT\\Core\\Test\\": ["tests/core/", "tests/core/lib/"]
}
},
"require-dev": {
}
}
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions core/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public function dissociate()
}

/**
* Compile given program with current account
* Deploy given program with current account
* ( only if given program support it )
* @param \ICT\Core\Program $oProgram
* @return int $program_id
Expand All @@ -372,7 +372,7 @@ public function install_program(Program $oProgram)
$oProgram->{$parameter_name} = $oToken->render_variable($parameter_value, Token::KEEP_ORIGNAL);
}
$oProgram->save();
$oProgram->compile();
$oProgram->deploy();
return $oProgram->program_id;
}

Expand Down
1 change: 1 addition & 0 deletions core/Api/ProgramApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function create($program_name = null, $data = array())
$this->set($oProgram, $data);

if ($oProgram->save()) {
$oProgram->deploy();
return $oProgram->program_id;
} else {
throw new CoreException(417, 'Program creation failed');
Expand Down
2 changes: 1 addition & 1 deletion core/Program.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ protected function _load()
*/
protected function resource_load_account()
{
if (isset($this->account_id) && !empty($this->account_id)) {
if (!Token::is_token($this->account_id) && !empty($this->account_id)) {
$oAccount = new Account($this->account_id);
return $oAccount;
}
Expand Down
2 changes: 1 addition & 1 deletion core/Program/Emailtofax.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function parameter_save()
*/
protected function resource_load_account()
{
if (isset($this->account_id) && !empty($this->account_id)) {
if (!Token::is_token($this->account_id) && !empty($this->account_id)) {
$oAccount = new Account($this->account_id);
return $oAccount;
} else if (isset($this->email) && !empty($this->email)) {
Expand Down
2 changes: 1 addition & 1 deletion core/Program/Faxtoemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function parameter_save()
*/
protected function resource_load_account()
{
if (isset($this->account_id) && !empty($this->account_id)) {
if (!Token::is_token($this->account_id) && !empty($this->account_id)) {
$oAccount = new Account($this->account_id);
return $oAccount;
} else if (isset($this->phone) && !empty($this->phone)) {
Expand Down
3 changes: 2 additions & 1 deletion core/Program/Receiveemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use ICT\Core\Result;
use ICT\Core\Scheme;
use ICT\Core\Service\Email;
use ICT\Core\Token;
use ICT\Core\Transmission;

class Receiveemail extends Program
Expand Down Expand Up @@ -60,7 +61,7 @@ public function parameter_save()
*/
protected function resource_load_account()
{
if (isset($this->account_id) && !empty($this->account_id)) {
if (!Token::is_token($this->account_id) && !empty($this->account_id)) {
$oAccount = new Account($this->account_id);
return $oAccount;
} else if (isset($this->email) && !empty($this->email)) {
Expand Down
3 changes: 2 additions & 1 deletion core/Program/Receivefax.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use ICT\Core\Result;
use ICT\Core\Scheme;
use ICT\Core\Service\Fax;
use ICT\Core\Token;
use ICT\Core\Transmission;

class Receivefax extends Program
Expand Down Expand Up @@ -78,7 +79,7 @@ public function parameter_save()
*/
protected function resource_load_account()
{
if (isset($this->account_id) && !empty($this->account_id)) {
if (!Token::is_token($this->account_id) && !empty($this->account_id)) {
$oAccount = new Account($this->account_id);
return $oAccount;
} else if (isset($this->phone) && !empty($this->phone)) {
Expand Down
3 changes: 2 additions & 1 deletion core/Program/Receivesms.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use ICT\Core\Result;
use ICT\Core\Scheme;
use ICT\Core\Service\Sms;
use ICT\Core\Token;
use ICT\Core\Transmission;

class Receivesms extends Program
Expand Down Expand Up @@ -60,7 +61,7 @@ public function parameter_save()
*/
protected function resource_load_account()
{
if (isset($this->account_id) && !empty($this->account_id)) {
if (!Token::is_token($this->account_id) && !empty($this->account_id)) {
$oAccount = new Account($this->account_id);
return $oAccount;
} else if (isset($this->phone) && !empty($this->phone)) {
Expand Down
13 changes: 13 additions & 0 deletions core/lib/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,17 @@ public function render_string_callback($org_matchs)
}
}

/**
* Test if given text is a token placeholder or not
* @param string $subject what we need to examine
* @return boolean test result true or false
*/
public static function is_token($subject) {
if (preg_match("/^\[(([\w]+)(:[\w]+)*)\]$/", $subject)) {
return true;
} else {
return false;
}
}

}
72 changes: 42 additions & 30 deletions docs/dependencies.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
System Dependencies
===================
Linux (GPL)
Freeswitch (MPL 1.1 License)
Sendmail (Sendmail License)
Kannel (BSD-style)
PHP (BSD)
Apache (Apache License 2.0)
MySQL (GPL) or MariaDB (LGPL)
* Linux (GPL)
* Freeswitch (MPL 1.1 License)
* Sendmail (Sendmail License)
* Kannel (BSD-style)
* PHP (BSD)
* Apache (Apache License 2.0)
* MySQL (GPL) or MariaDB (LGPL)

composer (MIT)
jacwright (MIT)
nategood (MIT)
swiftmailer (MIT)

ioncube-loader (Commercial)
* composer (MIT)
* twig (BSD)
* jacwright (MIT)
* nategood (MIT)
* swiftmailer (MIT)
* aza/thread (MIT)


Class Dependencies
==================
Core
Program
Message / Data
Application
Gateway
Event
Dialplan (for inbound programs only)
Account
Transmission
Account
Contact
Spool
Result
Sequence
Request
Dialplan
Response

### Common Libraries
* Conf
* Data
* DB
* Log
* Scheme
* Session
* Thread
* Token

### Core (Communication Related)
* Request
* Response
* Dialplan
* Program
* Message / Data
* Application
* Gateway
* Action
* Dialplan (for inbound programs only)
* Account
* Transmission
* Account
* Contact
* Spool
* Result
* Service
* Gateway
14 changes: 8 additions & 6 deletions docs/intro_components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Basic components of ICTCore
===========================
Before starting developed with ICTCore, it is recommended to get an introduction with basic building block of ICTCore. for ease of understanding, we can divide them into four main categories as mentioned in following.
Before starting development with ICTCore, it is recommended to get an introduction with basic building block of ICTCore. for ease of understanding, we can divide them into four main categories as mentioned in following.

1. User Data
2. Logic
Expand All @@ -27,7 +27,7 @@ Stored data / file holding information received or need to be delivered via some
4. Text (for sms)


Logic
Logic
-----
In ICTCore we have tried to keep logic related components independent and separate from other technical things. there are three components in this category.

Expand Down Expand Up @@ -100,8 +100,8 @@ Telecommunication engine / backend like Asterisk, Freeswitch, Sendmail etc .. cu
2. Sendmail
3. Kannel

### Schedule
In case some transmission need scheduling, reminder or a transmission configured for retry got failed, don't worry Schedule is here to take care of such things.
### Task and Schedule
In case a transmission or some other action require a delay execution, Task and Schedule interfaces can be used for that. For example a reminder or failed transmission can be configured for retry, by using Schedule interface.


Infrastructure
Expand All @@ -116,6 +116,8 @@ Currently we only support Providers but later on we will add other components.
5. (TODO) Backup servers

### Provider
A trunk, 3rd party provider required to originate / terminate transmissions.

A trunk, 3rd party provider required to originate / terminate transmissions. ICTCore support following 3 type providers

1. Sip for Voice and Fax
2. Smpp for SMS
3. Sendmail for Email
Loading

0 comments on commit e7a0151

Please sign in to comment.