terça-feira, junho 29, 2010

How to reset your Nokia?

How to reset your Nokia?

Hard and soft reset 3buttons and reset code.


How to reset your Nokia?

* Soft Reset
* Hard Reset
* Reset a Nokia 5800
* Reset a Nokia N97



Your Nokia phone isn't working properly or not responding quickly.Below are tips on how to reset your Nokia Mobile phones:
Soft Reset

Soft Reset will clear pending errors and bring your mobile to an initial state by restoring Factory setting. To operate this function on your mobile, the shortcut is: *#7380#

This function apparently works on almost all nokia mobile phones.
Hard Reset

It may happen that despite you have restored your mobile to factory setting, the error still exist. In this case, it is recommended that you opt for Hard reset

* Enter the code: *#7370# and press Yes to confirm initialization.
o Important Notice: It is recommended that you save all important information on your phone (e.g: memo, contacts etc)
* To make a Hard Reset on a Nokia phone that is not willing to turn on, just press simultaneously these 3 buttons:
* on/off + * + 3
o Before making a Hard reset better backup all your important information: contacts , memo...etc


Reset a Nokia 5800

Press simultaneously the 4 button:

* Green button
* Red button
* Camera button
* On/off button





If you perform properly the above manipulation the phone restarts and you must enter the time, date ...
Reset a Nokia N97

If your Nokia n97 freezes at startup, and the nokia logo is displayed,

* You can reset your N97 while pressing the 4 buttons describe above:
* Power button
* Space key
* Delete key (left arrow logo)
* Caps /shift button (up arrow logo)





The Nokia logo appears and then after a few moments you will be asked to configure your phone: country ....

domingo, junho 27, 2010

Entendendo o arquivo extensions.conf

Variável exten

É indispensável dentro de uma regra de discagem, vou dar um exemplo de uma regra de discagem manual, muito utilizada em empresas.

[locais]
exten => _0XXXXXXXX,1,Noop(==> Ligação local manual)
exten => _0XXXXXXXX,n,Dial(${GVT}${EXTEN:1})

Vamos explicar, exten é a variável padrão para regras de discagem, sempre que for criado um plano de discagem, criar uma situação para a discagem de um número, será usado exten => (tal número) (instruções). No exemplo a variável exten está recebendo o dígito 0 mais 8 dígitos quaisquer, o X significa qualquer dígito de 0 a 9, temos outras opções como:

Z= 1 a 9

N= 2 a 9

Está caracterizado um plano muito usado, 0 para sair e o número desejado, sendo uma ligação local, bastam só os 8 dígitos possíveis. Vamos ao próximo passo 0XXXXXXXX,1, este 1 significa que será a primeira coisa a ser executada ao cair em um contexto. Vou explicar o que é um contexto, no início temos isto [locais], este é o nome do contexto, mas para quê usar um contexto?

Este contexto limita-se apenas a ligações locais, então há uma tag com o nome context, quando você cria um ramal, se por exemplo vocês colocarem os ramais dos estagiários dentro do contexto locais, eles somente discarão o que está no mesmo, é como se fosse algo parecido com grupos e usuários.

Voltando ao 0XXXXXXXX,1,Noop(==> Ligação local manual), 1 é a primeira prioridade, o que executará primeiro, Noop imprime uma mensagem no CLI do Asterisk.


O cli do Asterisk


Este é um exemplo de CLI do Asterisk
Desculpem por editar a imagem, é que não poderia mostrar o nome do servidor Asterisk nem o conteúdo do Outlook aberto atrás. Aqui está sendo utilizado o putty, cliente ssh para Windows, pois necessitava na ocasião da utilização de mais alguns softwares para Windows. O softphone usado na figura é o sjphone, é o meu softphone favorito, há versões para Windows e Linux, mas também há muitos outros bons softphones.

Como mostrado anteriormente, estávamos em uma variável chamada Noop, o cli do Asterisk é como se fosse um de um roteador, como um da cisco por exemplo. Digitando asterisk -r no shell você entrará no modo de comando do Asterisk, aonde poderá usar comandos do próprio Asterisk para verificar erros, fazer análises, derrubar ramais e outras funções. Nele aparecerá está mensagem Noop (e a mensagem configurada no extension).

Alguns comandos primordiais serão listados abaixo com uma breve explicação.

extension reload = após executar alguma modificação no arquivo extensions.conf, para que as mesmas entre em vigor é necessário digitar isto no cli do Asterisk para recarregar o arquivo.

sip reload = o mesmo que extensions reload, porém ao arquivo sip.conf.

iax2reload = o mesmo que extensions reload, porém ao arquivo iax.conf.

sip show peer = mostra informação sobre um ramal, ex: sip show peer 2019

sip show peers = mostra informações sobre todos os ramais existentes na configuração, se estão online/offline, qual ip está conectado ao ramal, se é dinâmico, estático, se esta atrás do nat.

dialplan show = mostra informações sobre o contexto selecionado. Ex: dialplan show adm

Existem muitos mais comandos úteis, mas estarei mostrando exemplos destes acima.


Exemplos

exten => 0XXXXXXXX,n,Dial(${GVT}${EXTEN:1})

A variável exten recebe novamente os mesmos números, esta é a logica do Asterisk, este contexto funcionará se um ramal associado a ele discar de 0 e 8 dígitos, então ele executará. No segundo passo é apresentado o n, que significa próximo, em versões anteriores a 1.4 era necessário digitar em cada linha as prioridades 1,2,3,4 e assim sucessivamente. Agora você diz aonde vai iniciar e o resto ele faz automático, muito útil, no caso de adicionar ou remover alguma linha, basta adicionar e pronto, o n e automático, antes teria que checar todas as prioridades.

Variável Dial, que significa discar, mas discar o que? Isto, (${GVT}${EXTEN:1}), esta variável ${GVT} é uma variável definida pelo programador do Asterisk na sessão global, estaria assim GVT=zap/r2 por exemplo, o canal que executa ligações para gvt discará por este canal, a variável EXTEN, cujo é 0XXXXXXXX, os :1(EXTEN:1), é para formatar como o número sairá pelo canal, a rede de telefonia pública, tratando de uma ligação local, é necessário que saia somente o número "limpo", sem o zero, então o :1 elimina o primeiro dígito, você pode utilizar :2, :4, o que for necessário, depende de sua regra.

Exemplo de contexto para DDD

Vamos passar para mais algumas funções e exemplos de regras:

[DDD]
exten => _00XX[2-6]XXXXXXX,1,Noop(==> DDD telefone fixo)
exten => _00XX[2-6]XXXXXXX,n,ChansAvail(${GVT})
exten => _00XX[2-6]XXXXXXX,n,GotoIf($["${AVAILSTATUS}" = "34" ] ?2)
exten => _00XX[2-6]XXXXXXX,n,Dial(${GVT}0${OP-GVT}${EXTEN:2}||Tt)
exten => _00XX[2-6]XXXXXXX,n,Hangup

exten => _00XX[2-6]XXXXXXX,102,Noop(==> Transbordo)
exten => _00XX[2-6]XXXXXXX,n,ChansAvail(${GVT})
exten => _00XX[2-6]XXXXXXX,n,Dial(${TRANSIT}0${OP-TRANSIT}${EXTEN:2}||Tt)
exten => _00XX[2-6]XXXXXXX,n,Hangup

Vamos a explicação:

[DDD] = nome do contexto, para ligações DDD

exten => _00XX[2-6]XXXXXXX,1,Noop(==> DDD telefone fixo), quando for discado 00+ DDD + dígito de 2 a 6, dígitos que abrangem números de telefonia fixa, contexto não ligará para celulares, mais sete dígitos, pois já foi escolhido um de 2 a 6, a primeira prioridade, aparecerá a mensagem.

exten => _00XX[2-6]XXXXXXX,n,ChansAvail(${GVT}) = Avaliará o canal que está sendo ligado pela GVT.

exten => _00XX[2-6]XXXXXXX,n,GotoIf($["${AVAILSTATUS}" = "34" ] ?102) = função GotoIf, muito utilizada para transbordo, faz o seguinte, verifica se a variável availstatus, que é bem parecida com o próprio nome, possui a função de avaliar o canal, se possuir o código 34, este código é um código ISUP, código padrão mundial de telefonia, podem pesquisar na web pelo mesmo. O código 34 significa todos canais ocupados, então ele não poderá ligar pela gvt se tais tiverem ocupados, assim ele executara a prioridade 102, que será mostrada adiante, aonde começará o transbordo, se não for 34, por ter canal disponível para discar, então passará ao próximo passo.

exten => _00XX[2-6]XXXXXXX,n,Dial(${GVT}0${OP-GVT}${EXTEN:2}||Tt) = efetua a ligação usando o canal GVT, aqui está a diferença por ser um DDD, cujo de um telefone convencional deveríamos discar, 0(código da operadora) + (DDD) + (número), este 0 após op-gvt ficará nesta posição 00 0 (aqui) XX, necessário, pois se discando 0 e mais número liga local, então discando 00 +número liga DDD, o exten:2 corta os dois primeiros números, portando a ligação sairá 0 ${OP-GVT}, definida na seção globals, variável recebe o número da operadora gvt+ XX, DDD de algum lugar do pais, e o número.

exten => _00XX[2-6]XXXXXXX,n,Hangup= hangup encerra a ligação(desliga).

Funções com transbordo:

exten => _00XX[2-6]XXXXXXX,102,Noop(==> Transbordo)
exten => _00XX[2-6]XXXXXXX,n,ChansAvail(${EMBRATEL})
exten => _00XX[2-6]XXXXXXX,n,Dial(${EMBRATEL}0${OP-EMBRATEL}${EXTEN:2}||Tt)
exten => _00XX[2-6]XXXXXXX,n,Hangup

Note que após o número que a variável exten recebe temos 102, o número que estava no GotoIf, se estiver ocupado, faz isto a prioridade 102, após cair nela executará o passo abaixo com os números N, no exemplo discaria pela Embratel, se a gvt estivesse ocupada, quem cria a regra deve associar a custos e tarifas, ver qual é mais em conta.

Este foi meu primeiro artigo, não sou muito bom escrevendo, pretendo aprimorar mais isto, espero que gostem. Em breve posto mais algum material sobre Asterisk, só havia visto artigos aqui no VOL ensinando a criar ramais, instalação do Asterisk, mas nada explicando estas variáveis, passando uma visão melhor do extensions.conf.

Fica aí o artigo e um obrigado ao VOL, por onde venho apreendendo muito sobre Linux.

Asterisk simple steps to instal

Installation

Install asterisk from the AUR.
You may also want to install asterisk-addons, asterisk-sounds and zaptel. You will also need a SIP soft-phone and at least two machines. Recommendations for SIP phones are kphone, in the AUR and x-lite, a binary package.

Configuration

SIP

Assuming your asterisk server is up and running, we will only need to edit two files: sip.conf and extensions.conf. Change to your asterisk configuration directory (should be /etc/asterisk). Edit sip.conf and place the following:
[me1]
type=friend
username=me1
secret=PASSWORD
host=dynamic
context=house

[me2]
type=friend
username=me2
secret=PASSWORD
host=dynamic
context=house
This creates our two SIP users me1 and me2 with a password of PASSWORD in the house context.
We will be defining the context next -- edit extensions.conf with the following:
[house]
exten => 100,1,Dial(SIP/me1)

exten => 101,1,Dial(SIP/me2)
This creates the context house and assigns extension 100 to the SIP user me1, and extension 101 to the SIP user me2. Now all thats left is to see if it works.

Music On Hold

Music on hold is a really sweet feature. And once again easy to install and configure. Edit /etc/asterisk/musiconhold.conf and add, or make sure it is uncommented:
[default]
mode=files
directory=/var/lib/asterisk/mohmp3
Now go into your sip.conf
musiconhold=default
And that is all there is to it. Just copy your favorite legally obtained MP3 to /var/lib/asterisk/mohmp3.

