[asterisk-users] Asterisk trunking
Jan Prunk
janprunk at gmail.com
Thu Nov 6 09:42:17 CST 2008
Hello !
I am experiencing some problems with Asterisk trunking, this is the scenario:
There are 3 servers, a DID server provider (VOIP provider) which
delegates us a bunch of DID numbers to our asterisk server number one
(I will call it AA), from which I route the calls to Asterisk server
number 2 (I will call it BB), which then terminate on phone handsets.
The trouble is, that I probably didn't do a proper routing, when I was
trying out parked calls with key #, the phone which is connected to BB
was constantly trying to connect to AA.
Here is the Dialplan configuration:
Asterisk server number one (AA)
All outgoing calls need a 5555 prefix in front of the number
[buster]
; btc trunk
exten => _9.,1,DIAL(SIP/btctrunk/${EXTEN})
exten => _9.,n,Hangup()
; soft
; caller-id SOFT
;exten => _X.,1,Set(CALLERID(num)=015555${CALLERID(num)})
exten => _X.,1,Set(CALLERID(num)=0158631${CALLERID(num)})
exten => _X.,n,DIAL(SIP/softnet/555501${EXTEN})
exten => _X.,n,Hangup()
; popravek 0
;exten => _0.,1,Set(CALLERID(num)=018109${CALLERID(num)})
exten => _0.,1,Set(CALLERID(num)=0158631${CALLERID(num)})
exten => _0.,n,DIAL(SIP/softnet/5555${EXTEN})
exten => _0.,n,Hangup()
; voicemail
; exten => 700,1,VoiceMailMain()
;exten => _018109.,1,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
;exten => _018109.,n(unavail),Voicemail(300 at default,su)
;exten => _018109.,n,Hangup()
;exten => _018109.,n(busy),VoiceMail(300 at default,sb)
;exten => _018109.,n,Hangup()
exten => _018109.,1,Answer()
exten => _018109.,n,Playback(pbx-invalid)
exten => _018109.,n,Playback(vm-goodbye)
exten => _018109.,n,Hangup()
exten => _0158631.,1,Answer()
exten => _0158631.,n,Playback(pbx-invalid)
exten => _0158631.,n,Playback(vm-goodbye)
exten => _0158631.,n,Hangup()
; parked calls
include => parkedcalls
; telprom prenos
exten => 018109235,1,Answer()
exten => 018109235,n,Dial(SIP/telprom/70,130,rtk)
exten => 018109235,n,Hangup()
exten => 015863160,1,Answer()
exten => 015863160,n,Dial(SIP/telprom/5863160,130,rtk)
exten => 015863160,n,Hangup()
exten => 015863161,1,Answer()
exten => 015863161,n,Dial(SIP/telprom/5863161,130,rtk)
exten => 015863161,n,Hangup()
exten => 015863162,1,Answer()
exten => 015863162,n,Dial(SIP/telprom/5863162,130,rtk)
exten => 015863162,n,Hangup()
exten => 015863163,1,Answer()
exten => 015863163,n,Dial(SIP/telprom/5863163,130,rtk)
exten => 015863163,n,Hangup()
exten => 015863164,1,Answer()
exten => 015863164,n,Dial(SIP/telprom/5863164,130,rtk)
exten => 015863164,n,Hangup()
exten => 015863165,1,Answer()
exten => 015863165,n,Dial(SIP/telprom/5863165,130,rtk)
exten => 015863165,n,Hangup()
exten => 015863166,1,Answer()
exten => 015863166,n,Dial(SIP/telprom/5863166,130,rtk)
exten => 015863166,n,Hangup()
exten => 015863167,1,Answer()
exten => 015863167,n,Dial(SIP/telprom/5863167,130,rtk)
exten => 015863167,n,Hangup()
exten => 015863168,1,Answer()
exten => 015863168,n,Dial(SIP/telprom/5863168,130,rtk)
exten => 015863168,n,Hangup()
exten => 015863169,1,Answer()
exten => 015863169,n,Dial(SIP/telprom/5863169,130,rtk)
exten => 015863169,n,Hangup()
exten => 015863170,1,Answer()
exten => 015863170,n,Dial(SIP/telprom/5863170,130,rtk)
exten => 015863170,n,Hangup()
exten => 015863171,1,Answer()
exten => 015863171,n,Dial(SIP/telprom/5863171,130,rtk)
exten => 015863171,n,Hangup()
; lokalni telefoni
exten => 018109222,1,Dial(SIP/222,130,rtk)
exten => 018109222,n,Hangup()
exten => 018109223,1,Dial(SIP/223,130,rtk)
exten => 018109223,n,Hangup()
exten => 018109224,1,Dial(SIP/224,130,rtk)
exten => 018109224,n,Hangup()
exten => 018109225,1,Dial(SIP/225,130,rtk)
exten => 018109225,n,Hangup()
exten => 018109226,1,Dial(SIP/226,130,rtk)
exten => 018109226,n,Hangup()
exten => 222,1,Dial(SIP/222,130,rtk)
exten => 222,n,Hangup()
exten => 223,1,Dial(SIP/223,130,rtk)
exten => 223,n,Hangup()
exten => 224,1,Dial(SIP/224,130,rtk)
exten => 224,n,Hangup()
exten => 225,1,Dial(SIP/225,130,rtk)
exten => 225,n,Hangup()
exten => 226,1,Dial(SIP/226,130,rtk)
exten => 226,n,Hangup()
---
Asterisk server number two (BB)
All phones are connected to context "buster"
[buster]
exten => _9.,1,Dial(SIP/btctrunk/${EXTEN})
exten => _9.,n,NoOp(HANGUPCAUSE is ${HANGUPCAUSE})
exten => _9.,n,Hangup
; soft - nova pravila
exten => _X.,1,Dial(SIP/softlink/${EXTEN})
exten => _X.,n,NoOp(HANGUPCAUSE is ${HANGUPCAUSE})
exten => _X.,n,Hangup
; mobitel
exten => _7.,1,Dial(SIP/portech/${EXTEN:1})
exten => _7.,2,Hangup
exten => _+38651.,1,Dial(SIP/portech/${EXTEN})
exten => _+38651.,2,Hangup
exten => _+38641.,1,Dial(SIP/portech/${EXTEN})
exten => _+38641.,2,Hangup
exten => _+38631.,1,Dial(SIP/portech/${EXTEN})
exten => _+38631.,2,Hangup
exten => _+38640.,1,Dial(SIP/portech/${EXTEN})
exten => _+38640.,2,Hangup
exten => _+38670.,1,Dial(SIP/portech/${EXTEN})
exten => _+38670.,2,Hangup
exten => _0038651.,1,Dial(SIP/portech/${EXTEN})
exten => _0038651.,2,Hangup
exten => _0038641.,1,Dial(SIP/portech/${EXTEN})
exten => _0038641.,2,Hangup
exten => _0038631.,1,Dial(SIP/portech/${EXTEN})
exten => _0038631.,2,Hangup
exten => _0038640.,1,Dial(SIP/portech/${EXTEN})
exten => _0038640.,2,Hangup
exten => _0038670.,1,Dial(SIP/portech/${EXTEN})
exten => _0038670.,2,Hangup
exten => _040.,1,Dial(SIP/portech/${EXTEN})
exten => _040.,n(busy),Dial(ZAP/r1/${EXTEN}
exten => _040.,n,Hangup
exten => _031.,1,Dial(SIP/portech/${EXTEN})
exten => _031.,n(busy),Dial(ZAP/r1/${EXTEN}
exten => _031.,n,Hangup
exten => _041.,1,Dial(SIP/portech/${EXTEN})
exten => _041.,n,NoOp(HANGUPCAUSE is ${HANGUPCAUSE})
exten => _041.,n(busy),Dial(ZAP/r1/${EXTEN})
exten => _041.,n,NoOp(HANGUPCAUSE is ${HANGUPCAUSE})
exten => _041.,n,Hangup
exten => _051.,1,Dial(SIP/portech/${EXTEN})
exten => _051.,n(busy),Dial(ZAP/r1/${EXTEN}
exten => _051.,n,Hangup
exten => _070.,1,Dial(SIP/portech/${EXTEN})
exten => _070.,n(busy),Dial(ZAP/r1/${EXTEN}
exten => _070.,n,Hangup
exten => _5863160,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863160,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863160,n,Answer()
exten => _5863160,n,Dial(SIP/60,7,rtk)
exten => _5863160,n,Dial(SIP/64,15,rtk)
exten => _5863160,n,Dial(SIP/64&SIP/63,120,rtk)
exten => _5863160,n,Hangup()
exten => _5863161,1,Answer()
exten => _5863161,n,Dial(IAX2/140,120,rtk)
exten => _5863161,n,Hangup()
exten => _5863162,1,Answer()
exten => _5863162,n,Dial(SIP/62&SIP/82,4,rtk)
exten => _5863162,n,Dial(SIP/62&SIP/portech/041334765,30,rtk)
exten => _5863162,n,Hangup()
exten => _5863163,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863163,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863163,n,Answer()
exten => _5863163,n,Dial(SIP/63,17,rtk)
exten => _5863163,n,Dial(SIP/60,15,rtk)
exten => _5863163,n,Dial(SIP/66&SIP/65,120,rtk)
exten => _5863163,n,Hangup()
exten => _5863164,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863164,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863164,n,Answer()
exten => _5863164,n,Dial(SIP/64,10,rtk)
exten => _5863164,n,Dial(SIP/60,15,rtk)
exten => _5863164,n,Dial(SIP/60&SIP/63,120,rtk)
exten => _5863164,n,Hangup()
exten => _5863165,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863165,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863165,n,Answer()
exten => _5863165,n,Dial(SIP/65,17,rtk)
exten => _5863165,n,Dial(SIP/64,15,rtk)
exten => _5863165,n,Dial(SIP/60,120,rtk)
exten => _5863165,n,Hangup()
exten => _5863166,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863166,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863166,n,Answer()
exten => _5863166,n,Dial(SIP/66,17,rtk)
exten => _5863166,n,Dial(SIP/64,120,rtk)
exten => _5863166,n,Hangup()
exten => _5863167,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863167,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863167,n,Answer()
exten => _5863167,n,Dial(SIP/67,17,rtk)
exten => _5863167,n,Dial(SIP/60,15,rtk)
exten => _5863167,n,Dial(SIP/66&SIP/65,120,rtk)
exten => _5863167,n,Hangup()
exten => _5863168,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863168,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863168,n,Answer()
exten => _5863168,n,Dial(SIP/68,17,rtk)
exten => _5863168,n,Dial(SIP/60,15,rtk)
exten => _5863168,n,Dial(SIP/66&SIP/65,120,rtk)
exten => _5863168,n,Hangup()
exten => _5863169,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863169,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863169,n,Answer()
exten => _5863169,n,Dial(SIP/69,17,rtk)
exten => _5863169,n,Dial(SIP/60,15,rtk)
exten => _5863169,n,Dial(SIP/66&SIP/65,120,rtk)
exten => _5863169,n,Hangup()
;exten => 5863170,1,Dial(SIP/70,20,rtk)
;exten => 5863170,n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
;exten => 5863170,n(unavail),Voicemail(70 at default,u)
;exten => 5863170,n,Hangup()
;exten => 5863170,n(busy),VoiceMail(70 at default,b)
;exten => 5863170,n,Hangup()
;;exten => 5863170,1,Answer()
;;exten => 5863170,2,SET(TRIES=0)
;;exten => 5863170,2,Wait(1)
;;exten => 5863170,3(playback),Background(spy-jingle)
;;exten => 5863170,n,WaitExten(3)
;;exten => 5863170,n,Dial(SIP/70,15,rtk)
;;exten => 5863170,n,Hangup()
exten => _5863170,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863170,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863170,n,Answer()
exten => _5863170,n,Dial(SIP/70,17,rtk)
exten => _5863170,n,Dial(SIP/60,15,rtk)
exten => _5863170,n,Dial(SIP/63,120,rtk)
exten => _5863170,n,Hangup()
exten => _5863171,1,GotoIfTime(17:00-07:30|mon-fri|*|*?frontdesk,closed,1)
exten => _5863171,n,GotoIfTime(*|sat-sun|*|*?frontdesk,closed,1)
exten => _5863171,n,Answer()
exten => _5863171,n,Dial(SIP/71,17,rtk)
exten => _5863171,n,Dial(SIP/60,15,rtk)
exten => _5863171,n,Dial(SIP/66&SIP/65,120,rtk)
exten => _5863171,n,Hangup()
;exten => 5863172,1,Dial(IAX2/140,120,rtk)
exten => _5863172,1,Answer()
exten => _5863172,n,Dial(SIP/61,120,rtk)
exten => _5863172,n,Hangup()
exten => _5863173,1,Answer()
exten => _5863173,1,Dial(SIP/73,30,rtk)
exten => _5863173,n,Hangup()
exten => _5863175,1,Answer()
exten => _5863175,n,Dial(SIP/75,30,rtk)
exten => _5863175,n,Hangup()
exten => _5863178,1,Answer()
exten => _5863178,n,Dial(SIP/78,30,rtk)
exten => _5863178,n,Hangup()
; lokalne stevilke
exten => 36,1,Dial(SIP/36,130,rtk)
exten => 36,n,Hangup()
exten => 60,1,Dial(SIP/60,130,rtk)
exten => 60,n,Hangup()
exten => 61,1,Dial(SIP/61,130,rtk)
exten => 61,n,Hangup()
exten => 62,1,Dial(SIP/62&SIP/82,7,rtk)
exten => 62,n,Dial(SIP/62&SIP/portech/041334765,30,rtk)
exten => 62,n,Hangup()
exten => 63,1,Dial(SIP/63,130,rtk)
exten => 63,n,Hangup()
exten => 64,1,Dial(SIP/64,130,rtk)
exten => 64,n,Hangup()
exten => 65,1,Dial(SIP/65,130,rtk)
exten => 65,n,Hangup()
exten => 66,1,Dial(SIP/66,130,rtk)
exten => 66,n,Hangup()
exten => 67,1,Dial(SIP/67,130,rtk)
exten => 67,n,Hangup()
exten => 68,1,Dial(SIP/68,130,rtk)
exten => 68,n,Hangup()
exten => 69,1,Dial(SIP/69,130,rtk)
exten => 69,n,Hangup()
exten => 70,1,Dial(SIP/70,130,rtk)
exten => 70,n,Hangup()
exten => 71,1,Dial(SIP/71,130,rtk)
exten => 71,n,Hangup()
exten => 73,1,Dial(SIP/73,130,rtk)
exten => 73,n,Hangup()
exten => 74,1,Answer()
exten => 74,2,SET(TRIES=0)
exten => 74,2,Wait(1)
exten => 74,3(playback),Background(spy-jingle)
exten => 74,n,WaitExten(10)
exten => 74,n,MusicOnHold(demo-instruct)
exten => 74,n,Dial(SIP/btctrunk/2977,15,rtk)
exten => 74,n,Hangup()
exten => 75,1,Dial(SIP/75,130,rtk)
exten => 75,n,Hangup()
exten => 78,1,Dial(SIP/78,130,rtk)
exten => 78,n,Hangup()
exten => 80,1,Dial(SIP/80,130,rtk)
exten => 80,n,Hangup()
exten => 82,1,Dial(SIP/82,130,rtk)
exten => 82,n,Hangup()
exten => 82,1,Dial(SIP/82,130,rtk)
exten => 82,n,Hangup()
exten => 83,1,Dial(SIP/83,130,rtk)
exten => 83,n,Hangup()
exten => 88,1,Dial(SIP/88,130,rtk)
exten => 88,n,Hangup()
exten => 89,1,Dial(SIP/89,130,rtk)
exten => 89,n,Hangup()
exten => 90,1,Dial(SIP/90,130,rtk)
exten => 90,n,Hangup()
exten => 95,1,Dial(SIP/95,130,rtk)
exten => 95,n,Hangup()
exten => 96,1,Dial(SIP/96,130,rtk)
exten => 96,n,Hangup()
; voicemail
exten => 700,1,VoiceMailMain()
; Pickup BLF
exten => _**6X,1,SET(GLOBAL(PICKUPMARK)=${EXTEN:2}@buster)
exten => _**6X,n,PickUp(${EXTEN:2}@buster)
exten => _**7X,1,SET(GLOBAL(PICKUPMARK)=${EXTEN:2}@buster)
exten => _**7X,n,PickUp(${EXTEN:2}@buster)
;exten => _**.,1,Pickup(${EXTEN:2}@buster)
;exten => _**.,n,Hangup()
;;exten => _**6X,1,Pickup(${EXTEN:2}@buster)
;;exten => _**6X,2,Hangup
; Record voice file to /tmp directory
exten => 205,1,Wait(2) ; Call 205 to Record new Sound Files
exten => 205,2,Record(/tmp/asterisk-recording:gsm) ; Press # to stop recording
exten => 205,3,Wait(2)
exten => 205,4,Playback(/tmp/asterisk-recording) ; Listen to your voice
exten => 205,5,wait(2)
exten => 205,6,Hangup
[BLF]
exten => 5863165,hint,SIP/5863165
exten => 60,hint,SIP/60
exten => 61,hint,SIP/61
exten => 62,hint,SIP/62
exten => 63,hint,SIP/63
exten => 64,hint,SIP/64
exten => 65,hint,SIP/65
exten => 66,hint,SIP/66
exten => 67,hint,SIP/67
exten => 68,hint,SIP/68
exten => 69,hint,SIP/69
exten => 70,hint,SIP/70
exten => 71,hint,SIP/71
exten => 73,hint,SIP/73
exten => 78,hint,SIP/78
exten => 80,hint,SIP/80
exten => 82,hint,SIP/82
exten => 92,hint,SIP/92
exten => 95,hint,SIP/95
[frontdesk]
; casovne preusmeritve
;exten => s,1,GotoIfTime(*,sat,*,*?vm)
;exten => s,n,GotoIfTime(*,sun,*,*?vm)
;exten => s,n,GotoIfTime(00:00-06:59,*,*,*?frontdesk,closed,1)
;exten => s,n,GotoIfTime(18:00-23:59,*,*,*?frontdesk,closed,1)
;exten => s,n,GotoIfTime(07:00-09:00,*,*,*?frontdesk,earlyhours,1)
;exten => s,n,Goto(frontdesk,queue,1)
;Preusmeritev Petra
exten => closed,1,Dial(SIP/portech/041777777)
exten => closed,n,Hangup()
Thank you for assistance !
Jan
--
Jan Prunk
http://www.prunk.si
0x00E80E86 - http://pgp.mit.edu
More information about the asterisk-users
mailing list