mr_welk: (Default)
[personal profile] mr_welk


Попробовал способ прослушивания разговоров отсюда
http://voxlink.ru/kb/asterisk-configuration/Listen-to-the-latest-records/

работает!



мой кусок файла extention.conf

;-------------------------------------------------------------------------------
; from-internal:
;
; Internal dialplan that most internal phones have access to
;
[from-internal]
include => from-internal-lastcall
include => from-internal-noxfer
include => from-internal-xfer
include => bad-number ; auto-generated
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
; from-internal-lastcall:
;
; Playing last 2 calls to ringing operator, call number 5500.
;
;-------------------------------------------------------------------------------
[from-internal-lastcall]
exten => 5500,1,NoOp(Last records)
same => n,Set(first=${SHELL(find /var/spool/asterisk/monitor/ -name *-${CALLERID(num)}-* -ctime -1 -size +20k -exec ls -1t "{}" + |head -n1)})
same => n,Set(second=${SHELL(find /var/spool/asterisk/monitor/ -name *-${CALLERID(num)}-* -ctime -1 -size +20k -exec ls -1t "{}" + |head -n2 |tail -1)})
same => n,BackGround(custom/lastrecord)
same => n,WaitExten(3)
exten => 1,1,Playback(${first:0:-5})
same => n,Hangup()
exten => 2,1,Playback(${second:0:-5})
same => n,Hangup()
exten => t,1,Hangup()
exten => i,1,Hangup()
;-------------------------------------------------------------------------------


Только надо записать сообщение под именем lastrecord.wav  "Для прослушивания последней записи нажмите 1, предпоследней - 2 "
надо бы ещё добавить сообщение на случай отсутствия записи, но пока и так работает :)

ещё фича - вклинивание в разговор

добавляем в контекст [from-internal-custom]:

exten => 1001/5000,1,ChanSpy(SIP/101)   ; режим прослушки номера 101 с номера 5000, набираем номер 1001
exten => 1001/5000,1,ChanSpy(SIP/101,B) ; то же самое, но тебя слышат оба
exten => 1001/5000,1,ChanSpy(SIP/101,w)   ;  слышит только номер 101 (режим тренинга)


а вот вариант со встроенными макросами и паролем для "шпиона"
добавляем в
extensions_override_freepbx.conf

[app-chanspy]
exten =>
555,1,Macro(user-callerid)
exten =>
555,2,Authenticate(1234)
exten =>
555,3,Read(SPYNUM,agent-newlocation)
exten =>
555,4,ChanSpy(SIP/${SPYNUM},wqv(-1))
;--== end of [app-chanspy] ==--;


набираем 555, вводим пароль 1234 и номер прослушиваемого - режим "тренер"


опции функции ChanSpy:


ChanSpy([chanprefix,[options]])





Arguments

  • chanprefix

  • options

    • b - Only spy on channels involved in a bridged call.

    • B - Instead of whispering on a single channel barge in on both channels involved in the call.

    • c

      • digit - Specify a DTMF digit that can be used to spy on the next available channel.


    • d - Override the typical numeric DTMF functionality and instead use DTMF to switch between spy modes.

      • 4 - spy mode

      • 5 - whisper mode

      • 6 - barge mode


    • e - Enable enforced mode, so the spying channel can only monitor extensions whose name is in the ext : delimited list.

      • ext


    • E - Exit when the spied-on channel hangs up.

    • g

      • grp - Only spy on channels in which one or more of the groups listed in grp matches one or more groups from the SPYGROUP variable set on the channel to be spied upon.


    • n - Say the name of the person being spied on if that person has recorded his/her name. If a context is specified, then that voicemail context will be searched when retrieving the name, otherwise the default context be used when searching for the name (i.e. if SIP/1000 is the channel being spied on and no mailbox is specified, then 1000 will be used when searching for the name).

      • mailbox

      • context


    • o - Only listen to audio coming from this channel.

    • q - Don't play a beep when beginning to spy on a channel, or speak the selected channel name.

    • r - Record the session to the monitor spool directory. An optional base for the filename may be specified. The default is chanspy.

      • basename


    • s - Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.

    • S - Stop when no more channels are left to spy on.

    • v - Adjust the initial volume in the range from -4 to 4. A negative value refers to a quieter setting.

      • value


    • w - Enable whisper mode, so the spying channel can talk to the spied-on channel.

    • W - Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.

    • x

      • digit - Specify a DTMF digit that can be used to exit the application while actively spying on a channel. If there is no channel being spied on, the DTMF digit will be ignored.


    • X - Allow the user to exit ChanSpy to a valid single digit numeric extension in the current context or the context specified by the SPY_EXIT_CONTEXT channel variable. The name of the last channel that was spied on will be stored in the SPY_CHANNEL variable.


Есть ещё одна похожая функция ExtenSpy:

ExtenSpy(exten@[context],[options])





Arguments

  • exten

    • exten - Specify extension.

    • context - Optionally specify a context, defaults to default.


  • options

    • b - Only spy on channels involved in a bridged call.

    • B - Instead of whispering on a single channel barge in on both channels involved in the call.

    • c

      • digit - Specify a DTMF digit that can be used to spy on the next available channel.


    • d - Override the typical numeric DTMF functionality and instead use DTMF to switch between spy modes.

      • 4 - spy mode

      • 5 - whisper mode

      • 6 - barge mode


    • e - Enable enforced mode, so the spying channel can only monitor extensions whose name is in the ext : delimited list.

      • ext


    • E - Exit when the spied-on channel hangs up.

    • g

      • grp - Only spy on channels in which one or more of the groups listed in grp matches one or more groups from the SPYGROUP variable set on the channel to be spied upon.


    • n - Say the name of the person being spied on if that person has recorded his/her name. If a context is specified, then that voicemail context will be searched when retrieving the name, otherwise the default context be used when searching for the name (i.e. if SIP/1000 is the channel being spied on and no mailbox is specified, then 1000 will be used when searching for the name).

      • mailbox

      • context


    • o - Only listen to audio coming from this channel.

    • q - Don't play a beep when beginning to spy on a channel, or speak the selected channel name.

    • r - Record the session to the monitor spool directory. An optional base for the filename may be specified. The default is chanspy.

      • basename


    • s - Skip the playback of the channel type (i.e. SIP, IAX, etc) when speaking the selected channel name.

    • S - Stop when there are no more extensions left to spy on.

    • v - Adjust the initial volume in the range from -4 to 4. A negative value refers to a quieter setting.

      • value


    • w - Enable whisper mode, so the spying channel can talk to the spied-on channel.

    • W - Enable private whisper mode, so the spying channel can talk to the spied-on channel but cannot listen to that channel.

    • x

      • digit - Specify a DTMF digit that can be used to exit the application while actively spying on a channel. If there is no channel being spied on, the DTMF digit will be ignored.


    • X - Allow the user to exit ChanSpy to a valid single digit numeric extension in the current context or the context specified by the SPY_EXIT_CONTEXT channel variable. The name of the last channel that was spied on will be stored in the SPY_CHANNEL variable.



надо подумать как лучше реализовать

Profile

mr_welk: (Default)
mr_welk

February 2017

S M T W T F S
   1234
567891011
12 13141516 1718
19202122232425
262728    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 24th, 2017 02:35 pm
Powered by Dreamwidth Studios