Voicemail

Voicemail is another feature of asterisk. There are many ways to configure it, however this article only covers a simple approach.
Create/edit your voicemail.conf:
[general]
format=gsm|wav49|wav
serveremail=asterisk
attach=no
mailcmd=/usr/sbin/sendmail -t
maxmessage=180
maxgreet=60

[default]
100 => 1234,Me,me@mydomain.com
What does this mean? Most of the [general] is pretty self-explanatory. However, do note that if you have postfix set up right the PBX will send an email notifying the user of a new voice-mail and if {{{1}}} is defined it will attach the file.
Now for the actual mailbox. The format is:
mailbox => password,user,email
In this case, we gave 'Me' (email me@mydomain.com) mailbox 100, with a password of 1234.
Now we have to have a way to leave messages to this voice-mail, and a way to access it. For this, we go back to the extensions.conf and modify your existing entry as follows:
exten => 100,1,Dial(SIP/me1,20)
exten =>100,2,Voicemail(100@default)
The 20 on the end of the first 'exten' tells 'Dial()' to call for 20 seconds. If no one answers it heads to voice-mail box 100 in the default context.
Next is actually accessing your voicemail. For this we add:
exten => 600,1,VoiceMailMain,s100@default
So when we call 600, the application 'VoiceMailMain' goes to 100 in the default context. The s allows for automatic login.
Note: The 'VoiceMail' applications have a significant amount of options, so it is suggested reading over some additional documentation. This is just for a basic, home use setup. Also note that it is generally a good idea to use extensions higher then your users extensions for accessing 'VoiceMail'. This way someone dialing 208 does not hit someone's voice-mail at 205.

Connecting To The PSTN

Now that you have the previous setup, it is time to actually connect to the outside world. To do this, you will need a provider such as Junction Networks. Your provider should have instructions on connecting to asterisk, so this section is very general.

General Set-up

sip.conf
[general]
register => username:password@sip.specific.com

[whatever]                   
fromdomain=specific.com     
host=sip.specific.com
insecure=very    ; check with provider
username=usernameduh
secret=passwordduh
type=peer
extenstions.conf
[outboundwithCID]  ; this can be whatever
exten => _1NXXNXXXXXX,1,SetCIDNum(15555551234)
exten => _1NXXNXXXXXX,2,Dial(SIP/${EXTEN}@whatever)
exten => _1NXXNXXXXXX,3,Congestion()
exten => _1NXXNXXXXXX,103,Busy()


[default]  ; This should be set in your sip.conf for incoming calls

;These should to be changed to your actual number
; ie     15555555555
exten => 1NXXNXXXXXX,1,Answer()
exten => 1NXXNXXXXXX,2,Playback(ttt-weasels)
exten => 1NXXNXXXXXX,3,HangUp()
  • In the outbound context, any number dialed will be sent out to your service provider. The 'whatever' in the 2 priority should match what you have in your sip.conf.
  • Of course, the inbound dial-plan can be modified to do what you want. For instance, you can have Dial(SIP/me1) so when someone calls your number they are routed to your SIP phone on your computer. Then add in voice-mail and so on.

FWD

FWD is one of the most popular VOIP services. It is similar to AIM, where everyone gets a screen name (FWD number) and can communicate on the network. Pairing FWD with ipkall allows free incoming calls.
iax.conf
The first step is to log into FWD and enable their side of IAX. It is under extra features, and keep in mind that the authors claim it takes a little while to activate.
Now edit your iax.conf with the following in the 'general' section:
register => FWDNUMBER:PASSWORD@iax2.fwdnet.net 
disallow = all
allow = ulaw
And at the bottom add:
[iaxfwd]
type=user
context=fromiaxfwd
auth=rsa
inkeys=freeworlddialup
This allows calls from FWD.
extensions.conf
Place this at the top under '[globals]':
FWDNUMBER=MYFWDNUMBER ; your calling number
FWDCIDNAME="MyName"; your caller id
FWDPASSWORD=MYFWDPASSWORD ; your password
FWDRINGS=sip/office ; the phone to ring
FWDVMBOX=1000 ; the VM box for this user
Next, add this to a context for outgoing:
exten => _393.,1,SetCallerId,${FWDCIDNAME}
exten => _393.,2,Dial(IAX2/${FWDNUMBER}:${FWDPASSWORD}@iax2.fwdnet.net/${EXTEN:3},60,r)
exten => _393.,3,Congestion
You can change the '393' to whatever you want. This is what you will dial before dialing a 'fwd' number. For instance, to dial '744561' you would dial '393744561'.
And lastly, the incoming calls:
[fromiaxfwd]
exten => ${FWDNUMBER},1,Dial(${FWDRINGS},20,r)
exten => ${FWDNUMBER},2,Voicemail,u${FWDVMBOX}
exten => ${FWDNUMBER},102,Voicemail,b${FWDVMBOX}
Note: If you have problems try removing the variables from extensions.conf. These instructions are from FWD's site and I have not been tested by this article's author.
Extensions to try calling are 55555 (a volunteer maned test line) and 514 (conference).

MeetMe

MeetMe is the application that allows you to do conference calling. Same as everything, basic setup is easy.
Edit meetme.conf:
conf => 1000
Next is extensions.conf
exten => 999,1,MeetMe(1000|M)
Now dial 999 to get into conference 1000. The enables music on hold if no one is in there. It will automatically go away when someone joins the conference.
Note: You must have the zaptel package in order for MeetMe to work. Install it and run modprobe ztdummy before running asterisk. This provides digium timing for us without cards so we can utilize TDM.

Asterisk Console And Softphones

Now lets get Asterisk going:
# asterisk -vvvvvvc
This will give us the Asterisk CLI with verbose output. If Asterisk is already running you will need to use:
# asterisk -r
Now fire up your SIP clients and set them up with the information in the sip.conf. Switch back to your Asterisk CLI and you should see:
Registered SIP 'me1' at 192.168.0.142 port 5061 expires 60
Now you should be able to dial 101 from me1 and talk to me2.

Trouble-shooting

If you receive a 404 Not Found error check your extensions.conf and the number you dialed.

quinta-feira, junho 24, 2010

Using SIP with Nokia Series60 and Asterisk | NewLC

Using SIP with Nokia Series60 and Asterisk | NewLC

Those instructions bellow worked with Nokia 5800 +sip

This article is using the open source PBX Asterisk to setup a SIP account properly on the Nokia E60. Therefore the configuration for different SIP servers may be similiar. This article is referring to the howto from nextmobile.

Create a new sip account on the asterisk

Add following setting to sip.conf (the username "44" is just used for example !):

username=44
type=friend
secret=just4fun
qualify=no
port=5060
notransfer=yes
host=dynamic
context=from-internal
disallow=all
allow=alaw

SIP realm

The realm for digest authentication defaults to "asterisk". Otherwise please verify your active realm in sip.conf.

Nokia E60 settings

Navigate to Tools->Settings->Connection->SIP settings.

Open the Options menu and select Add new->Use default profile:

Profile name: to be defined
Service profile: IETF
Default access point: your wifi access point
Public user name: sip:SIP user @domain or IP address
Use compression: No
Regristration: Always on
Use security: No

Proxy server:

Proxy server address: sip:IP address of your asterisk
Realm: asterisk (or realm of your asterisk)
User name: SIP user
Password: secret
Allow loose routing: Yes
Transport type: UDP
Port: 5060

Registrar server:

Registrar serv.addr.: sip:Asterisk
Realm: -
User name: -
Password: -
Transport type: UDP
Port: 5060

Now, navigate to Tools->Settings->Connection->Internet tel.settings: and create a New profile in the Options menu with the following settings:

Name: Default
SIP profiles: previously defined profile

Default call type

To switch between normal GSM calls or VOIP calls, navigate to Tools->Settings->Call->Default call type.

Select Cellular to make normal calls to the phone number or Internet to use VoIP to call the number or address.

Asterisk Dialplan Patterns - voip-info.org

Asterisk Dialplan Patterns - voip-info.org

Asterisk Dialplan Patterns

Extension Names and Patterns

Extension Names


Dialplan extensions can be simple numbers like "412" or "0". They can be alphanumeric names like "john" or "A93*". Although a typical telephone can't dial an extension called "john" (some can though), often your Dialplan logic will involve jumping from one extension to a different extension, and for those jumps you may define exension names with any name you like, as you don't wish them to be dialed directly.

Of course, touchtone telephones don't just have the digits 0 through 9, they also have * (star) and # ("pound" or "hash", depending on where in the world you live). And some touchtone (DTMF) telephones have the extra four "digits", A, B, C and D. If you have such handsets within your organization, there's nothing stopping you making use of those extra buttons for some special purpose of your own.

Note: To have an extension that is triggered by dialing the # symbol, you must use an extension pattern (see below). Asterisk does not recognize # as an ordinary 'digit', even though it appears on all DTMF telephones.

"Why do people in the US call the # symbol pound?" It doesn't seem to have anything to do with either money (e.g. the UK Pound Sterling) or with weight (lb).
Answer: Pound Sign

Extension Patterns


Extension names are not limited to single specific extension "numbers". A single extension can also match patterns. In the extensions.conf file, an extension name is a pattern if it starts with the underscore symbol (_). In an extension pattern, the following characters have special meanings:

Special Characters for Pattern Matching


X matches any digit from 0-9
Z matches any digit from 1-9
N matches any digit from 2-9
[1237-9] matches any digit or letter in the brackets
(in this example, 1,2,3,7,8,9)
[a-z] matches any lower case letter (introduced in which Asterisk version?)
[A-Z] matches any UPPER case letter (introduced in which Asterisk version?)
. wildcard, matches one or more characters
! wildcard, matches zero or more characters immediately
(only Asterisk 1.2 and later, see note)


Note: The exclamation mark wildcard, which is available only in Asterisk 1.2 and later, behaves specially — it will match as soon as can without waiting for the dialling to complete, but it will not match until it is unambiguous, and the number being dialled cannot match any other extension in the context. It was designed for use as follows, so that as soon as the digits dialled don't match '001800...' the outgoing telephone line will be picked up and overlap dialling will be used (with full audio feedback from 'earlyb3' etc.)

Context "outgoing":
Extension Description
_001800NXXXXXX Calls to USA toll-free numbers made by VoIP
_X! Other calls via normal telco, with overlap dial.

Example

Consider the following context:

Context "routing":
Extension Description
_61XX Dallas Office
_63XX Dallas Office
_62XX Huntsville Office
_7[1-3]XX San Jose Office
_7[04-9]XX Los Angeles Office

This context, given the name "routing", sends calls to various servers according to their extension. This organization has decided that all of their telephone extensions will be 4 digits long. If a user dials an extension beginning with 61 or 63, it would be sent to the Dallas office; 62 would go to the Huntsville office; anything starting with 71, 72, or 73 would go to San Jose, and anything starting with 70, 74, 75, 76, 77, 78 or 79 would go to the Los Angeles office.

More Example Patterns


_NXXXXXX matches a NANP 7 digit telephone number such as 555-1212
_1NXXNXXXXXX matches an area code and phone number preceeded by a one such as 1-860-555-1212
_9011. matches any string of at least five characters that starts with 9011,
but it does not match the four-character string 9011 itself.
_9011! matches 9011 too
_# matches a single # keypress

Warning


Do not use a pattern of _. as this will match everything including Asterisk special extensions like i, t, h, etc. Instead use something like _X. or _X which will not match __special__ extensions..

So what do you use instead of _. ? Many examples use this construct, but if you use it you may see a warning message in the log advising you to change _. to _X. But simply replacing _. with _X. doesn't always work, depending on the extension coming into the context. Usually ONE of the following will work in Asterisk 1.2 and later:

