Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

domingo, 31 de diciembre de 2023

IAX2 trunk

[20026] ; server  accept registrations and calls


 deny=0.0.0.0/0.0.0.0

secret=af3c4078d

transfer=yes

context=from-internal

host=dynamic

type=friend

port=4569

qualify=yes

dial=IAX2/20026

accountcode=

permit=0.0.0.0/0.0.0.0

requirecalltoken=no

callerid=asreceived



[c2006]  ; client

username=20026
type=friend
secret=af3c4078d
requirecalltoken=no
qualify=no
host=10.0.0.45
encryption=no
context=from-trunk
auth=plaintext


register=>20026:af3c4078d@10.0.0.45

viernes, 22 de diciembre de 2023

setting file as asteirsk channel variables

 <?php

// Read the input string from a file

$inputString = file_get_contents('/home/voipessential/info_1.conf');


// Command line parameter

$searchValue = isset($argv[1]) ? $argv[1] : '';


// Explode the input string into an array based on the '-' delimiter

$lines = explode("\n", $inputString);

$dataArray = [];


// Iterate through each line and explode based on the '-' delimiter

foreach ($lines as $line) {

    $values = explode('-', $line);

    $dataArray[] = $values;

}


// Check if the search value is found in any array

foreach ($dataArray as $array) {

    if (in_array($searchValue, $array)) {

        // Set each value of the array as an Asterisk variable

        foreach ($array as $key => $value) {

            setAsteriskVariable($key, $value);

        }


        echo "Asterisk variables set for the array where the search value '$searchValue' is found.\n";

        break; // Stop after the first occurrence

    }

}


// Function to set Asterisk variable

function setAsteriskVariable($variableName, $variableValue) {

    // Set Asterisk variable

    echo "SET VARIABLE $variableName \"$variableValue\"\n";

}

?>


/home/voipessential/info_1.conf

59945-17542920051-600-14088772222
59955-19549063330-900-18003333330
57000-19546868344
57999-12159486620-400-18002314334
59867-17542912260
59868-18009860534



;;get  queue  time out and other values
same => n,AGI(/home/voipessential/set_variable.php,17542920051)
same => n,NoOp(Variable Value: ${1} ${2} ${3})