Solved

Asterisk to PBX Paging Code HELP :)

Posted on 2010-09-09
16
571 Views
Last Modified: 2013-11-12
New Code on my FLOW
Using ZAPTEL

Im USING THE LATEST FREEPBX but not sure where to put this and what file and how to call it ..... Heres the Flow


CALLER on

Mitel PBX users  Dials 1001 > LS-GS Trunk > (asterisk) Zaptel Inbound Trunk > inbound DID OF 1001 > BEEP > Recording Temp Page> Dial Ext 2001 > Outbound Route > FXS Ring Mitel PBX > Analog code 2001 paging Zone to Speaker)

exten => 1001,1,Answer
exten => 1001,2,Wait(1)
exten => 1001,n,set(pageext="zaptel/1001")
exten => 1001,1,playback(beep)
exten => 1001,2,Wait(1)
exten => 1001,n,record(asterisk-recording:ulaw)
exten => 1001,n,system(echo "Channel: ${pageext}" > /var/spool/asterisk/tmp/1001-1.pg)
exten => 1001,n,system(echo "WaitTime: 1" >> /var/spool/asterisk/tmp/1001-1.pg)
exten => 1001,n,system(echo "Context: from-internal" >> /var/spool/asterisk/tmp/1001-1.pg)
exten => 1001,n,system(echo "Extension: 2001" >> /var/spool/asterisk/tmp/1001-1.pg)
exten => 1001,n,system(echo "Priority: 1" >> /var/spool/asterisk/tmp/1001-1.pg)
exten => 1001,n,system(chmod 777 /var/spool/asterisk/outgoing/1001-1.pg)
exten => 1001,n,system(mv /var/spool/asterisk/tmp/1001-1.pg /var/spool/asterisk/outgoing/)
exten => 1001,n,hangup()


exten => 2001,1,dial(Zaptel/2001)
exten => 2001,n,Wait(2)
exten => 2001,1,dial(2001)  (After Connected to teh PBX Dial 2001)
exten => 2001,n,Wait(2)
exten => 2001,n,playback(asterisk-recording)
exten => 2001,n,Hangup


Shall i think of creating a huntgroup of 1001 and have 4 members in it and repeat this code 4 times IM not sure if i got the ZAPTEL context right or the Dialing
0
Comment
Question by:ritztech
  • 11
  • 5
16 Comments
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33643124
1. What is the ultimate goal and what is your question? It looks like you're trying to call a TDM based paging system using zaptel?
2. Your exten 2001, has two  "1" priorities. This is problematic right off the bat. The second dial statement is missing the technology parameter, which is no good also.
0
 

Author Comment

by:ritztech
ID: 33644143
Im trying to get a user to dial certain paging codes across 7 sites Via IP and the Mitels are trunked via T1s and ill have a paging asterisk.

ultimate goal is to get a Page that doesnt page while the caller is paging and it sends it off to a location depending on the code user dials (IE create speed call buttons for Store 1 Etc)

IM just not sure exactly what File to put this in or more and how do i call it from the Freepbx gui.

Thanks
0
 

Author Comment

by:ritztech
ID: 33644155
is there a way to like when i Call the extension some how initiate this script. Thanks
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33646073
So... it's like asynchronus paging. I call, leave a message to be paged, then hang up. then, the asterisk box dials all the other PBX's and broadcasts the page. Right?
0
 

Author Comment

by:ritztech
ID: 33648185
Yep And depending on the Different Codes will go on different Dial outs ....
0
 

Author Comment

by:ritztech
ID: 33649108
If possilbe if you can assist on how do i get the right Dialout on the ZAPTEL FXS trunk
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33652285
exten => 2001,1,dial(Zaptel/2001) is the only required dial statement. If you need a pause, then add 'w' until you get the correct amount,
and then it will continue on.

Example:
exten => 2001,1,dial(Zaptel/2001w123456)

or

exten => 2001,1,dial(Zaptel/2001wwwwwwwwwwwwwww123456789)

Your secondary dial statements "(After Connected to teh PBX Dial 2001)" are just flat wrong.
0
 

Author Comment

by:ritztech
ID: 33653435
So if i wanted to do this do i put this in  extensions.conf or custom-extensions,com

only reason within freepbx i created a huntgroup so theres enough flow to where paging can be used on max of 4 trunks...


and i somehow want to remove this
exten => 1001,n,system(chmod 777 /var/spool/asterisk/outgoing/1001-1.pg)
exten => 1001,n,system(mv /var/spool/asterisk/tmp/1001-1.pg /var/spool/asterisk/outgoing/)

to this

exten => 2001,n,playback(/var/spool/asterisk/tmp/10011.pg)


