Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # TP VIP 2018
- ### Id campus booster : 217019
- ## Templates (2 points)
- ### Global template
- With the give requirements we get the following generic template:
- `users.conf`
- ```
- [Global_2019298_tpl](!)
- hassip=yes
- type=friend
- ; Codecs disallowed
- disallow=all
- ; Codecs allowed
- allow=alaw
- allow=g711
- allow=ulaw
- allow=g711
- nat=no ; Behind NAT
- qualify=no ; Monitoring
- host=dynamic ; Any clients
- ```
- ### Department templates
- Each department template is based on the global template and define the department context:
- `users.conf`
- ```
- [sales_3003_tpl](!,Global_2019298_tpl)
- context=sales_3003
- [support_4582_tpl](!,Global_2019298_tpl)
- context=support_4582
- [randd_5024_tpl](!,Global_2019298_tpl)
- context=randd_5024
- [testing_9377_tpl](!,Global_2019298_tpl)
- context=testing_9377
- ```
- ## Users creation (1 points)
- Each user is create based on the template of the deparment it belongs to. The secret is also defined here.
- `users.conf`
- ```
- [12546](sales_3003_tpl)
- secret=5624
- username=BillyTheKid
- [12547](sales_3003_tpl)
- secret=6481
- username=DavyCrockett
- [21499](support_4582_tpl)
- secret=3688
- username=JesseJames
- [21500](support_4582_tpl)
- secret=3052
- username=ButchCassidy
- [40000](randd_5024_tpl)
- secret=8472
- username=BuffaloBill
- [90000](testing_9377_tpl)
- secret=1234
- username=TestTest
- ```
- ## Voicemail creation (1 points)
- Voicemail is defined for each user with the same secret of `users.conf` file:
- `voicemail.conf`
- ```
- [Voicemail_4783]
- 12546 => 5624,12546,BillyTheKid@cpsc.lan
- 12547 => 6481,12547,DavyCrockett@cpsc.lan
- 21499 => 3688,21499,JesseJames@cpsc.lan
- 21500 => 3052,21500,ButchCassidy@cpsc.lan
- 40000 => 8472,40000,BuffaloBill@cpsc.lan
- 90000 => 1234,90000,TestTest@cpsc.lan
- ```
- ## Dialplan Configuration - Dialplan Setup (3 points)
- ### Voicemail configuration
- `extensions.conf`
- ```
- [General_context_2118]
- exten => 0000,1,Answer() ; When calling 0000, answer
- same => n,VoiceMailMain(${CALLERID(num)}@Voicemail_4783) ; And consult voicemail based on caller id number
- ```
- ### Internal department configuration
- Below is just an part of the configuration of the analytic department
- because it is the same pattern for every department with a different range.
- Some adaptations were made to handle a different timeout for inter department.
- The last number of the department range is reserved for ring groups.
- `extensions.conf`
- ```
- [sales_3003]
- include => General_context_2118
- include => support_4582_dep
- include => randd_5024_dep
- include => testing_9377_dep
- exten => _1254[6-9],1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _125[5-9]X,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _1[3-9]XXX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _20XXX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _21[0-3]XX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _214[0-1]X,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- [support_4582]
- include => General_context_2118
- include => sales_3003_dep
- include => randd_5024_dep
- include => testing_9377_dep
- exten => 21499,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _21[5-9]XX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _2[2-9]XXX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _3[0-4]XXX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _35[0-5]XX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _356[0-2]X,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- exten => _3563[0-3],1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- [randd_5024]
- include => General_context_2118
- include => sales_3003_dep
- include => sales_3003_dep
- include => testing_9377_dep
- exten => _4XXXX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- [testing_9377]
- include => General_context_2118
- include => sales_3003_dep
- include => randd_5024_dep
- include => support_4582_dep
- exten => _9XXXX,1,Set(_Timeout=37)
- same => n,Dial(SIP/${EXTEN},${Timeout})
- same => n,Voicemail(${EXTEN}@Voicemail_4783)
- ```
- ## Dialplan Configuration - Inter- Departments Communication (3 points)
- ### New contexts - creation
- New contexts are created for each department.
- ### New contexts - usage
- The new inter department contexts are included inside each internal department context except the for current department It means inside sales_3003 , sales_3003_dep is not included because it is already defined.
- `extensions.conf`
- ```
- [sales_3003_dep]
- exten => _1254[6-9],1,Set(_Timeout=65)
- same => n,Goto(sales_3003,${EXTEN},2)
- exten => _125[5-9]X,1,Set(_Timeout=65)
- same => n,Goto(sales_3003,${EXTEN},2)
- exten => _1[3-9]XXX,1,Set(_Timeout=65)
- same => n,Goto(sales_3003,${EXTEN},2)
- exten => _20XXX,1,Set(_Timeout=65)
- same => n,Goto(sales_3003,${EXTEN},2)
- exten => _21[0-3]99,1,Set(_Timeout=65)
- same => n,Goto(sales_3003,${EXTEN},2)
- exten => _214[0-1]X,1,Set(_Timeout=65)
- same => n,Goto(sales_3003,${EXTEN},2)
- [support_4582_dep]
- exten => 21499,1,Set(_Timeout=65)
- same => n,Goto(support_4582,${EXTEN},2)
- exten => _21[5-9]XX,1,Set(_Timeout=65)
- same => n,Goto(support_4582,${EXTEN},2)
- exten => _2[2-9]XXX,1,Set(_Timeout=65)
- same => n,Goto(support_4582,${EXTEN},2)
- exten => _3[0-4]XXX,1,Set(_Timeout=65)
- same => n,Goto(support_4582,${EXTEN},2)
- exten => _35[0-5]XX,1,Set(_Timeout=65)
- same => n,Goto(support_4582,${EXTEN},2)
- exten => _356[0-2]X,1,Set(_Timeout=65)
- same => n,Goto(support_4582,${EXTEN},2)
- exten => _3563[0-3],1,Set(_Timeout=65)
- same => n,Goto(support_4582,${EXTEN},2)
- [randd_5024_dep]
- exten => _4XXXX,1,Set(_Timeout=65)
- same => n,Goto(randd_5024,${EXTEN},2)
- [testing_9377_dep]
- exten => _9XXXX,1,Set(_Timeout=65)
- same => n,Goto(testing_9657,${EXTEN},2)
- ```
- ## Dialplan Configuration - Ring Groups (2 points)
- Ring groups are defined inside the General_context_2118 context because they need to be included inside each department.
- `extensions.conf`
- ```
- ; Ring Groups
- exten => 21419,1,Set(_Timeout=24)
- same => n,Dial(SIP/12546,${Timeout})
- same => n,Dial(SIP/12547,${Timeout})
- same => n,Dial(SIP/12548,${Timeout})
- same => n,Dial(SIP/12549,${Timeout})
- same => n,Goto(General_context_2118,21419,1)
- exten => 35633,1,Set(_Timeout=31)
- same => n,Dial(SIP/21499,${Timeout})
- same => n,Dial(SIP/21500,${Timeout})
- same => n,Dial(SIP/21501,${Timeout})
- same => n,Dial(SIP/21502,${Timeout})
- same => n,Goto(General_context_2118,35633,1)
- exten => 49999,1,Dial(SIP/40000&SIP/40001&SIP/40002&SIP/400003,29)
- same => n,Voicemail(40000@Voicemail_4783)
- exten => 99999,1,Dial(SIP/90000&SIP/90001&SIP/90002&SIP/90003,38)
- same => n,Voicemail(90000@Voicemail_4783)
- ```
- ## Call Features - IVR (3 points)
- `extensions.conf`
- ```
- [IVR_2019263]
- exten => s,1,Answer()
- same => n,Set(TIMEOUT(response)=13)
- same => n,agi(googletts.agi,"Clay Pigeon Shooting Corporation welcome")
- same => n,agi(googletts.agi,"To contact the Sales department, press 1",en,1)
- same => n,agi(googletts.agi,"To contact the Support department, press 2",en,2)
- same => n,agi(googletts.agi,"To contact the Research and Development department, press 3",en,3)
- same => n,WaitExten()
- exten => 1,1,Goto(General_context_2118,21419,1)
- exten => 2,1,Goto(General_context_2118,35633,1)
- exten => 3,1,Goto(General_context_2118,49999,1)
- exten => _[04-9#*],1,Goto(IVR_2019263,s,3)
- exten => t,1,Goto(IVR_2019263,s,3)
- ```
- `extensions.conf` for testing
- ```
- exten => 01234,1,Goto(IVR_2019263,s,1) ; Go to the first step of the IVR context
- ```
- ## Call Features - SIP Trunk (1 points)
- ```
- ```
- ## Inter-Connection - IAX (2 points)
- `iax.conf`
- ```
- [IAX_French_97724]
- ; Disallow all codecs except G.711
- disallow=all
- allow=alaw
- allow=g711
- trunk=yes
- type=friend
- username=IAX_French_97724
- secret=itMustBeHardToConnectInHere
- context=IAX_trunk_1135
- host=104.27.24.50 ; remote iax peer ip
- qualify=yes
- ```
- `extension.conf`
- ```
- ; IAX
- [IAX_trunk_1135]
- exten => _5XXXX,1,Dial(IAX2/IAX_French_97724/${EXTEN})
- ```
- ## Fail2Ban (2 points)
- `jail.conf`
- ```
- [asterisk]
- enabled=true
- filter=asterisk
- action=iptables-allports[name=ASTERISK, protocol=all] # block ip
- logpath=/var/log/asterisk/security # security file
- bantime=32953 # ban time
- maxretry=13 # number of authentication failures
- findtime=70 # time frame
- ```
Add Comment
Please, Sign In to add comment