_X! matches any numeric pattern of one or more digits (but not * or #)
_[*#0-9]! same as previous entry but also includes * and # characters
_[*0-9]! same as the previous entry except excludes the # character
s if there is no pattern at all, then using s will often match

The s pattern can be useful for incoming calls where no DID is available and in certain other situations where the extension matches nothing.

Or, you can use a user defined pattern. Let's say you are jumping from one context to another and there is no particular reason to use a numeric pattern. You could use a statement like Goto(voicemail,s,1) and then use the s extension in the target context, which is perfectly valid. But, if you want to make your dial plan a little more readable (or for some other reason don't want to use s), you could instead do Goto(voicemail,vm,1) and then in the voicemail context actually use the vm extension, like this:

[voicemail]
exten => vm,1,NoOp(Entering Voicemail Context)
.....

If, for some reason, you simply must use _. temporarily because nothing else will work, then turn on debugging and watch the CLI while a call is passing through that context, so you can see what the actual extension is. Then rewrite the context to either use that extension directly in place of _. or use a pattern that will catch that extension. As a last resort, if you don't need to preserve the extension, you may be able to use two contexts to get rid of the ambiguity (which still has some risk, but limits the time of exposure):

[unknownextension]
exten => _.,1,Goto(itmatches,s,1)
.....
[itmatches]
exten => s,1,NoOp(Now using s extension)
.....

Example URI dialing

[uri]
exten => _[a-z].,1,Macro(uridial,${EXTEN}@${SIPDOMAIN})
exten => _[A-Z].,1,Macro(uridial,${EXTEN}@${SIPDOMAIN})
exten => _X.,1,Macro(uridial,${EXTEN}@${SIPDOMAIN})

Now add the macro below into the extensions.conf in the area where you have your other macros defined:

[macro-uridial]
exten => s,1,NoOp(Calling remote SIP peer ${ARG1})
exten => s,n,Dial(SIP/${ARG1},120,tr)
exten => s,n,Congestion()

Asterisk splits everything past the “@” in the call and makes an ${EXTEN} variable and a ${SIPDOMAIN} variable. If we match an lowercase alpha character in the ${EXTEN} then we simply just dial the EXTEN@SIPDOMAIN and away you go!

Sort Order

If more than one pattern matches a dialed number, Asterisk may not use the one you expect. See:


See also

Hints on Route Dial Patterns and Trunk Dial Rules | FreePBX

Hints on Route Dial Patterns and Trunk Dial Rules | FreePBX

quarta-feira, junho 23, 2010

Fun Numbers - Ekiga

Fun Numbers - Ekiga

Ekiga.net numbers

Ekiga's numbers
SIPNumber Description
sip:500@ekiga.net Echo test, supports video (H264, H263-1998, H261 only), as well as audio (PCMA only) - the sound is low quality
sip:520@ekiga.net Call-me test (call, hangup, and you will be called right afterwards), supports audio only
sip:501@ekiga.net Public conference room from Ekiga.net
sip:501xxxx@ekiga.net These rooms are public or private, anyone can join a conference at any time if he choose the right number or you can protect the access with a PIN number.
sip:5011122@ekiga.net french conference room 1122
  • where x = any digits from 0 to 9.
  • When using the conference rooms (501xxxx) you'll be asked for a "PIN number". The first person to enter a 'room' may specify a PIN by entering a number (followed by #) to limit access to the conference room, just entering # will make this conference room public. When the last person leaves a conference room, the PIN will be cancelled and others may use the 'room'.

Fully Tested Numbers

Toll free numbers accessible from Ekiga.net
Prefix-SIPnumber Service / provider
sip:*010600@ekiga.net Echo test from Voxalot (USA)
sip:*031600@ekiga.net Echo test from Voxalot (Europe)
sip:*061600@ekiga.net Echo test from Voxalot (Australia)
sip:*0131800xxxxxxx@ekiga.net US 800 Toll Free Numbers using SIPBroker ENUM Server, Search USA Toll Free numbers
sip:*01349800xxxxxxx@ekiga.net Germany Toll Free Numbers using SIPBroker ENUM Server.
sip:*013352800xxxxx@ekiga.net Luxembourg Toll Free Numbers using SIPBroker ENUM Server.
sip:*01388299000199xxx@ekiga.net e164.org's public voice conference rooms (000 through 999 are the conf numbers)
sip:*01317853950049@ekiga.net Kansas State University Test Phone Number
sip:*201511@ekiga.net VoIP.Brujula.net's conference room (51112 creates a new room #12)
sip:*201393613@ekiga.net VoIP.Brujula.net's echo test (forward to FWD?)
sip:*2011800xxxxxxx@ekiga.net Toll Free 800 numbers in USA 800 Directory
sip:*248333@ekiga.net Wengo's echo test (France)
sip:*248335@ekiga.net Wengo's video echo test (H263 + PCMU/PCMA)
sip:*266300@ekiga.net Blueface Monkey sounds (Ireland)
sip:*266301@ekiga.net Blueface echo test (Ireland)
sip:*266303@ekiga.net Blueface speaking clock (Ireland)
sip:*266305@ekiga.net Blueface Music (Ireland)
sip:*318613@ekiga.net Ixcall echo test
sip:*318411@ekiga.net Tell me ixcall.net (speech recognition)
sip:*393613@ekiga.net FreeWorldDialup's echo test
sip:*393*31800xxxxxxx@ekiga.net Netherlands toll-free numbers from FreeWorldDialup
sip:*393*47800xxxxx@ekiga.net Norway toll-free numbers from FreeWorldDialup
sip:*673500@ekiga.net Echo test from Ekiga.net
sip:*74717475552663@ekiga.net Free Conference Call
sip:*7471101301@ekiga.net Echo test from Gizmo Project
sip:*74712220000000@ekiga.net SipPhone Party Line
sip:*773505741837999@ekiga.net Prato City Hall's echo test (Italy)
sip:*850301@ekiga.net Idea SIP's echo test
sip:*850100xxxxxxx@ekiga.net Idea SIP's conference call
sip:*850**12345@ekiga.net Idea SIP's weird voice mail message
sip:*8508355@ekiga.net Tell me ideasip
sip:*8501800xxxxxxx@ekiga.net US 800 Toll Free Numbers ideasip.com Search USA Toll Free numbers
sip:*011188888@ekiga.net SipBroker Test announcement
sip:*201613@ekiga.net voip.brujula.net echo test
sip:*201411@ekiga.net Google 1-800-GOOG-411 Free 411 service (voip.brujula.net) Speech recognition to search and connect business
sip:*201393514@ekiga.net Coffee House (conference room, voip.brujula.net)
  • x = any digits from 0 to 9.
  • do not dial/type the - character ;)
  • in case of multiple VoIP accounts saved in Ekiga (the software), add @ekiga.net suffix to these toll free numbers to place a call using Ekiga.net service.

Non working SIP Numbers

Toll free numbers
Prefix-SIPnumber Description Test Date Result
sip:*01316049586111@ekiga.net e164.org's caller ID read back 2007-01-11 Busy tone (twen)
sip:*01316049580001@ekiga.net e164.org's TCP/IP ping utility 2007-01-11 Busy tone (twen)
sip:*01316049581212@ekiga.net e164.org's experimental directory service 2007-01-11 Busy tone (twen)

Other Fun number Pages

Reload failed because retrieve_conf encountered an error: 126 | FreePBX

Reload failed because retrieve_conf encountered an error: 126 | FreePBX
After install from scratch (tar.gz file), on a Fedora Core 11.

After getting the error above, the solution is bellow

chown asterisk:apache -R /var/lib/asterisk/
chown asterisk:apache -R /etc/asterisk/
chown asterisk:apache -R /etc/amportal.conf
chmod 770 -R /var/lib/asterisk/
chmod 775 -R /etc/asterisk/
chmod 770 -R /etc/amportal.conf


That should work, if not please visit the link above

Asterisk GUI

Installation | FreePBX
  • freePBX: Free/Open Source. Complete web-based configuration and management of Asterisk. Feature rich and quite popular among Asterisk users, included in the Trixbox (Asterisk@Home) distribution. Completely modular, and has a large online module repository to add various features. Integrates asterisk-stat from areski and the Flash Operator Panel. PHP/Perl-based. GPL

terça-feira, junho 22, 2010

Asterisk dial plan - working example - voip-info.org

Asterisk dial plan - working example - voip-info.org
Very good dialplan example.

