https://github.com/masterfermin02/vicidial-api-wrapper
  
  
    Elegant and simple Implementation to integrate Vicidial API 
    https://github.com/masterfermin02/vicidial-api-wrapper
  
php php-sdk sdk vicidial wrapper-api
        Last synced: 2 months ago 
        JSON representation
    
Elegant and simple Implementation to integrate Vicidial API
- Host: GitHub
- URL: https://github.com/masterfermin02/vicidial-api-wrapper
- Owner: masterfermin02
- Created: 2021-02-24T04:49:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-29T15:03:17.000Z (10 months ago)
- Last Synced: 2025-08-21T01:27:57.006Z (2 months ago)
- Topics: php, php-sdk, sdk, vicidial, wrapper-api
- Language: PHP
- Homepage: https://github.com/masterfermin02/vicidial-api-wrapper
- Size: 99.6 KB
- Stars: 22
- Watchers: 4
- Forks: 14
- Open Issues: 0
- 
            Metadata Files:
            - Readme: README.md
 
Awesome Lists containing this project
README
          # Vicidial API PHP WRAPPER
Beautiful and simple Implementation to integrate Vicidial API
DISCLAIMER: VICIdial is a registered trademark of the Vicidial Group which i am not related in anyway.
VICIDIAL is a software suite that is designed to interact with the Asterisk Open-Source PBX Phone system to act as a complete inbound/outbound contact center suite with inbound email support as well.
http://www.vicidial.org/vicidial.php
Vicidial has an AGENT API and NON AGENT API, this classes are intended to make it easier to use in PHP
- http://vicidial.org/docs/NON-AGENT_API.txt
- http://vicidial.org/docs/AGENT_API.txt
## Install
Requires PHP 8.1
`composer require masterfermin02/vicidial-api-wrapper`
### For PHP 7.4+ must install this version
`composer require masterfermin02/vicidial-api-wrapper:1.0.3`
## How to use it
Example 1: Update fields on agent screen
```php
agent();
     echo $agentApi->updateFields("gabriel", $fields);
} catch (Exception $e) {
     echo 'Exception: ',  $e->getMessage(), "\n";
}
```
Example 2:  Hangup Call, Dispo it and Pause Agent
```php
agent();
     $agentApi->pause("gabriel", "PAUSE");
     $agentApi->hangup("gabriel");
     $agentApi->dispo("gabriel", ['value' => 'SALE']);
     $agentApi->pauseCode("gabriel", "BREAK");
} catch (Exception $e) {
     echo 'Exception: ',  $e->getMessage(), "\n";
}
```
Example 3: Update fields on agent screen
```php
    agent();
         echo $agentApi->updateFields("gabriel", $fields);
    } catch (Exception $e) {
         echo 'Exception: ',  $e->getMessage(), "\n";
    }
```
### Vicidial admin or No agent api
```php
    admin();
        echo $agentApi->mohList([
            'format' => 'selectframe',
            'comments' => 'fieldname',
            'stage' => 'date'
        ]);
    } catch (Exception $e) {
        echo 'Exception: ',  $e->getMessage(), "\n";
    }
```
Url encode
```php
    admin();
        echo $agentApi
        ->withUrlEncode(true)
        ->addLead($fields);
    } catch (Exception $e) {
        echo 'Exception: ', $e->getMessage(), "\n";
    }
```
Login remote agent
```php
    remoteAgent();
        $remoteAgent->active(
            getenv('agentId'),
            getenv('confExten'),
        );
        $remoteAgent->hangUp(
            "gabriel",
            [
            'status' => 'SALE',
            ]
]
        );
        $remoteAgent->inActive(
            getenv('agentId'),
            getenv('confExten'),
        );
    } catch (Exception $e) {
        echo 'Exception: ',  $e->getMessage(), "\n";
    }
```
### Docs:
- [Agent](https://github.com/masterfermin02/vicidial-api-wrapper/blob/main/docs/agent.md)
- [Admin](https://github.com/masterfermin02/vicidial-api-wrapper/blob/main/docs/admin.md)