Download the PHP package codego/php-ksip-telnet without Composer

On this page you can find all versions of the php package codego/php-ksip-telnet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-ksip-telnet

php-ksip-telnet

A PHP library for managing FreePBX/Asterisk PJSIP extensions remotely via SSH.

FreePBX-Safe Extension Creation

Direct SQL inserts into users, devices, sip, or the generic pjsip table can produce half-created extensions that appear in dialplan but are not fully managed FreePBX endpoints.

This library now expects extension creation to happen through a PBX-side PHP script that bootstraps FreePBX and uses its Core module methods. A starter script is included at stubs/create_freepbx_extension.php.

Deployment steps

  1. Copy the stub to your FreePBX host:

  2. Verify that the script can load /etc/freepbx.conf on the PBX host.
  3. Call SSHClient::createExtensionKsip() as usual. It now invokes the PBX-side script instead of raw SQL inserts.
  4. Reload FreePBX after successful creation.

Version note

The stub uses FreePBX::Create()->Core->addDevice() and addUser() as the intended integration path, but exact method signatures can vary by FreePBX version. Confirm them on your PBX before production rollout.

WEB DOCUMENTATION

Visit Documentation: php-ksip-telnet & juv-ksip-softphone Documentation

Requirements

Installation

Usage

1. Connect to SSH

2. Create a PJSIP Extension

3. Get All Extensions

4. Generate Extension if Not Exists

5. Run a Custom SSH Command

Environment Variables (Recommended)

Instead of hardcoding credentials, use environment variables:

License

MIT


Laravel Integration

1. Install the package

2. Add credentials to .env

3. Create a Service class

4. Register in config/services.php

5. Bind in AppServiceProvider

6. Use in a Controller

7. Add route in routes/api.php

8. Test via API


make:ksip-config — Per-User Softphone Settings

Generates a migration, model, controller, and API routes so each user can save their own softphone configuration in the database.

What it generates

Migration Schema

Generated API Routes

Method Endpoint Description
GET /api/softphone-config Get the authenticated user's config
POST /api/softphone-config Save / update the authenticated user's config

Save Config Example

React Integration — configApiUrl prop

Pass the API endpoint to the Softphone component. It will fetch the user's saved config on mount and fall back to default values if no config is found.

If the API returns { "data": null }, the component uses its built-in default config.


SipController — Artisan Command Integration

Create extensions via HTTP API by calling the make:ksip Artisan command from a controller.

Controller Implementation

Route Registration

API Usage


make:ksip — Create Extension via CLI

Create a FreePBX PJSIP extension directly from the terminal without writing any PHP code.

--secret is optional — if omitted, the extension number is used as the password.

Options

Option Required Description
--extension The PJSIP extension number
--name Display name / Caller ID
--secret SIP password (defaults to extension number)

Prerequisites

Make sure config/services.php has the freepbx block:


Auto Extension Registration (ksipRegisterUser)

Automatically generates a 12-digit extension number from a user's name acronym + birthdate, then registers it in FreePBX.

Extension Number Formula

Part Example Result
Last name initial (L = 12th letter) Luna 12
First name initial (J = 10th letter) Juan 10
Middle name initial (M = 13th letter) Mercado 13
Birthdate (mmddyy) 12/16/1996 121696
Final Extension 121013121696

If the result is less than 12 digits, random digits are appended to complete it.

1. Scaffold the cron job

This generates:

2. Add to .env

3. Run the scheduler

Production: Auto-run via Supervisor

In production, use Supervisor to keep the scheduler running automatically — no need to manually trigger it.

Install Supervisor:

Create config file:

Start Supervisor:

Check status:

Replace /var/www/your-project with your actual project path and www-data with your server user (e.g. ubuntu, forge, deployer).

4. Call directly from a Registration Controller

Full Registration Controller Example

Generate Extension Number Only (no SSH)

Return Values of ksipRegisterUser

status Meaning
assigned Extension generated and saved to FreePBX
skipped User already has an extensionName
error Missing name or birthdate fields

Artisan Scaffold Generator

The package includes a make:ksipgen command that auto-generates call recording scaffold files in your Laravel project.

What it generates

Usage

Generated Routes

Available API Endpoints

Method Endpoint Description
GET /api/recordings List all recordings
POST /api/recordings/upload Upload a recording (mp3/wav/ogg)
GET /api/recordings/{id} Get a single recording
GET /api/recordings/{id}/download Download a recording
DELETE /api/recordings/{id} Delete a recording

Upload Example

Migration Schema


All versions of php-ksip-telnet with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
phpseclib/phpseclib Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codego/php-ksip-telnet contains the following files

Loading the files please wait ...