and just playback the tmp file
And every time someone calls that EXT again overwrite it.


hopefully im not confusing you..


So new FLOW i have


0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:ritztech
ID: 33653498
Mitel PBX dials 1001 Freepbx takes it as

1001 > Huntgroup with 4 members

10011
10012
10013
10014



THIS IS 10011

exten => 10011,1,Answer
exten => 10011,2,Wait(1)
exten => 10011,n,set(pageext="g0/10011")
exten => 10011,1,playback(beep)
exten => 10011,2,Wait(1)
exten => 10011,n,record(asterisk-recording:ulaw)
exten => 10011,n,system(echo "Channel: ${pageext}" > /var/spool/asterisk/tmp/10011.pg)
exten => 10011,n,system(echo "WaitTime: 1" >> /var/spool/asterisk/tmp/10011.pg)
exten => 10011,n,system(echo "Context: from-internal" >> /var/spool/asterisk/tmp/10011.pg)
exten => 10011,n,system(echo "Extension: 20011" >> /var/spool/asterisk/tmp/1001-1.pg)
exten => 10011,n,system(echo "Priority: 1" >> /var/spool/asterisk/tmp/10011.pg)
exten => 10011,n,hangup()

this is where im confused DO I even ever hangup OR  Im not sure on how to call ext 20011
do i do like a exten => x,1,Goto

exten => 20011,1,dial(g0/2001ww123456)
exten => 20011,2,playback(beep)
exten => 20011,n,playback(/var/spool/asterisk/tmp/10011.pg)
exten => 20011,n,Hangup

i think i finally found WHERE to put this haha but im not sure if i mess with it. it might break my Freepbx

This is the extensions_additional.conf
[ext-local]
include => ext-local-custom
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 33654103
This is not possible:

>and i somehow want to remove this
>exten => 1001,n,system(chmod 777 /var/spool/asterisk/outgoing/1001-1.pg)
>exten => 1001,n,system(mv /var/spool/asterisk/tmp/1001-1.pg /var/spool/asterisk/outgoing/)
>
>to this
>
>exten => 2001,n,playback(/var/spool/asterisk/tmp/10011.pg)

Replace:
exten => 10011,n,hangup()

with

exten => 10011,n,Goto(20011,1)

I think that you may, ultimately, need to use AGI to control the call flow like you want. For what you're doing you need to execute entirely with the Dial() application and with playback.

As to where to put it, it is in one of the _custom.conf files. I can never remember which one.
0
 

Author Comment

by:ritztech
ID: 33654388
so trying to PLAYBACK to a file cant be done.

they only reason is what if i get like 2 pagges going at once is there a way to like only use 1 Trunk at once and like HOLD until that one trunk is good. and then initate the outgoing.

So allow anycall from ext 1001 to Play at once EVEN though i have 4 Zaptel Channels Ready.


Though AGI ill have to do quite a bit of reasearch on that....
0
 

Author Comment

by:ritztech
ID: 33654924
so something like this ( that i cant get to work haha)

exten => 1001,1,Answer
exten => 1001,2,Wait(2)
exten => 1001,n,flite(PRESS pound when done)
exten => 1001,3,playback(beep)
exten => 1001,n,record(asterisk-recording:ulaw)
exten => 1001,4,Wait(1)
exten => 1001,n,Goto(1002,1)


exten => 1002,1,Answer
exten => 1002,2,dial(dahdi/g0/8123)  (PAGE CODE ON PBX FOR THE ZONE)
exten => 10021,3,Wait(2)     (Wait for ANSWER)
exten => 1002,4,playback(beep)
exten => 1002,n,playback(asterisk-recording)  (PLAYING THE RECORDING OVER THE SPEAKERS)
exten => 1002,n,Wait(2)


0
 

Author Comment

by:ritztech
ID: 33655017
WAIIT am i not going the right method should i DO a broadcast cause its not MAKING a call its just calling the phone but broadcasting .. ????

thanks ....
0
 

Author Comment

by:ritztech
ID: 33655244
if you cant help is there some good places to get like Support for this kind of stuff being that my timeline for this project is reaching an end.
0
 
LVL 32

Accepted Solution

by:
DrDamnit earned 500 total points
ID: 33668131
What you can do, is make a call, and put that call in a meetme conference. This can all be accomplished by AGI. So, once you setup all the calls and put them all in a conference room, you can then use another channel to connect to it and playback a message into the conference room, which will then broadcast out.

This has to be done in AGI as far as I know. If you're a PHP Programmer, check out phpagi.
0
 

Author Comment

by:ritztech
ID: 33685102
not too much of php programmer i feel im like really close but i just dont know where to get to....

unless you have a agi example

Thansk
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now