Avatar of ritztech
ritztech
Flag for United States of America asked on

Asterisk to PBX Paging Code HELP :)

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
IP TelephonyLinux

Avatar of undefined
Last Comment
ritztech

8/22/2022 - Mon
DrDamnit

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.
ritztech

ASKER
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
ritztech

ASKER
is there a way to like when i Call the extension some how initiate this script. Thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
DrDamnit

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?
ritztech

ASKER
Yep And depending on the Different Codes will go on different Dial outs ....
ritztech

ASKER
If possilbe if you can assist on how do i get the right Dialout on the ZAPTEL FXS trunk
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
DrDamnit

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.
ritztech

ASKER
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


ritztech

ASKER
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
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
DrDamnit

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.
ritztech

ASKER
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....
ritztech

ASKER
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)


⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ritztech

ASKER
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 ....
ritztech

ASKER
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.
ASKER CERTIFIED SOLUTION
DrDamnit

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ritztech

ASKER
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
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck