We help IT Professionals succeed at work.

Asterisk to PBX Paging Code HELP :)

ritztech
ritztech asked
on
752 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
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
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.

Author

Commented:
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

Author

Commented:
is there a way to like when i Call the extension some how initiate this script. Thanks
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
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?

Author

Commented:
Yep And depending on the Different Codes will go on different Dial outs ....

Author

Commented:
If possilbe if you can assist on how do i get the right Dialout on the ZAPTEL FXS trunk
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
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.

Author

Commented:
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


Author

Commented:
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
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
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.

Author

Commented:
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....

Author

Commented:
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)


Author

Commented:
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 ....

Author

Commented:
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.
CERTIFIED EXPERT
Most Valuable Expert 2012
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
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
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.