Solved

Asterisk to PBX Paging Code HELP :)

Posted on 2010-09-09
16
565 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

There are no good configuration guides for HP-H3C router to LYNC on the web. :( Big statement, but we havent been able to find one yet. We did find the following document useful, but the information was not enough to use H3C router for use as a L…
Almost all Internet protocol telephones have built-in switches at the back that allow you to connect your personal computer to one port and use the other port to connect your phone to to a Cisco switch.   Why we need to connect the PC to the pho…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

19 Experts available now in Live!

Get 1:1 Help Now