I wanted to capture all the voice conversation between customer and agent in text format.
I have done the integration with Asterisk and Google Speach-to-Text using UniMRCP. I'm successfully able to capture customer side speech only but I wanted to captured agent's conversation too.
Sample dialplan:
exten => s,1,Answer()
exten => s,2,Originate(SIP/101,exten,google,s,3)
exten => s,3,SpeechCreate()
exten => s,4,SpeechActivateGrammar(builtin:speech/transcribe)
exten => s,5,SpeechBackground(beep, 20)
exten => s,6,Verbose(1, "Recognition result count: ${SPEECH(results)}")
exten => s,7,GotoIf($["${SPEECH(results)}" = "0"]?7:9)
exten => s,8,Playback(error)
exten => s,9,Goto(3)
exten => s,10,Verbose(1, "Recognition result: ${SPEECH_TEXT(0)}, confidence score: ${SPEECH_SCORE(0)}, grammar-uri: ${SPEECH_GRAMMAR(0)}")
exten => s,11,SpeechDestroy()
I want to save both parties communication in a text format need suggestion on dialplan part to achieve the same.
Simplest way - send both parties to conference(see n-way-calling howto) and listen to conference.
You also can use ChanSpy
Related
How to remove first 3 digits/letters from CALLED NUMBER. Let's say number 123456789 calls to abc987654321. I want to remove abc because in the context I have only 987654321. I know how to cut from CALLER but don't know how to cut from CALLED(Destination) number. This is what I tried so far but nothing happen:
exten => _[a-z]XXXXXXXXXXXX,1,Set({CALLEDID}=${CALLEDID:3})
exten => _[a-z]XXXXXXXXXXXX,2,Dial(SIP/${CALLEDID},1)
exten => _[a-z]XXXXXXXXXXXX,3,Voicemail(${CALLEDID}#VoiceMail)
exten => _[a-z]XXXXXXXXXXXX,4,Playback(Goodbye)
exten => _[a-z]XXXXXXXXXXXX,5,Hangup
You can use FILTER function or just do goto. You not need cut from destination,you need cut from extension.
exten => _[a-z]XXXXXXXXXXXX,1,Goto(${EXTEN:3},1)
exten => _XXXXXXXXXXXX,1,Dial(SIP/${EXTEN},1)
exten => _XXXXXXXXXXXX,n,Voicemail(${EXTEN}#VoiceMail)
exten => _XXXXXXXXXXXX,n,Playback(Goodbye)
exten => _XXXXXXXXXXXX,n,Hangup
Please note, your dialplan still do voicemail if called part hanguped after call. Read default extensions.conf.sample to see how to deal with voicemail
I want to trigger an AGI script (to activate a door opener) while calling. Preferably the script executes on pressing the #-key.
How to embed this behavior in a dialplan? All examples I have found are not dependent on a key press.
I am using FreePBX 2.8.1.4. This is what I have tried:
exten => s,1,Wait(1)
exten => s,n,AGI(test.py)
exten => s,n,Dial(SIP/mk55/203,20,tr)
exten => #,n,AGI(/home/pi/.scripts/dooropen.py)
exten => s,n,Hangup()
and this:
exten => s,n,Read(inPut,,1)
exten => s,n,Dial(console/dsp)
exten => s,n,GotoIf($["${inPut}" = "#"]?keypressed,1)
exten => keypressed,1,AGI(/home/pi/.scripts/dooropen.py)
exten => s,4,Hangup
In deed AGI(script_name, args...) is the right application to use https://wiki.asterisk.org/wiki/display/AST/Application_AGI
To retrieve a DTMF press you can use WaitExten https://wiki.asterisk.org/wiki/display/AST/Application_WaitExten
You can find here a sample of WaitExten usage
Seek Help concerning IVR Menu in Asterisk
Regards
I am using the "monitor" command to record full calls. This works well, but only when the user goes through the entire callflow. I tried monitoring the recorded file size as the call progresses. Once the call starts, the file sizes start increasing (of both the "in" and "out" sides of the call). However, if the user hangs up prematurely in the middle of the call, whatever has been recorded thus far is inexplicably dropped and stubs (44 bytes) are left in its place. Any insight into why this behavior occurs will be appreciated.
I am reproducing a snippet from the dialplan I used in my extensions.conf file below:
exten => 7611,1,Answer()
exten => 7611,n,Playback(/var/lib/asterisk/sounds/custom/transferring_with_record_wa rning)
exten => 7611,n,Set(GROUP()=outgoing)
exten => 7611,n,NoOp(The current group count : ${GROUP_COUNT(outgoing)})
exten => 7611,n,GotoIf($[${GROUP_COUNT(outgoing)}>1]?15)
exten => 7611,n,Set(GLOBAL(current_timestamp_7611)=${STRFTIME(${EPOCH},GMT+1,%s)})
exten => 7611,n,Set(GLOBAL(current_full_format_timestamp_7611)=${STRFTIME(${EPOCH},G MT-8,%d%m%Y_%H%M%S)})
exten => 7611,n,NoOp(The current timestamp : ${current_timestamp_7611})
exten => 7611,n,NoOp(The last timestamp : ${last_timestamp_7611})
exten => 7611,n,GotoIf($[(${last_timestamp_7611}+20>${current_timestamp_7611})]?15)
exten => 7611,n,NoOp(All cases passed)
exten => 7611,n,Ringing()
exten => 7611,n,Wait(2)
exten => 7611,n,Monitor(wav,HALEF_audio_ext_7611_${current_full_format_timestamp_761 1})
exten => 7611,n,Dial(SIP/1200#JVXML97,,XgF(default^7611^14))
exten => 7611,n,Set(GLOBAL(last_timestamp_7611)=${STRFTIME(${EPOCH},GMT+1,%s)})
exten => 7611,n,Hangup()
exten => 7611,n,Ringing()
exten => 7611,n,Wait(2)
exten => 7611,n,Playback(/var/lib/asterisk/sounds/custom/busy_later)
exten => 7611,n,Wait(1)
exten => 7611,n,Hangup()
I understand that the "record" command has a "k" parameter which keeps the recorded file upon hangup, but I'm not able to find any similar functionality with the Monitor command. (I'd use "record", but I'd like to record the full call (duplex) and do it automatically, without any user input requirement).
Thanks!
Use MixMonitor command.
Check you have permissions needed for write files.
Check debug if you unsure.
PS. using diaplan WITH n, without labels and goto to EXACT priority is very bad practice, can result hard-catchable bugs. Using GLOBAL variables without need also not so nice idea.
I have an Asterisk server that I need to reconfigure. It was built by an outside contractor, and I need to make some changes to it. Right now, all it does is answer a call, accept a 7-digit code, and hang up. On the back end, it records the timestamp of the call, the caller id, and the 7-digit code.
What we are running into is that some people do not enter in the 7-digit password, or they take too long. Then the system just restarts, and will continue in an endless loop, until they enter in 7-digits. The callers are, as of late, thinking that the system is broken, when they do not enter in a 7-digit code.
What I'm trying to figure out how to do is that when the system has to return to the beginning, it might say something like "you only entered 6 digits. pleas try again." Or something to that effect. I'm not 100% sure how to add this into the current configuration. Below is what we currently have:
[inbound]
exten => 1234567890,1,Answer
exten => 1234567890,2,Set(COUNTER=4)
exten => 1234567890,3,Set(COUNTER=$[${COUNTER} -1 ])
exten => 1234567890,4,NoOp(${COUNTER})
exten => 1234567890,5,GotoIf($[${COUNTER} > 0 ]?10:122)
exten => 1234567890,10,Wait(1)
exten => 1234567890,11,read(SCODE,EnterCode,7,)
exten => 1234567890,12,GotoIf($[${LEN(${SCODE})}=7]?13:3)
exten => 1234567890,13,Playback(YouEntered)
exten => 1234567890,n,SayDigits(${SCODE})
exten => 1234567890,n,read(SCHOICE,correctpressone,1,)
exten => 1234567890,n,Gotoif($[ ${SCHOICE} = 1 ]?20:1)
exten => 1234567890,20,NoOp(${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)} ${SCODE} ${CALLERID(num)})
exten => 1234567890,n,TrySystem(/bin/echo ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}, ${SCODE}, ${CALLERID(num)} >> /opt/codes.log)
exten => 1234567890,n,Playback(SuccessfullyActivate)
exten => 1234567890,n,Hangup()
exten => 1234567890,122,Playback(tt-somethingwrong)
exten => 1234567890,n,Hangup()
Thanks for any help with this issue...
Something like this:
exten => 1234567890,12,GotoIf($[${LEN(${SCODE})}=7]?13:200)
exten => 1234567890,200,Playback(your_inpout_too_short)
exten => 1234567890,201,Goto(3)
Btw, you dialplan is poor quality,looks like person who did it also have no experience.
I am new to asterisk. i am working under ubuntu 9.10. I use asterisk 1.8. I want to create a conference room.
in meetme.conf
conf => 1234,1234
in extensions.conf
exten =>1234,1,MeetMe(1234)
Is the pin number a secure one? How to create a secure pin number (do i have to use numbers and characters too)? Secondly how to create a blacklist? If a person tries to register 3 times..and the passed is incorrect how can I put him/her on the blacklist?
Passwords are numbers, however, '1234' is not a good password choice.
Asterisk's dialplan is extremely dynamic; there is no single definition of 'Blacklist'. However, try something like this:
== meetme.conf
conf => 1234
== extensions.conf
exten => 1234,1,GotoIf(${BLACKLIST()}?hangup)
exten => 1234,n(loop),Set(TRIES=$[0${TRIES} + 1]);
exten => 1234,n,GotoIf($["$TRIES" = "3"]?blacklist)
exten => 1234,n,Read(PIN,enter-conf-pin-number,4)
exten => 1234,n,GotoIf($["$PIN" = "9999"]?meetme)
exten => 1234,n,Goto(loop)
exten => 1234,n(meetme),MeetMe(1234)
exten => 1234,n,Hangup
exten => 1234,n(blacklist),Set(CALLERID(num)=${FILTER(0-9\-,${CALLERID(num):-10})})
exten => 1234,n,Set(DB(blacklist/${CALLERID(num)})="Some Comment")
exten => 1234,n(hangup),Hangup
there are all sorts of other ways. this particular setup will only keep the caller from trying to authenticate into that one conference room. if you'd rather ban him from ever touching your automated attendant, you can move the first line to your incoming context.
If you're already sanitizing your callerid (you should be) you can remove the FILTER line and bump the (blacklist) to the next line.