Код: Выделить всё
[macro-autodial]
; небольшая проверка от наличие "*" вначале номера и на длину номера сотрудника"
exten => s,1,ExecIf($["${ARG1:0:1}" = "*" | ${LEN(${ARG2})} != 4 ],Hangup)
exten => s,n,System(echo "Channel: Local/${ARG1}@from-internal/n" > /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "Playback(autodial-client)" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "MaxRetries: 10" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "RetryTime: 20" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "WaitTime: 40" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo -e "Callerid: \\x22CallBack ${ARG1}\\x22 \\x3C${ARG2}\\x3E" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "Context: internal" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "Extension: ${ARG2}" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "Priority: 1" >> /tmp/${ARG2}${UNIQUEID}.call)
chubaka писал(а):Local/${ARG1}@from-internal
ты уж определись с контекстомchubaka писал(а):[internal]
Давай я поищу в google за тебя:chubaka писал(а):вот так пытаюсь сделать
Код: Выделить всё
Channel: Local/091112223333@from-internal/n
Application:Playback
Data:autodial-client
MaxRetries: 10
RetryTime: 20
WaitTime: 40
Callerid: "Обратный звонок 091112223333" <1009>
Context: internal
Extension: 1009
Priority: 1
StartRetry: 1855 1 (1379227008)
Код: Выделить всё
[from-internal-custom]
exten => _*20X.,1,Macro(autodial,${EXTEN:3},${CALLERID(number)})
exten => _*20X.,2,Busy()
[macro-autodial]
exten => s,1,ExecIf($["${ARG1:0:1}" = "*" | ${LEN(${ARG2})} != 4 ],Hangup)
exten => s,n,System(echo "Channel: Local/${ARG1}@autodial-outside/n" > /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "MaxRetries: 10" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "RetryTime: 20" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "WaitTime: 40" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo -e "Callerid: \\x22CallBack ${ARG1}\\x22 \\x3C${ARG2}\\x3E" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "Context: autodial-internal" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "Extension: ${ARG2}" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(echo "Priority: 1" >> /tmp/${ARG2}${UNIQUEID}.call)
exten => s,n,System(sleep 15 && mv -f /tmp/${ARG2}${UNIQUEID}.call /var/spool/asterisk/outgoing/ &)
[autodial-outside]
exten => _X.,1,Dial(SIP/ROOT-SRV/${EXTEN:1})
exten => _X.,n,Playback(autodial-client)
[autodial-internal]
exten => _XXXX,1,Dial(SIP/${EXTEN})
exten => _XXXX,n,Playback(autodial-office)
exten => _XXXX,n,Hangup()
Код: Выделить всё
exten => _X.,1,Dial(SIP/ROOT-SRV/${EXTEN:1},15,A(autodial-client))