Soporte & Consultoria

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

miércoles, 31 de diciembre de 2014

Llamar multiples numeros desde una base de dato




#!/bin/bash

mysql --silent -h localhost  -u root -p198dd -D asterisk<<<'select dst  from cdr where dst="100" limit 0,5' > tmp_results

while read dst
do

 echo $dst
`asterisk -x "originate SIP/$dst extension 0@internal" `


done < tmp_results


root@asterisk-dominicana:~# ./db.sh








domingo, 28 de diciembre de 2014

Asterisk random caller id and rand function

Example1

 exten => s,1,Set(junky=${RAND(1,8)});
     - Sets junky to a random number between 1 and 8, inclusive.


Example2

if we had few caller ID number want to use it, try this:

[outbound]
exten => _886X.,1,Noop
  same => n,Gosub(pickCallerIDnum,cell${RAND(1,5)},1)
  same => n,Dial(SIP/${EXTEN}@gateway,32,gCX)

[pickCallerIDnum]
exten => cell1,1,Set(CALLERID(num)=09xxxxxxx1)
  same => n,Return
exten => cell2,1,Set(CALLERID(num)=09xxxxxxx2)
  same => n,Return
exten => cell3,1,Set(CALLERID(num)=09xxxxxxx3)
  same => n,Return
exten => cell4,1,Set(CALLERID(num)=09xxxxxxx4)
  same => n,Return
exten => cell5,1,Set(CALLERID(num)=09xxxxxxx5)
  same => n,Return

Asterisk perment calling

#!/bin/bash

#$1=number of calls -1

#2 pause

#3 destination  number
COUNTER=0
         while [  $COUNTER -lt $1 ]; do
             echo The counter is $COUNTER
sleep  $2


asterisk -x "originate SIP/perment/9990000$3 extension 0@internal"

let COUNTER=COUNTER+1
         done


root@asterisk-dominicana:~# ./while.sh 100 3 14795824808





dial plan
[internal]
exten=>0,1(music),Playback(/var/lib/asterisk/moh/macroform-cold_day)
same=>n,Goto(music)


 --------------------------------------------------------------
 Otras variantes mandandolo a un local channel para  poder  poner el caller ID



#!/bin/bash

#$1=number of calls -1

#2 pause

#3 destination  number
COUNTER=0
         while [  $COUNTER -lt $1 ]; do
             echo The counter is $COUNTER
sleep  $2

asterisk -x "originate Local/$3@perment extension 1701@radio"


let COUNTER=COUNTER+1
         done




########################

EJEMPLO DEL ARHICOV calleridlist.conf  del cual el script tomara los caller id
/root/calleridlist.conf
18007142585
18097142358
13052365874
################

DIAL PLAN






[perment]
;exten =>_x.,1,Gosub(pickCallerIDnum,cell${RAND(1,5)},1) ; ya no usare el gobsub para el caller id
exten=>_x.,1,Set(callid=${SHELL(shuf -n 1 /root/calleridlist.conf)}) ;tomar un caller id random de un archv
same=>n,Set(CALLERID(num)=${callid})
same=>n,Dial(SIP/99900${EXTEN}@perment,25)
same=>n,Hangup()
[pickCallerIDnum]
exten =>cell1,1,Set(CALLERID(num)=343444)
same => n,Return

exten => cell2,1,Set(CALLERID(num)=044552)
  same => n,Return

exten => cell3,1,Set(CALLERID(num)=10573)
  same => n,Return

exten => cell4,1,Set(CALLERID(num)=900094)
  same => n,Return

exten => cell5,1,Set(CALLERID(num)=10995)
  same => n,Return

[radio]
exten=>1701,1,Answer
same=>n,NoCDR()
same=>n,Set(CHANNEL(MUSICCLASS)=radio)
same=>n,MusicOnHold()
same=>n,Hangup
Luego corremos en consola

root@asterisk-dominicana:~# ./while.sh 5 5 18097143489





jueves, 25 de diciembre de 2014

Asterisk Backgroun Music a during a call

[internal]
exten=>0,1,Hangup()
exten=>0,2(music),Playback(/var/lib/asterisk/moh/macroform-cold_day)
same=>n,Goto(music)

[spy-exten]
exten =>_1923,1,Dial(Local/1924@spy-exten,30,G(internal^0^1))
exten=>_1924,1,ChanSpy(SIP/100,B)


Remote Party ID


Overview
In SIP, the Remote Party ID header field enables popular services as well as some regulatory and public safety requirements.
These services include the following:

• calling identity delivery

• calling identity delivery blocking

• tracing originator of call

jueves, 18 de diciembre de 2014

Sistema de Grabacion de mensaje y envio de mensaje por correo.




[recording]
exten=>s,1,Verbose(recording calls from the caller ${CALLERID(num)} )
same=>n,Set(FECHA=${STRFTIME(${EPOCH},,%Y-%m-%d_%H-%M-%S)}_${CALLERID(num)})
same=>n,Playback(beep)
same=>n,MixMonitor(/var/www/${FECHA}.wav)
same=>n,Set(TIMEOUT(absolute)=90)
same=>n,Wait(90)
exten=>h,1,System(/usr/bin/mpack -s "Asterisk Dominicana ${FECHA}" /var/www/${FECHA}.wav ambiorixg12@hotmail.com,ambiorixg12@gmail.com)

miércoles, 10 de diciembre de 2014

Restringir una extension a solo hacer llamadas internas en Elastix

Creamos un contexto personalizado en extension_custom.conf 


[restringido]
include => ext-local


Luego agregamos la extension a dicho contexto  y listo.