forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
606 B
38 lines
606 B
#!/bin/bash |
|
|
|
make_callfile() |
|
{ |
|
ORIGEM=$1 |
|
DESTINO=$2 |
|
RAMAL=$3 |
|
|
|
CALLFILE=$(cat <<-EOF1 |
|
Channel: $ORIGEM |
|
MaxRetries: 120 |
|
RetryTime: 5 |
|
WaitTime: 45 |
|
Context: ext-callback |
|
Extension: $DESTINO |
|
Priority: 1 |
|
Callerid: "CALLBACK" <$DESTINO> |
|
Set: RAMAL=$RAMAL |
|
EOF1 |
|
) |
|
|
|
FILE_NAME="$TEMP_SPOOL"/$(date +%F-%H-%M-%S)-$DESTINO.call |
|
echo "$CALLFILE" >> $FILE_NAME |
|
|
|
|
|
chown pbx:pbx /$FILE_NAME |
|
chmod --recursive u=rwX,g=rX,o= /$FILE_NAME |
|
chmod 777 /$FILE_NAME |
|
mv /$FILE_NAME /var/spool/asterisk/outgoing |
|
} |
|
|
|
#VARIAVEIS DIRETORIOS |
|
ASTERISK_CFG="/etc/asterisk" |
|
TEMP_SPOOL="/var/spool/asterisk" |
|
|
|
make_callfile "$1" "$2" "$3" |
|
|
|
exit |