Upgrade 3CX to v18 and get it hosted free!

Simple CallBack sample from smile

Author image

Sat 14 of Apr, 2007 (18:00 UTC)
2333
This is VERY simple callback sollution. The

“/var/lib/asterisk/agi-bin/mycallback.agi”

  1. !/bin/sh

  1. простой callback

  1. calerid

CALER=$1

CONF=/etc/asterisk/callback.conf

TMP_FILE=`mktemp /tmp/callback.XXXXXX` || exit 1
OUT_DIR=/var/spool/asterisk/outgoing/

echo “noop ${CALER}”

  1. проверка по базе

grep ^${CALER} <${CONF} >/dev/null 2>&1 || echo “STREAM FILE invalid \”\””

  1. если номер есть – создаем call файл с датой в будущем

grep ^${CALER} <${CONF} >/dev/null 2>&1 && (cat <<EOT >${TMP_FILE};
Channel: Local/${CALER}@out-context/n
Callerid: callback <YOUR CLID>
MaxRetries: 2
RetryTime: 10
WaitTime: 55
Context: callback
Extension: 1
Priority: 1
EOT
touch -t `date -d “+5 seconds” +”%y%m%d%H%M.%S”` ${TMP_FILE}
mv ${TMP_FILE} ${OUT_DIR} )

from context pbx-input:

622 => {
start:
// Your Country prefix
if (${LEN(${CALLERID(number)})}==10) {Set(CALLERID(number)=8${CALLERID(number)});};
// Your Zone prefix
if (${LEN(${CALLERID(number)})}==6) {Set(CALLERID(number)=83412${CALLERID(number)});};
Wait(3);
AGI(mycallback.agi|${CALLERID(number)});
Hangup();
Wait(3);
};

Context callback:

context callback {
1 => {
start:
Wait(1);
Answer();
TIMEOUT(digit)=5;
TIMEOUT(response)=10;
Playback(hello);
Playback(beep);
Read(DTMF);
goto out-context|${DTMF}|start;
Playback(beep);
Playback(thanks);
Wait(1);
HangUp();
};
};

format of /etc/asterisk/callback.conf :

  1. List of allowed phones

812345
809876
811111

  1. end

Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.