From 87efcab7f57b7e99e71f8fb58bda5ebbb8175a07 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 8 Dec 2020 21:09:17 +0000 Subject: [PATCH] working callerid --- extensions.conf | 177 +++++++----------------------------------------- 1 file changed, 26 insertions(+), 151 deletions(-) diff --git a/extensions.conf b/extensions.conf index 28d84ac..3cbc27c 100644 --- a/extensions.conf +++ b/extensions.conf @@ -362,48 +362,6 @@ ignorepat => 9 include => local include => trunkld -[local] -; -; Master context for local, toll-free, and iaxtel calls only -; -ignorepat => 9 -include => default -include => trunklocal -include => iaxtel700 -include => trunktollfree -include => iaxprovider - -;Include parkedcalls (or the context you define in features conf) -;to enable call parking. -include => parkedcalls -; -; You can use an alternative switch type as well, to resolve -; extensions that are not known here, for example with remote -; IAX switching you transparently get access to the remote -; Asterisk PBX -; -; switch => IAX2/user:password@bigserver/local -; -; An "lswitch" is like a switch but is literal, in that -; variable substitution is not performed at load time -; but is passed to the switch directly (presumably to -; be substituted in the switch routine itself) -; -; lswitch => Loopback/12${EXTEN}@othercontext -; -; An "eswitch" is like a switch but the evaluation of -; variable substitution is performed at runtime before -; being passed to the switch routine. -; -; eswitch => IAX2/context@${CURSERVER} - -; The following two contexts are a template to enable the ability to dial -; ISN numbers. For more information about what an ISN number is, please see -; http://www.freenum.org. -; -; This is the dialing hook. use: -; include => outbound-freenum - [outbound-freenum] ; We'll add more digits as needed. The purpose is to dial things ; like extension numbers at domains (ITAD number) so we're matching @@ -470,24 +428,24 @@ exten => _s-.,1,NoOp ; variable on top of an existing variable, and its value will revert to its ; previous value (before being declared as LOCAL()) upon Return. ; -exten => _X.,50000(stdexten),NoOp(Start stdexten) -exten => _X.,n,Set(LOCAL(ext)=${EXTEN}) -exten => _X.,n,Set(LOCAL(dev)=${ARG1}) -exten => _X.,n,Set(LOCAL(cntx)=${ARG2}) -exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})}) -exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum -exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) - -exten => stdexten-NOANSWER,1,VoiceMail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce -exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start - -exten => stdexten-BUSY,1,VoiceMail(${mbx},b) ; If busy, send to voicemail w/ busy announce -exten => stdexten-BUSY,n,Return() ; If they press #, return to start - -exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer - -exten => a,1,VoiceMailMain(${mbx}) ; If they press *, send the user into VoicemailMain -exten => a,n,Return() +;exten => _X.,50000(stdexten),NoOp(Start stdexten) +;exten => _X.,n,Set(LOCAL(ext)=${EXTEN}) +;exten => _X.,n,Set(LOCAL(dev)=${ARG1}) +;exten => _X.,n,Set(LOCAL(cntx)=${ARG2}) +;exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})}) +;exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum +;exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) +; +;exten => stdexten-NOANSWER,1,VoiceMail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce +;exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start +; +;exten => stdexten-BUSY,1,VoiceMail(${mbx},b) ; If busy, send to voicemail w/ busy announce +;exten => stdexten-BUSY,n,Return() ; If they press #, return to start +; +;exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer +; +;exten => a,1,VoiceMailMain(${mbx}) ; If they press *, send the user into VoicemailMain +;exten => a,n,Return() [stdPrivacyexten] ; @@ -546,96 +504,6 @@ exten => s,n,Dial(${ARG1}) exten => s,n(fail),Hangup() -[demo] -include => stdexten -; -; We start with what to do when a call first comes in. -; -exten => s,1,Wait(1) ; Wait a second, just for fun -exten => s,n,Answer() ; Answer the line -exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds -exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds -exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message -exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions -exten => s,n,WaitExten() ; Wait for an extension to be dialed. - -exten => 2,1,BackGround(demo-moreinfo) ; Give some more information. -exten => 2,n,Goto(s,instruct) - -exten => 3,1,Set(CHANNEL(language)=fr) ; Set language to french -exten => 3,n,Goto(s,restart) ; Start with the congratulations - -exten => 1000,1,Goto(default,s,1) -; -; We also create an example user, 1234, who is on the console and has -; voicemail, etc. -; -exten => 1234,1,Playback(transfer,skip) ; "Please hold while..." - ; (but skip if channel is not up) -exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)})) -exten => 1234,n,Goto(default,s,1) ; exited Voicemail - -exten => 1235,1,VoiceMail(1234,u) ; Right to voicemail - -exten => 1236,1,Dial(Console/dsp) ; Ring forever -exten => 1236,n,VoiceMail(1234,b) ; Unless busy - -; -; # for when they're done with the demo -; -exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo" -exten => #,n,Hangup() ; Hang them up. - -; -; A timeout and "invalid extension rule" -; -exten => t,1,Goto(#,1) ; If they take too long, give up -exten => i,1,Playback(invalid) ; "That's not valid, try again" - -; -; Create an extension, 500, for dialing the -; Asterisk demo. -; -exten => 500,1,Playback(demo-abouttotry) ; Let them know what's going on -exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo -exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site -exten => 500,n,Goto(s,6) ; Return to the start over message. - -; -; Create an extension, 600, for evaluating echo latency. -; -exten => 600,1,Playback(demo-echotest) ; Let them know what's going on -exten => 600,n,Echo() ; Do the echo test -exten => 600,n,Playback(demo-echodone) ; Let them know it's over -exten => 600,n,Goto(s,6) ; Start over - -; -; You can use the Macro Page to intercom a individual user -exten => 76245,1,Macro(page,SIP/Grandstream1) -; or if your peernames are the same as extensions -exten => _7XXX,1,Macro(page,SIP/${EXTEN}) -; -; -; System Wide Page at extension 7999 -; -exten => 7999,1,Set(TIMEOUT(absolute)=60) -exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d) - -; Give voicemail at extension 8500 -; -exten => 8500,1,VoiceMailMain() -exten => 8500,n,Goto(s,6) -; -; Here's what a phone entry would look like (IXJ for example) -; -;exten => 1265,1,Dial(Phone/phone0,15) -;exten => 1265,n,Goto(s,5) - -; -; The page context calls up the page macro that sets variables needed for auto-answer -; It is in is own context to make calling it from the Page() application as simple as -; Local/{peername}@page -; [page] exten => _X.,1,Macro(page,SIP/${EXTEN}) @@ -672,7 +540,7 @@ exten => _X.,1,Macro(page,SIP/${EXTEN}) ; By default we include the demo. In a production system, you ; probably don't want to have the demo there. ; -include => demo +;include => demo ; ; An extension like the one below can be used for FWD, Nikotel, sipgate etc. @@ -872,3 +740,10 @@ same => n,Playback(vm-goodbye) same => n,Hangup() [local] +exten => _2X,1,Dial(SIP/${EXTEN}) + +exten => _0X.,1,Goto(to-eventphone,${EXTEN:1},1) + +[to-eventphone] +exten => _X.,1,SET(CALLERID(all)="Teleshop" <7467>) +same => n,Dial(SIP/${EXTEN}@eventphone)