Skip to content

Instantly share code, notes, and snippets.

@achyutdev
Created June 24, 2015 04:46
Show Gist options
  • Save achyutdev/795de2e729fa22738987 to your computer and use it in GitHub Desktop.
Save achyutdev/795de2e729fa22738987 to your computer and use it in GitHub Desktop.
extension.conf
[general]
static=yes
writeprotect=No
autofallthrough=No
clearglobalvars=No
priorityjumping=No
;------------------------------------------------------
[Default]
include=>python
include=>adhearsion
exten=>1001,1,Dial(SIP/1001,5) ;my mob
exten=>1001,n,VoiceMail(101@mail_box,u)
exten=>1001,n,Hangup
exten=>999,1,Dial(SIP/aw-sip/600) ;my laptop
exten=>1001,n,VoiceMail(102@mail_box,u)
exten=>1001,n,Hangup
exten=>1003,1,Dial(SIP/1003) ;saugat
exten=>1004,1,Dial(SIP/1004) ;juli
exten=>1005,1,Dial(SIP/1005) ;nirajan dai
exten=>1006,1,Dial(SIP/1006) ;suman dai
exten=>1007,1,Dial(SIP/1007) ;Dai
exten=>1008,1,Dial(SIP/1008) ;
exten=>1010,1,Dial(SIP/1010) ;
;-----------------------------test---------------------------
[test]
exten => s,1,Answer
exten => s,n,Dial(SIP/1001)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n,NoOp(SIP/mypeer has presence ${PRESENCE_STATE(SIP/mypeer,value)})
exten => s,n,NoOp(Conference number 1234 has presence message ${PRESENCE_STATE(MeetMe
:1234,message)})
exten => s,n,NoOp(${CHANNEL(channeltype)})
exten => s-CANCEL,1,Hangup
exten => 1234,n(here),Playback(gud/welcome)
exten => 1234,n(hangin),Hangup()
[siptest]
exten=>1000,1,Answer
same=>n,wait(2)
same=>n,agi(googletts.agi,"Hello sir, Welcome to our system VoiceInn.This is a test call.",en)
same=>n,wait(2)
same=>n,agi(googletts.agi,"Okay, then, see you later.",en)
same=>n,hangup
;..............................1098..............................
[home_phone]
exten => s,1,NoOp("This is my home phone context")
;exten => s,n,Set(_DIDNUM="PUT YOUR DID NUM HERE")
;exten => s,n,LookupCIDName
exten => s,n,AGI(twitter.agi, "Asterisk:- Hi me achyut :Testing twitter message system::${CALLERID(all)} just called on ${EXTEN}")
exten=>s,n,Hangup
[rock_paper]
exten=>s,1,GoSub(language,lg,1)
same=>n,agi(googletts.agi,"Welcome to Game. Rock-Paper-Scissors. Before start our game, Here are some rules. you have to select one of these three option. If you select rock, dial one. Similarly,dial 2 for paper and 3 for scissors. . .",${language})
same=>n,Set(my_select=${RAND(1,3)})
same=>n,agi(googletts.agi,"Let's Start. . 3. 2. 1.",${language})
same=>n,agi(googletts.agi,"Rock. Paper. Scissors",${language})
same=>n,agi(googletts.agi,"What did you select?. Dial. ",${language})
same=>n,WaitExten(4)
exten=>_[123],1,Set(player_choice=${EXTEN})
same=>n,AGI(rock-paper.php,${my_select},${player_choice})
same=>n,Verbose(Here = ${result})
same=>n,Gotoif($[${result}==0]?resultg,rst,draw)
same=>n,Gotoif($[${result}==1]?resultg,rst,win)
same=>n,Gotoif($[${result}==-1]?resultg,rst,loss)
[resultg]
exten=>rst,1(draw),agi(googletts.agi,"No one win. Game Draw.",${language})
same=>n,Hangup
same=>n(win),agi(googletts.agi,"Congratulation! You win.",${language})
same=>n,Hangup
same=>n(loss),agi(googletts.agi,"Sorry! You Lost Game.",${language})
same=>n,Hangup
[language]
exten=>lg,1,agi(googletts.agi,"Please choose your language. Dial 1 for english",en)
same=>n,WaitExten(5)
exten=>_X,1,Set(value=${EXTEN})
same=>n,agi(decodeLanguage.php,${value})
same=>n,Return(${language})
[missing_child]
include=>listen-issue
exten=>333,1,Verbose(start)
same=>n,Answer
same=> n,Set(time=${STRFTIME(${EPOCH},,%Y:%m:%d %H:%M:%S)})
same=>n,MYSQL(Connect connid localhost root dev test)
same=>n,MYSQL(Query pre_issue_no ${connid} SELECT issue_no FROM `1098` order by issue_no DESC limit 1)
same=>n,MYSQL(Fetch fetchid ${pre_issue_no} previousValue)
same=>n,Set(issue_no=$[${previousValue}+1])
same=>n,Set(filename=issue-${issue_no})
same=>n,GotoIfTime(12:00-17:59,mon-fri,*,*?missing_child,333,continue:monitoring,mnt,1)
same=>n(continue),Background(1098/press-one-operator)
same=>n,WaitExten(4)
exten=>_[12],1,Gotoif($[${EXTEN}==1]?operator,opt,1:monitoring,mnt,1)
[operator]
include=>ending
exten=>opt,1,MixMonitor(${filename}.wav)
same=>n,Dial(SIP/1001)
[monitoring]
include=>ending
exten=>mnt,1,MixMonitor(${filename}.wav)
same=>n,Playback(1098/ur-name)
same=>n,Record(wav_recordings/name-${issue_no}.wav,10)
same=>n,Playback(1098/ur-age)
same=>n,Record(wav_recordings/age-${issue_no}.wav,10)
same=>n,Playback(1098/problem)
same=>n,Record(wav_recordings/problem-${issue_no}.wav,10)
same=>n,Playback(1098/thank-u)
same=>n,AGI(pythonagi.py,${issue_no})
same=>n,Hangup
[ending]
exten=>h,1,MYSQL(Query result ${connid} INSERT INTO `1098` (`time`, `issue_no`, `audio_file`, `status`) VALUES ('${time}',${issue_no},'${filename}.wav', 'NEW'))
same=>n,MYSQL(Disconnect ${connid})
same=>n,Hangup()
[listen-issue]
include=>Default
exten=>777,1,Authenticate(123)
same=>n,MYSQL(Connect connid localhost root dev test)
same=>n,Background(1098/enter-issue-no)
exten=>_8XX,1,Set(issueRecord=${EXTEN})
same=>n,MYSQL(Query issue_no ${connid} SELECT issue_no FROM `1098` WHERE issue_no=${issueRecord})
same=>n,MYSQL(Fetch fetchid ${issue_no} issue)
same=>n,Verbose(Issue no :${issue})
same=>n,Goto(play,play,1)
[play]
include=>listen-hangup
exten=>play,1,Playback(./../../../../var/spool/asterisk/monitor/issue-${issue})
same=>n,Background(1098/replay-again)
same=>n,WaitExten(5)
exten=>_[12],1,Gotoif($[${EXTEN}==1]?play,play,1:hangup)
same=>n(hangup),Playback(audio_data/thank-you-for-ur-time)
same=>n,Hangup
[listen-hangup]
exten=>h,1,MYSQL(Query issue_no ${connid} UPDATE `test`.`1098` SET `status` = 'LISTEN' WHERE `1098`.`issue_no` =${issue})
same=>n,MYSQL(Disconnect ${connid})
same=>n,Hangup
;________________________________________________________________________________
[festival-test]
include=>adhearsion
exten => 203,1,Verbose(2,This is a Festival test)
same => n,Answer()
same => n,Playback(silence/1)
same => n,Festival(Greetings . from way to the horizon.tumblr.com)
same => n,Hangup()
[adhearsion]
exten => _.,1,AGI(agi:async)
[services]
exten=>*98,1,VoiceMailMain(@mail_box)
[synthandrecog-app1]
exten => s,1,Answer
exten => s,n,MRCPSynth(Hello world)
exten => s,n,Verbose(1, ${SYNTHSTATUS})
exten => s,n,Hangup
;__________________________________________________________________________________________
[python]
exten=>77,1,Verbose('hello...')
same=>n,AGI(log.py)
same=>n,Hangup
[Test_only]
exten=>999,1,Goto(from-pstn,s,1)
[from-pstn]
exten =>s,1,Verbose(1, Caller ${CALLERID(all)} has entered the paf IVR)
same=>n,Set(filename=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}1001)
same=>n,Answer()
same=>n,Wait(3)
same=>n,Playback(gud/welcome)
same=>n,Background(gud/kapilbastu_other) ;IVR for district selection
same=>n,WaitExten(5)
exten => 1,1,Goto(Kapilbastu,ext1,1)
exten => 2,1,Goto(Other,ext2,1)
same=>n,Hangup()
[Kapilbastu]
exten => ext1,1,Verbose(Kapilbastu district)
same=>n,Playback(gud/vdc)
same=>n,Set(from=Kapilbastu)
same=>n,Record(${filename}vdc.wav,3,10) ;vdc recording
same=>n,Set(CDR(vdc)=${filename}vdc.mp3)
same=>n,Wait(2)
same=>n,Playback(gud/msg)
same=>n,Record(${filename}msg.wav,5,300) ;msg recording
same=>n,Set(CDR(msg)=${filename}msg.mp3)
same=>n,Wait(1)
same=>n,GoSub(post,ss,1)
same=>n,Playback(gud/thanks)
same=>n,AGI(convert_recordings.sh)
same=>n,AGI(test_paf.php,${from},${CALLERID(num)},${CDR(vdc)},${CDR(msg)},${CDR(aa)})
same=>n,Hangup()
;[you_num]
;include => default_cont
;exten =>num,1,Background(gud/dial_num)
; same=>n,Set(TIMEOUT(digit)=4)
;exten =>_9[87]XXXXXXXX,1,Set(number=${EXTEN})
;exten =>_9[87]XXXXXXXX,n,Playback(gud/urnum)
;exten =>_9[87]XXXXXXXX,n,SayDigits(${number})
;exten =>_9[87]XXXXXXXX,n,Playback(gud/rwnum)
;exten =>_9[87]XXXXXXXX,n,WaitExten(5)
;exten =>_[12],1,GotoIf($["${EXTEN}"=="2"]?you_num,num,1:post,ss,1)
;exten =>_0ZXXXXXXX,1,Set(number=${EXTEN})
;exten =>_0ZXXXXXXX,n,Playback(gud/urnum)
;exten =>_0ZXXXXXXX,n,SayDigits(${number})
;exten =>_0ZXXXXXXX,n,Playback(gud/rwnum)
;exten =>_0ZXXXXXXX,n,WaitExten(5)
;exten =>_[12],1,GotoIf($["${EXTEN}"=="2"]?you_num,num,1:post,ss,1)
;exten =>_XXXXXX,1,Set(number=${EXTEN})
;exten =>_XXXXXX,n,Playback(gud/urnum)
;exten =>_XXXXXX,n,SayDigits(${number})
;exten =>_XXXXXX,n,Playback(gud/rwnum)
;exten =>_XXXXXX,n,WaitExten(5)
;exten =>_[12],1,GotoIf($["${EXTEN}"=="2"]?you_num,num,1:post,ss,1)
[Other]
exten => ext2,1,Playback(gud/for-other-district)
same=>n,Hangup()
[post]
exten => ss,1,Background(gud/post)
same=>n,WaitExten(5)
exten => 1,1,Set(CDR(aa)=136)
same=>n,Return()
exten => 2,1,Set(CDR(aa)=137)
same=>n,Return()
[default_cont]
exten => i,1,Playback(gud/invalid)
same=> n,Hangup()
exten => t,1,Playback(gud/timeout)
same=> n,Hangup()
;exten => h,1,AGI(convert_recordings.sh)
; same=>n,AGI(test_paf.php,${from},${CALLERID(num)},${CDR(vdc)},${CDR(msg)},${CDR(aa)})
;_________________________________________________________________________________
;_________________________________________________________________________________
[Incoming_call]
include=>Default
;include=>services
;include=>user
exten => 555,1,Verbose(Data collect)
same=> n,Answer()
same=> n,Wait(2)
same=> n,Set(time=${STRFTIME(${EPOCH},,%Y:%m:%d-%H:%M:%S)})
same=> n,Playback(/home/achyut/adcs/static/audio/welcome-to-our-sys)
;same=> n,GoSub(code,code,1)
;same=> n,Background(audio_data/proceed-as-user-admin)
;same=> n,WaitExten(5)
exten =>_42199,1,Goto(New-user,set_all,1)
exten =>_00[0123456789],1,Set(code=${EXTEN})
same=>n,Goto(admin,admin,1)
exten =>_90[123456789],1,Set(code_id=${EXTEN})
same=>n,Goto(user,ans,1)
[New-user]
exten=>set_all,1,Verbose(Setting for new user..)
same=>n,Playback(/home/achyut/adcs/static/audio/enter_ur_admin_cc)
exten=>_00[12345],1,Set(code=${EXTEN})
same=>n,MYSQL(Connect connid localhost root dev adcs)
same=>n,MYSQL(Query org_value ${connid} SELECT password FROM `organizations` WHERE admin_call_code='${code}')
same=>n,MYSQL(Fetch fetchid ${org_value} pwd)
same=>n,Verbose(${pwd})
same=>n,Authenticate(${pwd})
same=>n(next),System(mkdir /var/lib/asterisk/sounds/en/audio_data/${code})
same=>n,System(mkdir /var/lib/asterisk/sounds/en/audio_data/${code}/answer)
same=>n,System(mkdir /var/lib/asterisk/sounds/en/audio_data/${code}/question)
same=>n,Playback(/home/achyut/adcs/static/audio/thank-you-for-ur-time)
same=>n(hangup),Hangup()
[admin]
include=>validity
exten=>admin,1,MYSQL(Connect connid localhost root dev adcs)
same=>n,MYSQL(Query org_value ${connid} SELECT id,password FROM `organizations` WHERE admin_call_code='${code}')
same=>n,MYSQL(Fetch fetchid ${org_value} org_id password)
same=>n,Verbose(${org_id} -- ${password})
same=>n,Authenticate(${password},a)
same=>n,Set(person=admin)
same=> n,Playback(/home/achyut/adcs/static/audio/u-r-in-admin-page)
;select your project
same=>n,GoSub(select,project,1)
same=>n,MYSQL(Query org_ls ${connid} SELECT id,org_id FROM `projects` WHERE user_call_code='${user_cc}')
same=>n,MYSQL(Fetch fetchid ${org_ls} project_id org)
same=>n,Verbose(orgide fatch : ${org})
same=>n,Gotoif($[${org_id}==${org}]?admin,admin,next:Hang_up,hangup,1)
same=>n(next),Background(audio_data/if-u-want-to-hear-create)
exten=>1,1,Set(edit=listen)
same=>n,Goto(Hearall,hear,1)
exten=>2,1,Set(edit=create)
same=>n,Goto(create,creates,1)
[select]
exten=>project,1,Background(./../../../../../../home/achyut/adcs/static/audio/enter_user_call_code)
same=>n,WaitExten(3)
exten=>_90[12345678],1,Set(user_cc=${EXTEN})
same=>n,Return(${user_cc})
[hear_edit]
include=>validity
exten=>he,1,Background(/home/achyut/adcs/static/audio/if-u-want-to-hear-create)
exten=>1,1,Set(edit=listen)
same=>n,Goto(Hearall,hear,1)
exten=>2,1,Set(edit=edit)
same=>n,Goto(Editsome,edit,1)
exten=>3,1,Set(edit=create)
same=>n,System(rm /var/lib/asterisk/sounds/en/audio_data/${code}/*.gsm)
same=>n,Return()
[menu_select]
exten=>menu,1,Background(audio_data/if-u-want-to-hear-create)
same=>n,WaitExten(3)
exten=>_X,1,Gotoif($[${EXTEN}==1]?admin,admin,next:back)
same=>n(back),Playback(/home/achyut/adcs/static/audio/thank-you-for-ur-time)
same=>n,Hangup()
[Hearall]
exten=>hear,1,Verbose(User call Code =${user_cc})
same=>n,MYSQL(Query total_qn ${connid} SELECT COUNT(*) FROM `questions` where project_id='${project_id}')
same=>n,MYSQL(Fetch FoundRow ${total_qn} tq)
same=>n,Playback(/home/achyut/adcs/static/audio/${user_cc}/start-up-info)
same=>n,Set(COUNT=0)
same=>n,Set(id=0)
same=>n(again),Playback(/home/achyut/adcs/static/audio/question-no)
same=>n,Set(COUNT=$[${COUNT}+1])
same=>n,SayDigits(${COUNT})
same=>n,MYSQL(Query q ${connid} SELECT id,question FROM `questions` WHERE project_id='${project_id}' and id>${id} limit 1)
same=>n,MYSQL(Fetch fetchid ${q} id quest )
same=>n,Playback(/home/achyut/adcs/static/audio/${user_cc}/question/${quest})
same=>n,Gotoif($["${COUNT}"=="${tq}"]?back:again)
same=>n(back),Goto(menu_select,menu,1)
;SELECT total_question FROM `admin` WHERE id =(select max(id) from admin where changes='create')
[create]
exten=>creates,1,Playback(/home/achyut/adcs/static/audio/start-ur-recording-after-beep)
same=>n,Background(/home/achyut/adcs/static/audio/any-info-before-question-began)
same=>n,WaitExten(5)
exten=>_[12],1,Gotoif($["${EXTEN}"=="1"]?create,1,rec:create,2,none)
same=>n(rec),Record(en/start-up-info.wav)
same=>n,System(mv /var/lib/asterisk/sounds/en/start-up-info.wav /home/achyut/adcs/static/audio/${user_cc}/start-up-info.wav)
same=>n(none),NoOp()
same=>n,Set(start_info=${IF($[ ${EXTEN} = 1]?yes:no)})
;same=>n,MYSQL(Connect connid localhost root dev asterisk)
same=>n,MYSQL(Query updat ${connid} UPDATE `projects` SET `start_info`='${start_info}' WHERE user_call_code='${user_cc}')
; same=>n,GoSub(NUll_set,nuls,1)
same=>n,GoSub(subquestion,que,1)
same=>n,GoSub(question_record,qr,1)
same=>n,MYSQL(Disconnect ${connid})
same=>n,Playback(/home/achyut/adcs/static/audio/ur-all-question-are-set)
same=>n,Goto(menu_select,menu,1)
[subquestion]
exten=>que,1,Background(/home/achyut/adcs/static/audio/how-many-question)
same=>n,WaitExten(5)
exten=>_X,1,Set(question=${EXTEN})
same=>n,Return()
[NUll_set]
exten=>nuls,1,Set(n=1)
same=>n(hee),Set(q${n}=NULL)
same=>n,Set(n=$[${n}+1])
same=>n,GotoIf($[${n}==10]?haa:hee)
same=>n(haa),Return()
[question_record]
exten=>qr,1,Verbose(1,Start to recording question)
same=>n,Set(COUNT=0)
same=>n,MYSQL(Query delete ${connid} DELETE FROM `questions` WHERE project_id = '${project_id}')
same=>n(again),Playback(/home/achyut/adcs/static/audio/question-no)
same=>n,Set(COUNT=$[${COUNT}+1])
same=>n,SayDigits(${COUNT})
same=>n,GoSub(whattodo,wtd,1)
same=>n,Verbose(${do})
same=>n,Gotoif($[${do}==1]?audio,ad,1)
same=>n,Gotoif($[${do}==2]?dialing,ad,1)
same=>n,Gotoif($[${do}==3]?option,ad,1)
same=>n(comeback),MYSQL(Query set ${connid} INSERT INTO `questions`( `project_id`, `question`, `question_type`) VALUES (${project_id},'question-no-${COUNT}.wav',${do}))
same=>n,Verbose(${set})
;same=>n,MYSQL(Clear ${delete})
;same=>n,MYSQL(Clear ${setting})
same=>n,Gotoif($["${COUNT}"=="${question}"]?back:again)
;same=>n,Hangup()
same=>n(back),Return()
[whattodo]
exten=>wtd,1,Background(/home/achyut/adcs/static/audio/dial_question_type)
same=>n,WaitExten(4)
exten=>_[123],1,Set(do=${EXTEN})
same=>n,Return(do)
[audio]
exten=>ad,1,Record(en/question-no-${COUNT}.wav)
same=>n,System(mv /var/lib/asterisk/sounds/en/question-no-${COUNT}.wav /home/achyut/adcs/static/audio/${user_cc}/question/question-no-${COUNT}.wav)
same=>n,Set(q${COUNT}=${do})
same=>n,Goto(question_record,qr,comeback)
[dialing]
exten=>ad,1,Record(en/question-no-${COUNT}.wav)
same=>n,System(mv /var/lib/asterisk/sounds/en/question-no-${COUNT}.wav /home/achyut/adcs/static/audio/${user_cc}/question/question-no-${COUNT}.wav)
same=>n,Set(q${COUNT}=${do})
same=>n,Goto(question_record,qr,comeback)
[option]
exten=>ad,1,Record(en/question-no-${COUNT}.wav)
same=>n,System(mv /var/lib/asterisk/sounds/en/question-no-${COUNT}.wav /home/achyut/adcs/static/audio/${user_cc}/question/question-no-${COUNT}.wav)
same=>n,Set(q${COUNT}=${do})
same=>n,Goto(question_record,qr,comeback)
[user]
exten=>ans,1,MYSQL(Connect connid localhost root dev adcs)
same=>n,MYSQL(Query start ${connid} SELECT id,start_info FROM `projects` WHERE user_call_code='${code_id}')
same=>n,MYSQL(Fetch fetchid ${start} project_id start_info)
same=>n,Verbose(${start_info} ${project_id})
same=>n,Gotoif($[${start_info}=="no"]?go)
same=>n,Playback(./../../../../../../home/achyut/adcs/static/audio/${code_id}/start-up-info)
same=>n(go),GoSub(answer,anw,1)
same=>n,Playback(/home/achyut/adcs/static/audio/thank-you-for-ur-time)
same=>n,MYSQL(Query value ${connid} SELECT total_response FROM `projects` WHERE user_call_code='${code_id}')
same=>n,MYSQL(Fetch fetchid ${value} trp)
same=>n,Verbose(total_response=${trp})
same=>n,Set(trp=$[${trp}+1])
same=>n,MYSQL(Query rp ${connid} UPDATE `projects` SET `total_response`=${trp} WHERE user_call_code='${code_id}')
;same=>n,INSERT INTO `data`(`id`, `project_code`, `time`, `person`, `user`, `q1`, `q2`, `q3`, `q4`, `q5`, `q6`, `q7`, `q8`, `q9`, `q10`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],[value-8],[value-9],[value-10],[value-11],[value-12],[value-13],[value-14],[value-15])
same=>n,MYSQL(Disconnect ${connid})
same=>n,Hangup()
[answer]
exten=>anw,1,Verbose(Start to taking response)
same=>n,Set(branch_name=0)
same=>n,Set(id=0)
same=>n,Set(COUNT=0)
same=>n(back_again),MYSQL(Query total_qn ${connid} SELECT COUNT(*) FROM `questions` where project_id='${project_id}' and branch_name=${branch_name})
same=>n,MYSQL(Fetch FoundRow ${total_qn} tq)
same=>n,Set(file=${time}_answer)
same=>n(again),Playback(/home/achyut/adcs/static/audio/question-no)
same=>n,Set(COUNT=$[${COUNT}+1])
same=>n,SayDigits(${COUNT})
same=>n,MYSQL(Query q ${connid} SELECT id,question,question_type FROM `questions` WHERE project_id='${project_id}' and id>${id} and branch_name = ${branch_name} limit 1)
same=>n,MYSQL(Fetch fetchid ${q} id quest qtype )
same=>n,Verbose(${qtype})
same=>n,AGI(wav.php,${quest})
same=>n,Verbose(${question_file})
same=>n,Gotoif($[${qtype}==1]?ans_audio,andu,1)
same=>n,Gotoif($[${qtype}==2]?ans_dialing,andi,1)
same=>n,Gotoif($[${qtype}==3]?branch_solve,solving,1)
same=>n(comeback),MYSQL(Query push ${connid} INSERT INTO `answers`(`time`, `project_id`, `question_id`,`answer`,`phone_number`) VALUES ('${time}',${project_id},${id},'${a${COUNT}}','${CALLERID(num)}'))
same=>n,Gotoif($[${COUNT}==${tq}]?back:again)
same=>n(solved),Verbose(branching successful)
same=>n(back),Gotoif($[${qtype}==3]?back_again:return)
;same=>n,MYSQL(Fetch fetchid ${use} user)
;same=>n,Verbose(${user})
;same=>n,Set(user=$[${user}+1])
same=>n(return),Return()
[branch_solve]
exten=>solving,1,Playback(./../../../../../../home/achyut/adcs/static/audio/${code_id}/question/${question_file})
same=>n,WaitExten(3)
exten=>_[0123456789],1(solve_here),Verbose(dial extention : ${EXTEN})
same=>n,Set(branch_name=${EXTEN})
same=>n,Goto(answer,anw,solved)
[ans_audio]
exten=>andu,1,Playback(./../../../../../../home/achyut/adcs/static/audio/${code_id}/question/${question_file})
same=>n,Record(en/${file}-${COUNT}.wav)
same=>n,System(mv /var/lib/asterisk/sounds/en/${file}-${COUNT}.wav /home/achyut/adcs/static/audio/${code_id}/answer/${file}-${COUNT}.wav)
same=>n,Set(a${COUNT}=${file}-${COUNT}.wav)
same=>n,Goto(answer,anw,comeback)
[ans_dialing]
exten=>andi,1,Playback(./../../../../../../home/achyut/adcs/static/audio/${code_id}/question/${question_file})
same=>n,WaitExten(4)
exten=>_X,1,Set(a${COUNT}=${EXTEN})
same=>n,Goto(answer,anw,comeback)
[ans_option]
exten=>anop,1,Playback(./../../../../../../home/achyut/adcs/static/audio/${code_id}/question/${question_file})
same=>n,WaitExten(4)
exten=>_[1234],1,Set(a${COUNT}=${EXTEN})
same=>n,Goto(answer,anw,comeback)
[Editsome]
exten=>edit,1,Verbose(Question are editing...)
same=>n,MYSQL(Connect connid localhost root dev asterisk)
same=>n,MYSQL(Query total_qn ${connid} select `id` from `code_info` where `code_info`.`code_no`= '${code}')
same=>n,MYSQL(Fetch fetchid ${code_r} id)
same=>n,Set(COUNT=0)
same=>n(again),Gotoif($[${COUNT}==""]?Editsome,[12],hangup)
same=>n,Playback(/home/achyut/adcs/static/audio/question-no)
same=>n,Set(COUNT=$[${COUNT}+1])
same=>n,SayDigits(${COUNT})
same=>n,Playback(/home/achyut/adcs/static/audio/${code}/question-no-${COUNT})
same=>n,Background(audio_data/edit)
exten=>[12],1,Gotoif($["${EXTEN}"=="2"]?:Editsome,edit,again)
same=>n,macro(change,${COUNT})
same=>n,Goto(Editsome,edit,again)
same=>n(hangup),Playback(your question are set)
same=>n,Hangup()
[macro-change]
exten=>mcr,1,Background(record ur massage)
same=>n,Record(en/audio_data/${code}/question-no-${ARG1}.wav)
[Hang_up]
exten=>hangup,1,Playback(pbx-invalid)
same=>n,Hangup()
[validity]
exten=>t,1,Playback(pbx-goodbye)
exten=>i,1,Playback(pbx-invalid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment