A
A
Alexander Kaplun2016-09-15 09:18:21
Asterisk
Alexander Kaplun, 2016-09-15 09:18:21

How to enable the client to call the manager who called him?

Good afternoon,
There is Elastix 2.5
It is necessary to somehow connect the client with the last manager who called him. something like:
1. An employee of the company dials the client's number and talks to him (or hangs up without waiting for the call);
2. The client, having wanted to call back the employee of the company (or to find out who called him and on what issue), dials the number determined by him;
3. PBX determines the client's number and connects it with the last employee of the company who called him.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
George, 2016-09-15
@gogametreveli

I have it set up like this and it works :)

exten => _X.,1,Answer()
exten => _X.,n,MixMonitor(${UNIQUEID}.wav,b)
exten => _X.,n,MYSQL(Connect connid localhost {user} {pass} {database})
; выбираем запросом внутренний номер с которого был последний звонок клиенту
exten => _X.,n,MYSQL(Query resultid ${connid} SELECT `src` FROM {cdr_table} WHERE `dst`='${CALLERID(number)}' ORDER BY `calldate` DESC LIMIT 1)
exten => _X.,n,MYSQL(Fetch fetchid ${resultid} VAR)
exten => _X.,n,MYSQL(Clear ${resultid})
exten => _X.,n,MYSQL(Disconnect ${connid})
; если такой информации нет то переходим к стандартным процедурам
exten => _X.,n,GotoIf($["${var}" = "" ]?def_user)
; проверям если оперетор занят то переходим к стандартным процедурам
exten => _X.,n,GotoIf($[ "${DEVICE_STATE(SIP/${var})}" != "NOT_INUSE" ]?def_user)
; звоним нужному опереатору
exten => _X.,n,Dial(SIP/${var},20,tTr)  ; 
; если оператор не ответил то звоним по стандартной логике
exten => _X.,n,Dial(SIP/7101,20,tTr)
exten => _X.,n,Dial(SIP/7102&SIP/7103&SIP/7104&SIP/7105&SIP/7106&SIP/7107&SIP/7108,30,tT)
exten => _X.,n,Hangup()
; стандартная логика
exten => _X.,n(def_user),GotoIf($["${DEVICE_STATE(SIP/7101)}" = "NOT_INUSE"]?first_user:all_user)
exten => _X.,n(first_user),Dial(SIP/7101,10,tTr)
exten => _X.,n(all_user),Dial(SIP/7102&SIP/7103&SIP/7104&SIP/7105&SIP/7106&SIP/7107&SIP/7108&SIP/7109,10,tT)
exten => _X.,n,Hangup()

B
brar, 2016-09-18
@brar

I will describe the principle of operation, but you will have to file it for yourself.
We write down in base (in this case internal "native" base of an asterisk) number to whom we call. Then, with an incoming call, we verify and route.

[outgoing]
exten => _98XXXXXXXXXX,1,Set(DB(outg/${EXTEN:2})=${CALLERID(num)}) #записываем в базу набираемый номер.

[call_back_to_caller] #Если звонок пришел от абонента, которому ранее звонил менеджер
exten => dfg,1,Dial(SIP/${DB(outg/${CALLERID(num)})},,Tt)
exten => dfg,n,Hangup

[inbound]
exten => ваш_внешний_номер,n,GotoIf(${DB_EXISTS(outg/${CALLERID(number)})}?call_back_to_caller,dfg,1:reception,cc,1) #сверяем наличие в базе номера и отправляем в соотвествующий экстеншн.

[reception] #если звонок приходит от любого другого номера, которого нет в базе)
exten => cc,1,Dial(SIP/1099,12,Tt)

This is a working option. But, as I said, you need to file for yourself, and it's clear that there are only those lines that are responsible for the logic in accordance with your question. One way or another, read the documentation on DB and DB_EXISTS and work with the records in the database so that there is an understanding.

S
silverjoe, 2016-09-15
@silverjoe

Remember the number that you are interested in in the database and the time of the call.
Once every 15-60 minutes (each company has its own time interval, some may have until the end of the day) clear old records.
When making an incoming call, look in the database, if there is a number = connect to the required internal one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question