[general]
;
;
;
static=yes
;
; if static=yes and writeprotect=no, you can save dialplan by
; CLI command 'save dialplan' too
;
writeprotect=no
;
;
[globals]
;
;*************************************************************
; BEGIN - Global variable definitions
;*************************************************************
;
;
; External dial tone access via Digium FXO ports
;
; ZAP Group 1, connected to Panasonic KSU CO 3/4
;
;
PANA=ZAP/g1 ; for use by SIP extensions so that they
; can dial internal Panasonic extensions
;
; ZAP Group 2, connected to Panasonic KSU CO 3/4
;
;
PSTN=ZAP/g2 ; for outbound analog pick up EXT 24 or 25
; remember to dial 9
;
;
; External dial tone via VoicePulse
;
IAXCO1=IAX2/user-name:pass-word@vpconnect-t01 ; Voicepulse host 1 outbound
IAXCO2=IAX2/user-name:pass-word@vpconnect-t02 ; Voicepulse host 2 outbound
IAXCID=9005551212
;
; External dial tone via BroadVoice
;
SIPCO1=@broadvoice ; Broadvoice host
SIPCID=9005551212
;
;
Usr1CIDNAME="User One" ; Usr1's caller ID name setting
Usr1VM=11@internal ; Usr1's voice mail box
Usr1CID=9005551212 ; Usr1's caller ID setting
Usr1EXTEN=11 ; Usr1's default extension
Usr1REM1=9005551212 ; Usr1's cell phone
Usr1REM2=9005551212 ; Usr1's office phone
Usr1NMFILE=custom/Usr1
;
Usr2CIDNAME="User Two" ; Usr2's caller ID name setting
Usr2VM=13@internal ; Usr2's voice mail box
Usr2CID=9005551212 ; Usr2's caller ID setting
Usr2EXTEN=13 ; Usr2's default extension
Usr2REM1=9005551212 ; Usr2's cell phone
Usr2REM2=
Usr2NMFILE=custom/Usr2
;
;
; Timeout periods in seconds
;
DEFTIMEOUT=30
VERYSHORTTIMEOUT=10
SHORTTIMEOUT=20
MEDTIMEOUT=40
LONGTIMEOUT=70
;
;
RINGINGLINE=foo
FOUNDME=foo
FLOWCONTROL=foo
FLOWCONFIRM=foo
ReturnTo=foo
FLOWPROCEED=foo
FLOWABORT=foo
CONFIRM=foo
;
; set the default point of contact
;
DEFCIDNAME=${Usr1CIDNAME}
DEFVM=${Usr1VM}
DEFCID=${Usr1CID}
DEFEXTEN=${Usr1EXTEN}
DEFREM1=${Usr1REM1}
DEFREM2=${Usr1REM2}
DEFNMFILE=${Usr1NMFILE}
;
NM=${DEFCIDNAME})
VM=${DEFVM})
ID=${DEFCID})
EXT=${DEFEXTEN})
REM1=${DEFREM1})
REM2=${DEFREM2})
NMFILE={DEFNMFILE})
;
;
; use these to transfer using hook flash transfer - tricky
;
PANAEXT11=11 ; Usr1's office
PANAEXT12=12 ; Usr1's bedroom
PANAEXT13=13 ; Usr2's bedroom
PANAEXT14=14 ; Usr3's bedroom
PANAEXT15=15 ; Usr4's bedroom
PANAEXT16=16 ; kitchen
PANAEXT17=17 ; family room
PANAEXT18=18 ; wireless
PANAEXT19=19 ; office 2
PANAEXT20=20
PANAEXT21=21
PANAEXT22=22
PANAEXT23=23
;
PAGE=34
;
;*************************************************************
; END - Global variable definitions
;*************************************************************
;
;
;*************************************************************
; BEGIN - Include contexts
;*************************************************************
;
;
[set-global-vars]
;
;
exten => _436,1,SetGlobalVar(NM=${Usr1CIDNAME})
exten => _436,2,SetGlobalVar(VM=${Usr1VM})
exten => _436,3,SetGlobalVar(ID=${Usr1CID})
exten => _436,4,SetGlobalVar(EXT=${Usr1EXTEN})
exten => _436,5,SetGlobalVar(REM1=${Usr1REM1})
exten => _436,6,SetGlobalVar(REM2=${Usr1REM2})
exten => _436,7,SetGlobalVar(NMFILE=${Usr1NMFILE})
exten => _436,8,Goto(s-CONFIRM,1)
;
exten => _427,1,SetGlobalVar(NM=${Usr1CIDNAME})
exten => _427,2,SetGlobalVar(VM=${Usr1VM})
exten => _427,3,SetGlobalVar(ID=${Usr1CID})
exten => _427,4,SetGlobalVar(EXT=${Usr1EXTEN})
exten => _427,5,SetGlobalVar(REM1=${Usr1REM1})
exten => _427,6,SetGlobalVar(REM2=${Usr1REM2})
exten => _427,7,SetGlobalVar(NMFILE=${Usr1NMFILE})
exten => _427,8,Goto(s-CONFIRM,1)
;
exten => _837,1,SetGlobalVar(NM=${Usr2CIDNAME})
exten => _837,2,SetGlobalVar(VM=${Usr2VM})
exten => _837,3,SetGlobalVar(ID=${Usr2CID})
exten => _837,4,SetGlobalVar(EXT=${Usr2EXTEN})
exten => _837,5,SetGlobalVar(REM1=${Usr2REM1})
exten => _837,6,SetGlobalVar(REM2=${Usr2REM2})
exten => _837,7,SetGlobalVar(NMFILE=${Usr2NMFILE})
exten => _837,8,Goto(s-CONFIRM,1)
;
;
;
exten => _XXX,1,Goto(s-INVALID,1)
;
;
[pana-trans]
;
; This context provides access to internal extensions
;
;
exten => _11,1,macro(pana-transfer,${PANAEXT11},${Usr1NMFILE},${RINGINGLINE},${Usr1VM})
exten => _12,1,macro(pana-transfer,${PANAEXT12},${Usr1NMFILE},${RINGINGLINE},${Usr1VM})
exten => _13,1,macro(pana-transfer,${PANAEXT13},${Usr2NMFILE},${RINGINGLINE},${Usr2VM})
exten => _14,1,macro(pana-transfer,${PANAEXT14},${Usr3NMFILE},${RINGINGLINE},${Usr3VM})
exten => _15,1,macro(pana-transfer,${PANAEXT15},${Usr4NMFILE},${RINGINGLINE},${Usr4VM})
exten => _16,1,macro(pana-
exten => _23,1,macro(pana-transfer,${PANAEXT23},${Usr1NMFILE},${RINGINGLINE},${Usr1VM})
exten => _26,1,Flash ; hook flash
exten => _26,2,background(silence/1) ; wait for KSU
exten => _26,3,SendDTMF(26) ; send KSU the extension
exten => _26,4,background(silence/1) ; wait for KSU
exten => _26,5,Hangup ; was SoftHangup
exten => _27,1,macro(intext,${Usr5EXTEN},${Usr5VM},${DEFTIMEOUT})
exten => _28,1,macro(intext,${Usr6EXTEN},${Usr6VM},${DEFTIMEOUT})
;
exten => _427,1,macro(pana-transfer,${PANAEXT11},${Usr1NMFILE},${RINGINGLINE},${Usr1VM})
exten => _436,1,macro(pana-transfer,${PANAEXT11},${Usr1NMFILE},${RINGINGLINE},${Usr1VM})
exten => _837,1,macro(pana-transfer,${PANAEXT13},${Usr2NMFILE},${RINGINGLINE},${Usr2VM})
exten => _242,1,macro(pana-transfer,${PANAEXT14},${Usr3NMFILE},${RINGINGLINE},${Usr3VM})
exten => _223,1,macro(pana-transfer,${PANAEXT15},${Usr4NMFILE},${RINGINGLINE},${Usr4VM})
exten => _228,1,macro(pana-transfer,${PANAEXT15},${Usr4NMFILE},${RINGINGLINE},${Usr4VM})
exten => _776,1,macro(intext,SIP/27,${Usr5VM},${DEFTIMEOUT})
exten => _876,1,macro(intext,SIP/27,${Usr5VM},${DEFTIMEOUT})
exten => _476,1,macro(intext,SIP/28,${Usr6VM},${DEFTIMEOUT})
exten => _227,1,macro(intext,SIP/28,${Usr6VM},${DEFTIMEOUT})
;
;
[sip-trans]
;
;
exten => _11,1,Dial(${PANA}/11,${DEFTIMEOUT},Tt)
exten => _12,1,Dial(${PANA}/12,${DEFTIMEOUT},Tt)
exten => _13,1,Dial(${PANA}/13,${DEFTIMEOUT},Tt)
exten => _14,1,Dial(${PANA}/14,${DEFTIMEOUT},Tt)
exten => _15,1,Dial(${PANA}/15,${DEFTIMEOUT},Tt)
exten => _16,1,Dial(${PANA}/16,${DEFTIMEOUT},Tt)
exten => _17,1,Dial(${PANA}/17,${DEFTIMEOUT},Tt)
exten => _18,1,Dial(${PANA}/18,${DEFTIMEOUT},Tt)
exten => _19,1,Dial(${PANA}/19,${DEFTIMEOUT},Tt)
exten => _20,1,Dial(${PANA}/20,${DEFTIMEOUT},Tt)
exten => _21,1,Dial(${PANA}/21,${DEFTIMEOUT},Tt)
exten => _22,1,Dial(${PANA}/22,${DEFTIMEOUT},Tt)
exten => _23,1,Dial(${PANA}/23,${DEFTIMEOUT},Tt)
exten => _26,1,Dial(${PANA}/26,${DEFTIMEOUT},Tt)
exten => _27,1,Dial(SIP/27,${DEFTIMEOUT},Tt)
exten => _28,1,Dial(SIP/28,${DEFTIMEOUT},Tt)
;
exten => _34,1,Dial(${PANA}/34,${DEFTIMEOUT},Tt)
;
exten => _427,1,Dial(${PANA}/11,${DEFTIMEOUT},Tt)
exten => _436,1,Dial(${PANA}/11,${DEFTIMEOUT},Tt)
exten => _837,1,Dial(${PANA}/13,${DEFTIMEOUT},Tt)
exten => _242,1,Dial(${PANA}/14,${DEFTIMEOUT},Tt)
exten => _223,1,Dial(${PANA}/15,${DEFTIMEOUT},Tt)
exten => _228,1,Dial(${PANA}/15,${DEFTIMEOUT},Tt)
exten => _776,1,Dial(SIP/27,${DEFTIMEOUT})
exten => _876,1,Dial(SIP/27,${DEFTIMEOUT})
exten => _476,1,Dial(SIP/28,${DEFTIMEOUT})
exten => _227,1,Dial(SIP/28,${DEFTIMEOUT})
;
;
[vmail-by-ext]
;
;
exten => _11,1,VoiceMail(u${Usr1VM})
exten => _11,2,Goto(#,1)
;
exten => _12,1,VoiceMail(u${Usr1VM})
exten => _12,2,Goto(#,1)
;
exten => _13,1,VoiceMail(u${Usr2VM})
exten => _13,2,Goto(#,1)
;
exten => _16,1,VoiceMail(u${Usr1VM})
exten => _16,2,Goto(#,1)
;
exten => _17,1,VoiceMail(u${Usr1VM})
exten => _17,2,Goto(#,1)
;

exten => _26,1,Flash ; hook flash
exten => _26,2,background(silence/1) ; wait for KSU
exten => _26,3,SendDTMF(26) ; send KSU the extension
exten => _26,4,background(silence/1) ; wait for KSU
exten => _26,5,Hangup ; was SoftHangup
;
[vmail-by-name]
;
;
exten => _427,1,VoiceMail(u${Usr1VM})
exten => _427,2,Goto(#,1)
;
exten => _837,1,VoiceMail(u${Usr2VM})
exten => _837,2,Goto(#,1)
;
exten => _242,1,VoiceMail(u${Usr3VM})
exten => _242,2,Goto(#,1)
;
exten => _223,1,VoiceMail(u${Usr4VM})
exten => _223,2,Goto(#,1)
;
exten => _228,1,VoiceMail(u${Usr4VM})
exten => _228,2,Goto(#,1)
;
;
[user-vm-by-name]
;
;
; User One h=4 e=2 n=7
exten => _427,1,VoiceMailMain(s${Usr1VM})
exten => _427,2,Goto(#,1)
;
; User One h=4 e=3 n=6
exten => _436,1,VoiceMailMain(s${Usr1VM})
exten => _436,2,Goto(#,1)
;
; User Two
exten => _837,1,VoiceMailMain(s${Usr2VM})
exten => _837,2,Goto(#,1)
;
;
[internal-svc]
;
; This section provides access to internal services from outside
; and from inside extensions
;
;
exten => 8500,1,VoicemailMain
exten => 8500,2,Hangup
;
; Or a conference room (edit meetme.conf to enable this room)
;
exten => 8600,1,Meetme(8600)
exten => 8601,1,Meetme(8601)
exten => 8602,1,Meetme(8602)
exten => 8603,1,Meetme(8603)
exten => 8604,1,Meetme(8604)
exten => 8605,1,Meetme(8605)
;
;
[emergency]
;
;
;
;
;*************************************************************
; END - Include contexts
;*************************************************************
;
;
;********************************************************************
; BEGIN - Macro Definitions
;********************************************************************
;
;
[macro-intext]
;
;
exten => s,1,Background(transfer)
exten => s,2,Dial(${ARG1},${ARG3},Tt)
exten => s,3,Voicemail(u${ARG2})
exten => s,4,Hangup
exten => s,103,Voicemail(b${ARG2})
exten => s,104,Hangup
;
;
[macro-pana-transfer]
;
;
; This macro performs an unattended transfer to a Panasonic analog extension using a hook flash transfer
;
; First we call the registered extension for the person we are attempting to transfer the call to. Then we
; announce the line their call is on.
;
; ARG1 = Panasonic analog extension to dial
; ARG2 = sound file name to say user name
; ARG3 = sound file name of ringing line to anounce
; ARG4 = VoiceMail box ID
;
; announce the incoming call on the called party registered extension
;
exten => s,1,Background(transfer) ; announce to caller
;
; announce the call to the extension first
;
exten => s,2,Macro(pana-announce,${ARG1},${ARG2},${ARG3})
;
; announce the call using a PAGE ALL
;
exten => s,3,Macro(pana-announce,${PAGE},${ARG2},${ARG3})
;
; if all else fails, put the caller in voicemail
;
exten => s,4,Background(transfer) ; announce to caller
exten => s,5,Wait(10)
exten => s,6,Voicemail(u${ARG4})
exten => s,7,Hangup
;
;
[macro-pana-announce]
;
;
; ARG1 = Panasonic extension to dial
; ARG2 = sound file name to say user name
; ARG3 = sound file name of ringing line to anounce
;
exten => s,1,Background(transfer) ; announce to caller
exten => s,2,NoOp
exten => s,3,Flash ; hook flash
exten => s,4,background(silence/1) ; wait for KSU
exten => s,5,SendDTMF(${ARG1}) ; send KSU the extension
exten => s,6,background(silence/1) ; wait for KSU
exten => s,7,NoOp ; was SoftHangup
;
exten => s,8,Background(custom/there-is-a-call-for) ; announce to called party
exten => s,9,Background(${ARG2}) ; say their name
exten => s,10,Background(${ARG3}) ; tell what line
exten => s,11,background(silence/1) ; wait a second
;
exten => s,12,Background(custom/there-is-a-call-for) ; repeat the announcement
exten => s,13,Background(${ARG2}) ; say their name
exten => s,14,Background(${ARG3}) ; tell what line
exten => s,15,background(silence/1) ; wait a second
;
exten => s,16,Flash ; flash the hook to return to caller
exten => s,17,background(silence/1) ; wait a second
;
;
[macro-dial-pstn]
;
; Enter with these
; ARG1 = number to dial
; ARG2 = timeout value
; ARG3 = flag determines if hangup or return on noanswer
; HR = hangup and return (default)
; RT = return without hangup (must set)
;
; Returns with FOUNDME = DIALSTATUS
;
;
; the 9w dials 9 then waits .5 sec for outside dialtone
;
exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s,2,Dial(${PSTN}/9w${ARG1},${ARG2})
exten => s,3,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,4,Goto(s-${DIALSTATUS},1)
;
; returns here if busy
;
exten => s,103,SetGlobalVar(FOUNDME=BUSY)
exten => s,104,Goto(s-BUSY,1)
;
;
exten => s-BUSY,1,BackGround(the-party-you-are-calling)
exten => s-BUSY,2,BackGround(is-curntly-busy)
exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,4,Goto(s-CLEANEXIT,1)
;
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
exten => s-.,1,BackGround(something-Usr2bly-wrong)
exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,3,Goto(s-CLEANEXIT,1)
;
exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp
;
;
[macro-dial-sip]
;
;
; Enter with these
; ARG1 = number to dial
; ARG2 = timeout value
; ARG3 = flag determines if hangup or return on no answer
; HR = hangup and return (default)
; RT = return without hangup (must set)
;
; Returns with FOUNDME = DIALSTATUS
;
exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s,2,Dial(SIP/${ARG1}${SIPCO1},${ARG2})
exten => s,3,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,4,Goto(s-${DIALSTATUS},1)
;
; returns here if busy
;
exten => s,103,SetGlobalVar(FOUNDME=BUSY)
exten => s,104,Goto(s-BUSY,1)
;
exten => s-BUSY,1,BackGround(the-party-you-are-calling)
exten => s-BUSY,2,BackGround(is-curntly-busy)
exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,4,Goto(s-CLEANEXIT,1)
;
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
exten => s-.,1,BackGround(something-Usr2bly-wrong)
exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,3,Goto(s-CLEANEXIT,1)
;
exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp
;
;
[macro-dial-iax]
;
;
; Enter with these
; ARG1 = number to dial
; ARG2 = timeout value
; ARG3 = flag determines if hangup or return on no answer
; HR = hangup and return (default)
; RT = return without hangup (must set)
;
; Returns with FOUNDME = DIALSTATUS
;
exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s,2,GotoIf($[${LEN(${ARG1})} = 10]?2:4)
exten => s,3,SetVar(NumToDial=1${ARG1})
exten => s,4,Goto(s,6)
exten => s,5,SetVar(NumToDial=${ARG1})
exten => s,6,Goto(s,6)
;
exten => s,7,Dial(${IAXCO1}/${NumToDial},${ARG2}) ; try VoicePulse server 1
exten => s,8,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,9,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?10:12)
;
exten => s,10,Dial(${IAXCO2}/${NumToDial},${ARG2}) ; try VoicePulse server 2
exten => s,11,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,12,Goto(s-${DIALSTATUS},1)
;
; returns here if busy
;
exten => s,108,NoOp
exten => s,109,NoOp
exten => s,110,NoOp
exten => s,111,NoOp
exten => s,112,SetGlobalVar(FOUNDME=BUSY)
exten => s,113,Goto(s-BUSY,1)
;
;
exten => s-BUSY,1,BackGround(the-party-you-are-calling)
exten => s-BUSY,2,BackGround(is-curntly-busy)
exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,4,Goto(s-CLEANEXIT,1)
;
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
exten => s-.,1,BackGround(something-Usr2bly-wrong)
exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,3,Goto(s-CLEANEXIT,1)
;
exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp
;
;
[macro-dial-pstn-sip-iax]
;
;
; This macro tries the PSTN circuit first, then
; fails over to our SIP provider and uses IAX
; as a last resort.
;
; As part of a least cost routing plan, this
; routine is best used for local calls.
;
;
; Enter with these
; ARG1 = number to dial
; ARG2 = timeout value
; ARG3 = flag determines if hangup or return on no answer
; HR = hangup and return (default)
; RT = return without hangup (must set)
;
; Returns with FOUNDME = DIALSTATUS
;
exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s,2,Dial(${PSTN}/9w${ARG1},${ARG2})
exten => s,3,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,4,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?5:20)
;
exten => s,5,SetGlobalVar(FOUNDME=ANSWER)
exten => s,6,Dial(SIP/${ARG1}${SIPCO1},${ARG2})
exten => s,7,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,8,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?9:20)
;
exten => s,9,GotoIf($[${LEN(${ARG1})} = 10]?10:12)
exten => s,10,SetVar(NumToDial=1${ARG1})
exten => s,11,Goto(s,13)
exten => s,12,SetVar(NumToDial=${ARG1})
;
exten => s,13,SetGlobalVar(FOUNDME=ANSWER)
exten => s,14,Dial(${IAXCO1}/${NumToDial},${ARG2}) ; try VoicePulse server 1
exten => s,15,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,16,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?17:20)
;
exten => s,17,SetGlobalVar(FOUNDME=ANSWER)
exten => s,18,Dial(${IAXCO2}/${NumToDial},${ARG2}) ; try VoicePulse server 2
exten => s,19,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,20,Goto(s-${DIALSTATUS},1)
;
; returns here if busy on PSTN
;
exten => s,103,SetGlobalVar(FOUNDME=BUSY)
exten => s,104,Goto(s-BUSY,1)
;
; returns here if busy on SIP
;
exten => s,107,SetGlobalVar(FOUNDME=BUSY)
exten => s,108,Goto(s-BUSY,1)
;
; returns here if busy on IAXCO1
;
exten => s,115,SetGlobalVar(FOUNDME=BUSY)
exten => s,116,Goto(s-BUSY,1)
;
; returns here if busy on IAXCO2
;
exten => s,119,SetGlobalVar(FOUNDME=BUSY)
exten => s,120,Goto(s-BUSY,1)
;
exten => s-BUSY,1,BackGround(the-party-you-are-calling)
exten => s-BUSY,2,BackGround(is-curntly-busy)
exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,4,Goto(s-CLEANEXIT,1)
;
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
exten => s-.,1,BackGround(something-Usr2bly-wrong)
exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,3,Goto(s-CLEANEXIT,1)
;
exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp
;
;
[macro-dial-iax-sip-pstn]
;
; This routine tries to connect using our IAX
; account with VoicePulse first. If for any
; reason, VoicePulse is unavailable, it fails
; over to our SIP account with BroadVoice. If
; BroadVoice fails also, it will use one of our
; analog lines with Verizon as a last resort.
;
; As part of a least cost routing plan, this
; routine is best used for long distance or
; international calls.
;
; Enter with these
; ARG1 = number to dial
; ARG2 = timeout value
; ARG3 = flag determines if hangup or return on no answer
; HR = hangup and return (default)
; RT = return without hangup (must set)
;
; Returns with FOUNDME = DIALSTATUS
;
;
exten => s,1,GotoIf($[${LEN(${ARG1})} = 10]?2:4)
exten => s,2,SetVar(NumToDial=1${ARG1})
exten => s,3,Goto(s,5)
exten => s,4,SetVar(NumToDial=${ARG1})
;
exten => s,5,SetGlobalVar(FOUNDME=ANSWER)
exten => s,6,Dial(${IAXCO1}/${NumToDial},${ARG2}) ; try VoicePulse server 1
exten => s,7,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,8,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?9:20)
;
exten => s,9,SetGlobalVar(FOUNDME=ANSWER)
exten => s,10,Dial(${IAXCO2}/${NumToDial},${ARG2}) ; try VoicePulse server 2
exten => s,11,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,12,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?13:20)
;
exten => s,13,SetGlobalVar(FOUNDME=ANSWER)
exten => s,14,Dial(SIP/${ARG1}${SIPCO1},${ARG2})
exten => s,15,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,16,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?18:20)
;
exten => s,17,SetGlobalVar(FOUNDME=ANSWER)
exten => s,18,Dial(${PSTN}/9w${ARG1},${ARG2})
exten => s,19,SetGlobalVar(FOUNDME=${DIALSTATUS})
exten => s,20,Goto(s-${DIALSTATUS},1)
;
; returns here if busy on IAXCO1
;
exten => s,107,Goto(s-BUSY,1)
;
; returns here if busy on IAXCO2
;
exten => s,111,Goto(s-BUSY,1)
;
; returns here if busy on SIPCO1
;
exten => s,115,Goto(s-BUSY,1)
;
; returns here if busy on PSTN
;
exten => s,119,Goto(s-BUSY,1)
;
exten => s-BUSY,1,BackGround(the-party-you-are-calling)
exten => s-BUSY,2,BackGround(is-curntly-busy)
exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
exten => s-BUSY,4,Goto(s-CLEANEXIT,1)
;
exten => s-CANCEL,1,BackGround(canceled)
exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
exten => s-CHANUNAVAIL,1,BackGround(channel)
exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
exten => s-.,1,BackGround(something-Usr2bly-wrong)
exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
exten => s-.,3,Goto(s-CLEANEXIT,1)
;
exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
exten => s-CLEANEXIT,2,Hangup
exten => s-CLEANEXIT,3,NoOp
;
;
;********************************************************************
; END - Macro Definitions
;********************************************************************
;
;
;********************************************************************
; BEGIN - System Menu
;********************************************************************
;
;
[system-menu-main]
;
; provide user access to their voice mail inbox
; let user leave voice mail for another user
; provide user access to find me
;
; 1 = user gets voice mail
; 2 = user leaves voice mail for another user
; 3 = user tracks down another user at any number
; 4 = user performs menu diagnostics
;
;
exten => s,1,Background(custom/system-menu)
exten => s,2,NoOp
exten => s,3,Background(custom/your-voicemail)
exten => s,4,Background(custom/leave-voicemail)
exten => s,5,Background(custom/find-me)
exten => s,6,Background(custom/system-menu-diag)
exten => s,7,Background(custom/2repeat) ; play the menu messages
exten => s,8,Background(custom/2hangup) ; play the menu messages
exten => s,9,DigitTimeout,1 ; give them 1 seconds between digits
exten => s,10,ResponseTimeout,60 ; give them 60 seconds to make a choice
;
exten => _1,1,Goto(select-get-vmail-by-name,s,1)
;
exten => _2,1,Goto(select-vmail-by-name,s,1)
;
exten => _3,1,Goto(select-find-by-name,s,1)
;
exten => _4,1,Goto(menu-diag,s,1)
;
; Repeat the previous menu
exten => *,1,Goto(s,1)
;
; #=hangup
exten => #,1,Background(goodbye)
exten => #,2,NoOp
exten => #,3,Hangup
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,1)
;
;
[menu-diag]
;
;
; select via menu
; 1 = house-day
; 2 = house-night
; 3 = office-day
; 4 = office-night
; 5 = transfer-to-extension-by-name
; 6 = transfer-to-voicemail-by-name
; 7 = user-access-to-voicemail-by-name
; 8 = transfer-to-remote-phone-1
; 9 = transfer-to-remote-phone-2
; 0 = round-robin-find-me
;
exten => s,1,Background(custom/this-function-offers)
exten => s,2,Background(silence/1)
;
exten => s,3,Background(custom/house-line)
exten => s,4,Background(custom/day-time-menu-select)
exten => s,5,Background(custom/press-the)
exten => s,6,Background(custom/one-key)
exten => s,7,Background(silence/1)
;
exten => s,8,NoOp
exten => s,9,NoOp
exten => s,10,NoOp
exten => s,11,NoOp
exten => s,12,NoOp
exten => s,13,NoOp
;
exten => s,14,Background(custom/house-line)
exten => s,15,Background(custom/night-time-menu-select)
exten => s,16,Background(custom/press-the)
exten => s,17,Background(custom/two-key)
exten => s,18,Background(silence/1)
;
exten => s,19,Background(custom/office-line)
exten => s,20,Background(custom/day-time-menu-select)
exten => s,21,Background(custom/press-the)
exten => s,22,Background(custom/three-key)
exten => s,23,Background(silence/1)
;
exten => s,24,Background(custom/office-line)
exten => s,25,Background(custom/night-time-menu-select)
exten => s,26,Background(custom/press-the)
exten => s,27,Background(custom/four-key)
exten => s,28,Background(silence/1)
;
;
exten => s,29,Background(custom/2repeat) ; play the menu messages
exten => s,30,Background(custom/2return) ; play the menu messages
exten => s,31,Background(silence/1)
exten => s,32,DigitTimeout,1 ; give them 1 seconds between digits
exten => s,33,ResponseTimeout,60 ; give them 60 seconds to make a choice
;
exten => _1,1,Goto(house-day,s,4)
;
exten => _2,1,Goto(house-night,s,4)
;
exten => _3,1,Goto(office-day,s,4)
;
exten => _4,1,Goto(office-night,s,4)
;
exten => _5,1,Goto(select-ext-by-name,s,1)
;
exten => _6,1,Goto(select-vmail-by-name,s,1)
;
exten => _7,1,Goto(select-get-vmail-by-name,s,1)
;
exten => _8,1,Goto(select-remote1-by-name,s,1)
;
exten => _9,1,Goto(select-remote2-by-name,s,1)
;
exten => _0,1,Goto(select-find-by-name,s,1)
;
; Repeat the previous menu
exten => *,1,Goto(s,1)
;
; #=hangup
exten => #,1,NoOp
exten => #,2,Goto(${FLOWCONTROL})
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,1)
;
;
;********************************************************************
; END - System Menu
;********************************************************************
;
;
;*************************************************************
; BEGIN - Route by user name contexts
;*************************************************************
;
;
[select-ext-by-name]
;
; Transfer inbound call to user's internal extension
;
exten => s,1,SetGlobalVar(FLOWCONTROL=select-ext-by-name,s,5)
exten => s,2,Background(custom/emergency-menu-announce)
exten => s,3,Background(custom/trans-to-cell-announce)
exten => s,4,Goto(set-vars-by-name,s,1)
exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:12)
exten => s,6,GotoIf($[${LEN(${EXT})} < 2]?7:8)
exten => s,7,Goto(i,1)
exten => s,8,GotoIf($[${LEN(${EXT})} > 2]?9:12)
exten => s,9 Dial(${EXT},${SHORTTIMEOUT})
exten => s,10,VoiceMail(u${VM})
exten => s,11,Goto(s,16)
;
exten => s,12,NoOp
exten => s,13,Macro(pana-announce,${EXT},${NMFILE},${RINGINGLINE})
exten => s,14,Macro(pana-announce,${PAGE},${NMFILE},${RINGINGLINE})
exten => s,15,VoiceMail(u${VM})
exten => s,16,Background(goodbye)
exten => s,17,Hangup
;
; returns here on a busy SIP extension
;
exten => s,101,VoiceMail(b${VM})
exten => s,102,Background(goodbye)
exten => s,103,Hangup
;
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Goto(s,1)
;
;
[select-vmail-by-name]
;
; Transfer inbound call to user's voice mail
;
exten => s,1,Background(custom/emergency-menu-announce)
exten => s,2,Background(custom/trans-to-cell-announce)
exten => s,3,SetGlobalVar(FLOWCONTROL=select-vmail-by-name,s,5)
exten => s,4,Goto(set-vars-by-name,s,1)
exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:7)
exten => s,6,VoiceMail(u${VM})
exten => s,7,Hangup
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Goto(s,1)
;
;
[select-get-vmail-by-name]
;
; Local user retrieves voice mail
;
exten => s,1,Background(custom/emergency-menu-announce)
exten => s,2,Background(custom/trans-to-cell-announce)
exten => s,3,SetGlobalVar(FLOWCONTROL=select-get-vmail-by-name,s,5)
exten => s,4,Goto(set-vars-by-name,s,1)
exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:7)
exten => s,6,VoiceMailMain(${VM})
exten => s,7,Hangup
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Goto(s,1)
;
;
[select-remote1-by-name]
;
; Transfer inbound call to user's first remote (cell) number
;
exten => s,1,Background(custom/emergency-menu-announce)
exten => s,2,Background(custom/trans-to-cell-announce)
exten => s,3,SetGlobalVar(FLOWCONTROL=select-remote1-by-name,s,5)
exten => s,4,Goto(set-vars-by-name,s,1)
exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:10)
exten => s,6,Background(custom/standby-for-cell-bridge)
exten => s,7,Background(${NMFILE})
exten => s,8,Macro(pstn-sip-iax,${REM1},${SHORTTIMEOUT},RT)
exten => s,9,VoiceMail(u${VM})
exten => s,10,Hangup
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Goto(s,1)
;
;
[select-remote2-by-name]
;
; Transfer inbound call to user's second remote (home) number
;
exten => s,1,Background(custom/emergency-menu-announce)
exten => s,2,Background(custom/trans-to-cell-announce)
exten => s,3,SetGlobalVar(FLOWCONTROL=select-remote2-by-name,s,5)
exten => s,4,Goto(set-vars-by-name,s,1)
exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:10)
exten => s,6,Background(custom/standby-for-cell-bridge)
exten => s,7,Background(${NMFILE})
exten => s,8,Macro(pstn-sip-iax,${REM2},${SHORTTIMEOUT},RT)
exten => s,9,VoiceMail(u${VM})
exten => s,10,Hangup
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Goto(s,1)
;
;
[select-find-by-name]
;
;
; Locate a user
; First try local extension
; Second try a page all
; Third try remote phone 1
; Fourth try remote phone 2
; Fifth drop caller in voicemail
;
exten => s,1,Background(custom/emergency-menu-announce)
exten => s,2,Background(custom/trans-to-cell-announce)
exten => s,3,SetGlobalVar(FLOWCONTROL=select-find-by-name,s,5)
exten => s,4,Goto(set-vars-by-name,s,1)
;
exten => s,5,GotoIf($[${FLOWCONFIRM} = PROCEED]?6:31)
;
exten => s,6,GotoIf($[${LEN(${EXT})} < 2]?18:8)
exten => s,7,NoOp
exten => s,8,Background(custom/standby-for-cell-bridge)
exten => s,9,Background(${NMFILE})
exten => s,10,GotoIf($[${LEN(${EXT})} > 2]?11:13)
;
exten => s,11 Dial(${EXT},${SHORTTIMEOUT})
exten => s,12,GotoIf($[${DIALSTATUS} = BUSY]?28:18)
;
exten => s,13,Macro(pana-announce,${EXT},${NMFILE},${RINGINGLINE})
exten => s,14,GotoIf($[${FOUNDME} = BUSY]?28:15)
;
exten => s,15,Background(custom/standby-for-cell-bridge)
exten => s,16,Background(${NMFILE})
exten => s,17,Macro(pana-announce,${PAGE},${NMFILE},${RINGINGLINE})
;
exten => s,18,GotoIf($[${LEN(${REM1})} < 10]?23:19)
exten => s,19,Background(custom/standby-for-cell-bridge)
exten => s,20,Background(${NMFILE})
exten => s,21,Macro(pstn-sip-iax,${REM1},${SHORTTIMEOUT},RT)
exten => s,22,GotoIf($[${FOUNDME} = BUSY]?28:23)
;
exten => s,23,GotoIf($[${LEN(${REM2})} < 10]?30:24)
exten => s,24,Background(custom/standby-for-cell-bridge)
exten => s,25,Background(${NMFILE})
exten => s,26,Macro(pstn-sip-iax,${REM2},${SHORTTIMEOUT},RT)
exten => s,27,GotoIf($[${FOUNDME} = BUSY]?28:30)
;
exten => s,28,VoiceMail(b${VM})
exten => s,29,Goto(s,31)
exten => s,30,VoiceMail(u${VM})
exten => s,31,Background(goodbye)
exten => s,32,Hangup
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,Goto(s,1)
;
;
[set-vars-by-name]
;
;
exten => s,1,SetGlobalVar(ReturnTo=${FLOWCONTROL})
exten => s,2,SetGlobalVar(FLOWCONTROL=set-vars-by-name,s,2)
exten => s,3,SetGlobalVar(FLOWCONFIRM=foo)
exten => s,4,Background(custom/begin-process-by-name)
;
exten => s,5,Background(custom/2repeat)
exten => s,6,Background(custom/2return)
;
exten => s,7,DigitTimeout,2 ; give them 2 seconds between digits
exten => s,8,ResponseTimeout,30 ; give them 30 seconds to make a choice
;
;
include => set-global-vars
;
;
; get confirmation of selection
;
; Macro returns with FLOWCONFIRM set
; to either PROCEED or ABORT code
;
exten => s-CONFIRM,1,SetGlobalVar(FLOWCONFIRM=foo)
exten => s-CONFIRM,2,SetGlobalVar(FLOWCONTROL=set-vars-by-name,s-CONFIRM,5)
exten => s-CONFIRM,3,SetGlobalVar(CONFIRM=${NMFILE})
exten => s-CONFIRM,4,Goto(confirmation,s,1)
exten => s-CONFIRM,5,SetGlobalVar(FLOWCONTROL=set-vars-by-name,s,4)
exten => s-CONFIRM,6,Goto(s-${FLOWCONFIRM},1)
;
exten => s-PROCEED,1,SetGlobalVar(FLOWCONTROL=${ReturnTo}))
exten => s-PROCEED,2,Goto(${FLOWCONTROL})
;
; the caller aborted the selection process
; loop them back to the top and let them
; try again
;
; ABORT = confirmation process ended with a rejection of selection
exten => s-ABORT,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting
exten => s-ABORT,2,SetGlobalVar(VM=${DEFVM})
exten => s-ABORT,3,SetGlobalVar(ID=${DEFCID})
exten => s-ABORT,4,SetGlobalVar(EXT=${DEFEXTEN})
exten => s-ABORT,5,SetGlobalVar(REM1=${DEFREM1})
exten => s-ABORT,6,SetGlobalVar(REM2=${DEFREM2})
exten => s-ABORT,7,SetGlobalVar(NMFILE=${DEFNMFILE})
exten => s-ABORT,8,SetGlobalVar(FLOWCONFIRM=foo)
exten => s-ABORT,9,Goto(${FLOWCONTROL}) ; let them make another selection
;
; somehow we got back with an invalid
; selection. loop back and let them
; try again.
;
; INVALID = invalid key while making confirmation
;
exten => s-INVALID,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting
exten => s-INVALID,2,SetGlobalVar(VM=${DEFVM})
exten => s-INVALID,3,SetGlobalVar(ID=${DEFCID})
exten => s-INVALID,4,SetGlobalVar(EXT=${DEFEXTEN})
exten => s-INVALID,5,SetGlobalVar(REM1=${DEFREM1})
exten => s-INVALID,6,SetGlobalVar(REM2=${DEFREM2})
exten => s-INVALID,7,SetGlobalVar(NMFILE=${DEFNMFILE})
exten => s-INVALID,8,SetGlobalVar(FLOWCONFIRM=foo)
exten => s-INVALID,9,Background(custom/select-invalid-try-again)
exten => s-INVALID,10,Goto(${FLOWCONTROL})
;
;
; foo = something odd happend during the selection process
;
exten => s-foo,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting
exten => s-foo,2,SetGlobalVar(VM=${DEFVM})
exten => s-foo,3,SetGlobalVar(ID=${DEFCID})
exten => s-foo,4,SetGlobalVar(EXT=${DEFEXTEN})
exten => s-foo,5,SetGlobalVar(REM1=${DEFREM1})
exten => s-foo,6,SetGlobalVar(REM2=${DEFREM2})
exten => s-foo,7,SetGlobalVar(NMFILE=${DEFNMFILE})
exten => s-foo,8,Background(something-Usr2bly-wrong)
exten => s-foo,9,Goto({FLOWCONTROL}) ; loop back to selections
;
; TIMEOUT = timed out making confirmation
;
exten => s-TIMEOUT,1,SetGlobalVar(NM=${DEFCIDNAME}) ; set vars back to default setting
exten => s-TIMEOUT,2,SetGlobalVar(VM=${DEFVM})
exten => s-TIMEOUT,3,SetGlobalVar(ID=${DEFCID})
exten => s-TIMEOUT,4,SetGlobalVar(EXT=${DEFEXTEN})
exten => s-TIMEOUT,5,SetGlobalVar(REM1=${DEFREM1})
exten => s-TIMEOUT,6,SetGlobalVar(REM2=${DEFREM2})
exten => s-TIMEOUT,7,SetGlobalVar(NMFILE=${DEFNMFILE})
exten => s-TIMEOUT,8,SetGlobalVar(FLOWCONFIRM=foo)
exten => s-TIMEOUT,9,Background(custom/select-invalid-try-again)
exten => s-TIMEOUT,10,Goto(${FLOWCONTROL})
;
exten => s-CLEANEXIT,1,SetGlobalVar(FLOWCONFIRM=foo) ; set vars back to default setting
exten => s-CLEANEXIT,2,SetGlobalVar(ReturnTo=foo)
exten => s-CLEANEXIT,3,SetGlobalVar(NM=${DEFCIDNAME})
exten => s-CLEANEXIT,4,SetGlobalVar(VM=${DEFVM})
exten => s-CLEANEXIT,5,SetGlobalVar(ID=${DEFCID})
exten => s-CLEANEXIT,6,SetGlobalVar(EXT=${DEFEXTEN})
exten => s-CLEANEXIT,7,SetGlobalVar(REM1=${DEFREM1})
exten => s-CLEANEXIT,8,SetGlobalVar(REM2=${DEFREM2})
exten => s-CLEANEXIT,9,SetGlobalVar(NMFILE=${DEFNMFILE})
exten => s-CLEANEXIT,10,SetGlobalVar(FOUNDME=foo)
exten => s-CLEANEXIT,11,SetGlobalVar(FLOWCONTROL=${ReturnTo})
exten => s-CLEANEXIT,12,SetGlobalVar(ReturnTo=)
exten => s-CLEANEXIT,13,Goto(${FLOWCONTROL})
;
exten => s-.,1,Goto(s-foo,1)
;
; Repeat the previous menu
exten => *,1,Goto(${FLOWCONTROL})
exten => *,2,Goto(s-CLEANEXIT,1)
;
; # = hangup/abort return to calling process
exten => #,1,SetGlobalVar(FLOWCONTROL=${ReturnTo})
exten => #,2,SetGlobalVar(ReturnTo= )
exten => #,3,Goto(${FLOWCONTROL})
exten => #,4,Goto(s-CLEANEXIT,1)
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(custom/is-invalid) ; "That's not valid, try again"
exten => i,2,NoOp
exten => i,3,Goto(${FLOWCONTROL})
exten => i,4,Goto(s-CLEANEXIT,1)
;
;
[confirmation]
;
; simple yes/no, go/no-go decision routine
;
; enter with
;
; ARG1 = sound file name describing the item selected that
; requires confirmation
;
; returns with FLOWCONFIRM set to
; PROCEED - selection confirmed
; ABORT - want to make another selection
; TIMEOUT - took to much time with a simple decision
;
exten => s,1,Background(custom/you-selected)
exten => s,2,Background(${CONFIRM})
exten => s,3,Background(silence/1)
exten => s,4,Background(custom/confirm-about-selection)
;
exten => s,5,DigitTimeout,1 ; give them 1 seconds between digits
exten => s,6,ResponseTimeout,5 ; give them 5 seconds to make a choice
;
; * = Confirm selection
exten => *,1,SetGlobalVar(FLOWCONFIRM=PROCEED)
exten => *,2,NoOp(${FLOWCONFIRM})
exten => *,3,Goto(${FLOWCONTROL})
;
; # = Reject selection
exten => #,1,SetGlobalVar(FLOWCONFIRM=ABORT)
exten => #,2,NoOp(${FLOWCONFIRM})
exten => #,3,Goto(${FLOWCONTROL})
;
; t=timeout
exten => t,1,SetGlobalVar(FLOWCONFIRM=TIMEOUT)
exten => t,2,NoOp(${FLOWCONFIRM})
exten => t,3,Goto(${FLOWCONTROL})
;
; i=invalid selection
exten => i,1,Background(custom/select-invalid-try-again)
exten => i,2,Goto(s,1) ; invalid choice, loop them back
;
;
;*************************************************************
; END - Route by user name contexts
;*************************************************************
;
;
;********************************************************************
; BEGIN - Outbound call handlers
;********************************************************************
;
;
[default]
;
; this is where SIP extensions enter the dial plan
;
exten => s,1,DigitTimeout,2 ; give them 2 seconds between digits
exten => s,2,ResponseTimeout,30 ; give them 30 seconds to make a choice
;
include => sip-trans
include => internal-svc
;
; Master context for outbound call routing
;
; Handle pstn service numbers.
; This group should only be dialed using
; one of our two analog lines.
;
; This routine is only used by our SIP
; phones. The Panasonic handsets enter
; the dial plan at co3out and co4out
; depending on the selection of CO3 or
; or CO4 at the handset.
;
exten => _0,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
exten => _411,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
exten => _611,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
exten => _911,1,Macro(dial-pstn,${EXTEN},${LONGTIMEOUT})
;
;
; handle outbound toll free calls - force analog
;
exten => _1800.,1,Macro(dial-pstn-sip-iax,${EXTEN},${LONGTIMEOUT})
exten => _1855.,1,Macro(dial-pstn-sip-iax,${EXTEN},${LONGTIMEOUT})
exten => _1866.,1,Macro(dial-pstn-sip-iax,${EXTEN},${LONGTIMEOUT})
exten => _1877.,1,Macro(dial-pstn-sip-iax,${EXTEN},${LONGTIMEOUT})
exten => _1888.,1,Macro(dial-pstn-sip-iax,${EXTEN},${LONGTIMEOUT})
;
; Handle outbound local calls
;
; All local numbers are 10 digits in our area.
; This plan has no pattern for seven digit dialing.
; On local calls, we favor our analog lines from
; Verizon, then fail over to Voicepulse.
;
; NOTE: VoicePulse needs the local 10 digit phone
; number to be preceeded by a "1" and there
; will be per-minute charges against the
; account.
;
; local call rule try analog line first, then sip, then iax
;
exten => _NXXNXXXXXX,1,Macro(dial-pstn-sip-iax,${EXTEN},${LONGTIMEOUT})
;
; long distance rule sends call to iax first, then sip, then pstn
;
; for long distance calls, we try the VoicePulse IAX
; service first. if VoicePulse is not available we try
; the BroadVoice SIP service. if all else fails, we
; use an analog line from Verizon. This forces least
; cost routing of the call.
;
exten => _1NXXNXXXXXX,1,Macro(dial-iax-sip-pstn,${EXTEN},${LONGTIMEOUT}) ; voicepulse first
;
; handle outbound internationl calls
;
; for international calls, we try the VoicePulse IAX
; service first. if VoicePulse is not available we try
; the BroadVoice SIP service. if all else fails, we
; use an analog line from Verizon. This forces least
; cost routing of the call.
;
exten => _011.,1,Macro(dial-iax-sip-pstn,${EXTEN},${LONGTIMEOUT})
;
; handle outbound local calls - force ZAP trunk
;
exten => _9NXXNXXXXXX,1,Macro(dial-pstn,${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound long distance calls - force ZAP trunk
;
exten => _91NXXNXXXXXX,1,Macro(dial-pstn,${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound internationl calls - force ZAP trunk
;
exten => _9011.,1,Macro(dial-pstn,${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound local calls - force IAX via VoicePulse
;
exten => _8NXXNXXXXXX,1,Macro(dial-iax,1${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound long distance calls - force IAX via VoicePulse
;
exten => _81NXXNXXXXXX,1,Macro(dial-iax,${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound internationl calls - force IAX via VoicePulse
;
exten => _8011.,1,Macro(dial-iax,${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound local calls - force SIP via BroadVoice
;
exten => _7NXXNXXXXXX,1,Macro(dial-sip,${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound long distance calls - force SIP via BroadVoice
;
exten => _71NXXNXXXXXX,1,Macro(dial-sip,${EXTEN:1},${LONGTIMEOUT})
;
; handle outbound internationl calls - force SIP via BroadVoice
;
exten => _7011.,1,Macro(dial-sip,${EXTEN:1},${LONGTIMEOUT})
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,1)
;
;
[co3out]
;
; this is where a Panasonic analog extension enters
; the dial plan if they pick up CO3 (VoicePulse)
;
exten => s,1,DigitTimeout,2 ; give them 2 seconds between digits
exten => s,2,ResponseTimeout,30 ; give them 30 seconds to make a choice
;
; If the user presses 0, give them access to the
; system menu
;
exten => 0,1,NoOp
exten => 0,2,Goto(system-menu-main,s,1)
;
; Keep them from dialing PSTN service numbers as
; VoicePulse will not route them properly anyway
;
exten => _411,1,Goto(i,1)
exten => _611,1,Goto(i,1)
exten => _911,1,Goto(i,1)
;
include => sip-trans
include => internal-svc
;
; handle outbound local calls - force VoicePulse
;
exten => _NXXNXXXXXX,1,Macro(dial-iax,1${EXTEN},${LONGTIMEOUT})
;
; handle outbound long distance calls - force VoicePulse
;
exten => _1NXXNXXXXXX,1,Macro(dial-iax,${EXTEN},${LONGTIMEOUT})
;
; handle outbound internationl calls - force VoicePulse
;
exten => _011.,1,Macro(dial-iax,${EXTEN},${LONGTIMEOUT})
;
;
exten => t,1,Goto(i,1) ; If they take too long, let them try again
;
exten => i,1,Background(invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,1)
;
;
[co4out]
;
; this is where a Panasonic analog extension enters
; the dial plan if they pick up CO4 (BroadVoice)
;
exten => s,1,DigitTimeout,2 ; give them 2 seconds between digits
exten => s,2,ResponseTimeout,30 ; give them 30 seconds to make a choice
;
; If the user presses 0, give them access to the
; system menu
;
exten => 0,1,NoOp
exten => 0,2,Goto(system-menu-main,s,1)
;
; Keep them from dialing PSTN service numbers as
; VoicePulse will not route them properly anyway
;
exten => _411,1,Goto(i,1)
exten => _611,1,Goto(i,1)
exten => _911,1,Goto(i,1)
;
include => sip-trans
include => internal-svc
;
; handle outbound local calls - force BroadVoice
;
exten => _NXXNXXXXXX,1,Macro(dial-sip,${EXTEN},${LONGTIMEOUT})
;
; handle outbound long distance calls - force BroadVoice
;
exten => _1NXXNXXXXXX,1,Macro(dial-sip,${EXTEN},${LONGTIMEOUT})
;
; handle outbound internationl calls - force BroadVoice
;
exten => _011.,1,Macro(dial-sip,${EXTEN},${LONGTIMEOUT})
;
exten => t,1,Goto(i,1) ; If they take too long, let them try again
;
exten => i,1,Background(invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,1)
;
;
;********************************************************************
; END - Outbound call handlers
;********************************************************************
;
;
;********************************************************************
; BEGIN - Inbound call handlers
;********************************************************************
;
;
[house-in]
;
; This routine handles inbound calls on the analog
; house line.
;
; The Panasonic KSU is programmed to ring only
; a couple phones after hours so one or two rings
; will not wake everyone in the house.
;
exten => s,1,SetGlobalVar(RINGINGLINE=custom/on-line-one)
exten => s,2,GotoIfTime(07:00-21:00|sun-sat|*|*?house-day,s,1)
exten => s,3,Goto(house-night,s,1)
;
;
[office-in]
;
; This routine handles inbound calls on the analog office line
;
; The office-day checks to see if we might be closed
; due to a holiday and makes a holiday announcment
; if true.
;
; We have to support the possibility that a client
; might have an emergency. We need to be available
; 7x24 for certain clients.
;
; After hours, we will answer immediately without
; ringing every phone in the house by brancing to
; the "office-night" context.
;
; The Panasonic KSU is programmed to ring only
; a couple phones after hours so one or two rings
; will not wake everyone in the house.
;
exten => s,1,SetGlobalVar(RINGINGLINE=custom/on-line-two)
exten => s,2,GotoIfTime(08:00-18:00|mon-fri|*|*?office-day,s,1)
exten => s,3,Goto(office-night,s,1)
;
[voicepulse-in]
;
; This routine handles inbound calls on our VoicePulse DID
; Voicepulse rings in with the extension set to our DID
; VoicePulse is handled as an office line
;
exten => _9005551212,1,SetGlobalVar(RINGINGLINE=custom/on-line-three)
exten => _9005551212,2,GotoIfTime(08:00-18:00|mon-fri|*|*?office-day,s,1)
exten => _9005551212,3,Goto(office-night,s,1)
;
;
[broadvoice-in]
;
; BroadVoice rings in on the s extension
; BroadVoice is handled as an Office line.
;
exten => s,1,SetGlobalVar(RINGINGLINE=custom/on-line-four)
exten => s,2,GotoIfTime(08:00-18:00|mon-fri|*|*?office-day,s,1)
exten => s,3,Goto(office-night,s,1)
;
;
;********************************************************************
; END - Inbound call handlers
;********************************************************************
;
;
;********************************************************************
; BEGIN - House IVR Menu
;********************************************************************
;
;
[house-day]
;
;
exten => s,1,Wait(20)
exten => s,2,Answer
exten => s,3,zapateller ; torture telemarketers
;
; menu diag enter here
;
exten => s,4,NoOp
exten => s,5,Background(custom/welcome-hend) ; play the intro message
exten => s,6,NoOp
;
exten => s,7,Background(custom/this-is-daytime-menu)
exten => s,8,Background(custom/appologise)
;
; loops should return here
;
exten => s,9,SetGlobalVar(FLOWCONTROL=house-day,s,9)
exten => s,10,NoOp
exten => s,11,NoOp

exten => s,12,Background(custom/if-you-know-ext)
;
exten => s,13,Background(silence/1)
exten => s,14,Background(custom/if-emergency)
exten => s,15,Background(custom/press-the)
exten => s,16,Background(custom/nine-key)
exten => s,17,Background(silence/1)
;
exten => s,18,Background(custom/will-trans-to-default)
exten => s,19,Background(silence/1)
;
exten => s,20,Background(custom/2repeat) ; play the menu messages
exten => s,21,Background(custom/2hangup) ; play the menu messages
;
exten => s,22,DigitTimeout,2 ; give them 2 seconds between digits
exten => s,23,ResponseTimeout,30 ; give them 30 seconds to make a choice
;
include => pana-trans
include => internal-svc
;
; Repeat the previous menu
exten => *,1,Goto(s,9)
;
; #=hangup
exten => #,1,Background(goodbye)
exten => #,2,Hangup
;
exten => t,1,VoiceMail(u${DEFVM})
exten => t,2,Hangup
;
exten => i,1,Background(pbx-invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,9)
;
;
[house-night]
;
;
exten => s,1,Wait(10)
exten => s,2,Answer
exten => s,3,zapateller ; torture telemarketers
;
; menu diag enter here
;
exten => s,4,NoOp
exten => s,5,Background(custom/welcome-hend) ; play the intro message
exten => s,6,NoOp
;
exten => s,7,Background(custom/this-is-afterhours-menu)
exten => s,8,Background(custom/direct-to-vmail-is-active)
;
; loops should return here
;
exten => s,9,NoOp
exten => s,10,NoOp
exten => s,11,SetGlobalVar(FLOWCONTROL=house-night,s,9)
exten => s,12,Background(custom/if-you-know-ext)
exten => s,13,Background(silence/1)
;
exten => s,14,Background(custom/if-emergency)
exten => s,15,Background(custom/press-the)
exten => s,16,Background(custom/nine-key)
exten => s,17,Background(silence/1)
;
exten => s,18,Background(custom/will-trans-to-default)
exten => s,19,Background(silence/1)
;
exten => s,20,Background(custom/2repeat) ; play the menu messages
exten => s,21,Background(custom/2hangup) ; play the menu messages
;
exten => s,22,DigitTimeout,2 ; give them 2 seconds between digits
exten => s,23,ResponseTimeout,30 ; give them 30 seconds to make a choice
;
;
include => vmail-by-ext
include => vmail-by-name
include => internal-svc
;
; Repeat the previous menu
exten => *,1,Goto(s,9)
;
; #=hangup
exten => #,1,Background(goodbye)
exten => #,2,Hangup
;
exten => t,1,VoiceMail(u${DEFVM})
exten => t,2,Hangup
;
exten => i,1,Background(pbx-invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,9)
;
;
;********************************************************************
; END - House IVR Menu
;********************************************************************
;
;
;********************************************************************
; BEGIN - Office IVR Menu
;********************************************************************
;
;
[office-day]
;
;
exten => s,1,Wait(30)
exten => s,2,Answer
exten => s,3,zapateller ; torture telemarketers
;
; menu diag enter here
;
exten => s,4,Background(silence/1) ; one second silence
exten => s,5,Background(custom/welcome) ; play the intro message
exten => s,6,NoOp
;
exten => s,7,GotoIfTime(*|*|1|jan?office-holiday,s,1)
exten => s,8,GotoIfTime(*|*|4|jul?office-holiday,s,1)
exten => s,9,GotoIfTime(*|*|11|nov?office-holiday,s,1)
exten => s,10,GotoIfTime(*|*|25|dec?office-holiday,s,1)
;
exten => s,11,GotoIfTime(*|mon|15-21|jan?office-holiday,s,1)
exten => s,12,GotoIfTime(*|mon|15-21|feb?office-holiday,s,1)
exten => s,13,GotoIfTime(*|mon|26-31|may?office-holiday,s,1)
exten => s,14,GotoIfTime(*|mon|1-7|sep?office-holiday,s,1)
exten => s,15,GotoIfTime(*|mon|8-17|oct?office-holiday,s,1)
exten => s,16,GotoIfTime(*|thu|22-28|nov?office-holiday,s,1)
;
; if its not a Holiday check to see if its during business hours
;
exten => s,17,GotoIfTime(08:00-17:59|mon-fri|*|*?office-open,s,1)
;
; if its not during business hours, we must be closed
;
exten => s,18,Goto(office-night,s,7)
;
; include access to internal extentions and services
;
;
include => pana-trans
include => internal-svc
;
; Repeat the previous menu
exten => *,1,Goto(s,5)
;
; #=hangup
exten => #,1,Background(goodbye)
exten => #,2,Hangup
;
exten => t,1,Goto(i,1) ; If they take too long, give up
;
exten => i,1,Background(pbx-invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,5)
;
;
[office-night]
;
;
exten => s,1,Wait(10)
exten => s,2,Answer
exten => s,3,zapateller ; torture telemarketers
;
; menu diag enter here
;
exten => s,4,Background(silence/1) ; one second silence
exten => s,5,Background(custom/welcome) ; play the intro message
exten => s,6,Background(silence/1) ; one second silence
exten => s,7,Background(custom/office-closed)
;
exten => s,8,Background(custom/this-is-afterhours-menu)
exten => s,9,Background(custom/office-hours)
;
; loops should return here
;
exten => s,10,SetGlobalVar(FLOWCONTROL=office-night,s,10)
exten => s,11,NoOp
exten => s,12,NoOp(${FLOWCONTROL})
exten => s,13,Background(custom/if-you-know-ext)
exten => s,14,Background(silence/1) ; one second silence
exten => s,15,Background(custom/to-leave-vm-by-name)
exten => s,16,Background(custom/dial-first-three-char)
;
exten => s,17,Background(silence/1)
exten => s,18,Background(custom/if-emergency)
exten => s,19,Background(silence/1)
exten => s,20,NoOp
;
exten => s,21,Background(custom/2repeat) ; play the menu messages
exten => s,22,Background(custom/2hangup) ; play the menu messages
;
exten => s,23,DigitTimeout,5 ; give them 5 seconds between digits
exten => s,24,ResponseTimeout,90 ; give them 90 seconds to make a choice
;
;
include => vmail-by-ext
include => vmail-by-name
include => internal-svc
include => emergency
;
; Repeat the previous menu
exten => *,1,Goto(s,10)
;
; #=hangup
exten => #,1,Background(goodbye)
exten => #,2,Hangup
;
exten => t,1,VoiceMail(u${DEFVM}) ; If they take too long, send to vmail
exten => t,2,Hangup
;
exten => i,1,Background(pbx-invalid) ; "That's not valid, try again"
exten => i,2,NoOp
exten => i,3,Goto(s,10)
;
;
[office-holiday]
;
; provide Holiday greeting and provide emergency access for
; contract clients
;
exten => s,1,Background(custom/office-closed-holiday) ; play the office we are closed message
exten => s,2,Background(custom/office-hours) ; play the open hours message
exten => s,3,Goto(office-night,s,8)
;
; include access to internal extentions and services
;
include => vmail-by-ext
include => vmail-by-name
include => internal-svc
;
; Repeat the previous menu
exten => *,1,Goto(office-night,s,8)
;
; #=hangup
exten => #,1,Background(goodbye)
exten => #,2,Hangup
;
exten => t,1,VoiceMail(u${DEFVM}) ; If they take too long, send to vmail
exten => t,2,Hangup
;
exten => i,1,Background(pbx-invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(office-night,s,8)
;
;
[office-open]
;
; during normal business hours, operate like a fancy answering machine
;
exten => s,1,NoOp
exten => s,2,NoOp
exten => s,3,NoOp
;
; menu diag enter here
;
exten => s,4,NoOp
exten => s,5,NoOp
exten => s,6,NoOp
;
exten => s,7,NoOp
exten => s,8,NoOp
;
; loops should return here
;
exten => s,9,Background(custom/if-you-know-ext)
;
exten => s,10,Background(silence/1)
exten => s,11,Background(custom/if-emergency)
exten => s,12,Background(custom/press-the)
exten => s,13,Background(custom/nine-key)
exten => s,14,Background(silence/1)
;
exten => s,15,Background(custom/will-trans-to-default)
exten => s,16,Background(silence/1)
;
exten => s,17,Background(custom/2repeat) ; play the menu messages
exten => s,18,Background(custom/2hangup) ; play the menu messages
;
exten => s,19,DigitTimeout,2 ; give them 2 seconds between digits
exten => s,20,ResponseTimeout,30 ; give them 30 seconds to make a choice
;
include => pana-trans
include => internal-svc
;
; Repeat the previous menu
exten => *,1,Goto(s,9)
;
; #=hangup
exten => #,1,Background(goodbye)
exten => #,2,Hangup
;
exten => t,1,VoiceMail(u${DEFVM})
exten => t,2,Hangup
;
exten => i,1,Background(pbx-invalid) ; "That's not valid, try again"
exten => i,2,Wait(1)
exten => i,3,Goto(s,9)
;
;
;********************************************************************
; END - Office IVR Menu
;********************************************************************
;
;