Solved

Asterisk Paging with outbound QUEING Via .Call files not sure how to

Posted on 2010-09-16
20
545 Views
Last Modified: 2013-11-12
I have a Current Project  a Paging Application.

4 Inbound calls at once and 4 outbound calls at once can be done.   But the catch is to que the dialed outbound code so even though there are 4 outbound trunks always available only 1 number/ Code Back to the MITEL can be dialed at once QUEING the page so to speak ..

So the paging system can play the pages in order they get from the asterisk and a user doesnt get a busy tone if the page system is busy so a max of 4 recordings at once but it can have about 6 waiting to be played not that the number will ever get that high...

Outbound number queing....
Attached a JPG of a quick diagram.

not sure if .CALL files can be done for this.

thanks
Paging-project.jpg
0
Comment
Question by:ritztech
  • 12
  • 8
20 Comments
 
LVL 36

Expert Comment

by:grblades
Comment Utility
You cant use just a call file. When people leave a page you can have the recording saved to a particular directory and that part is fairly easy.
You will need some way of creating a call file and having that call an AGI program which looks for the files and sees which ones are still to be played and then dials the destination and plays the message.
So you would need an external method to detect these recordings and create a call file when required. In the simplest form you could simply have a cron entry to run a script every minute which checks for unplayed recordings and creates a call file if it finds any.
0
 

Author Comment

by:ritztech
Comment Utility
so in that application example it needs to send almost instantly but not RIGHT after eachother ..
heres what i got (NO QUEING at all)
 
exten => 1222,1,Answer
exten => 1222,2,Wait(1)
exten => 1222,n,set(pageext="dahdi/g0/8923")
exten => 1222,n,Record(asterisk-recording.ulaw)
exten => 1222,n,system(echo "Channel: ${pageext}" > /var/spool/asterisk/tmp/john.call)
exten => 1222,n,system(echo "WaitTime: 10" >> /var/spool/asterisk/tmp/john.call)
exten => 1222,n,system(echo "Context: from-internal" >> /var/spool/asterisk/tmp/john.call)
exten => 1222,n,system(echo "Extension: 1224" >> /var/spool/asterisk/tmp/john.call)
exten => 1222,n,system(echo "Priority: 1" >> /var/spool/asterisk/tmp/john.call)
exten => 1222,n,system(chmod 777 /var/spool/asterisk/outgoing/john.call)
exten => 1222,n,system(mv /var/spool/asterisk/tmp/john.call /var/spool/asterisk/outgoing/)
exten => 1222,n,hangup()

exten => 1224,1,playback(beep)
exten => 1224,n,playback(asterisk-recording)
exten => 1224,n,Wait(1)
exten => 1224,n,Hangup
 
Also im trying to find out HOW to  force this WITHOUT needing a pound.
 
exten => 1222,n,Record(asterisk-recording.ulaw,,,k)
  Tried that but it doesnt work
 
thanks
0
 
LVL 36

Expert Comment

by:grblades
Comment Utility
You would be best off letting the caler just hang up to end the recording. When they do that the rest of the dialplan will not execute so you will want to move it to the h extension.
It will also be best to move that recording into its own context to keep the h extension code separate. So for example :-
exten => 1222,1,GoTo(makerecording,s,1)

exten => 1224,1,playback(beep)
exten => 1224,n,playback(asterisk-recording)
exten => 1224,n,Wait(1)
exten => 1224,n,Hangup

[makerecording]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,set(pageext="dahdi/g0/8923")
exten => s,n,Record(asterisk-recording.ulaw)
exten => s,n,hangup()

exten => h,1,system(echo "Channel: ${pageext}" > /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "WaitTime: 10" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "Context: from-internal" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "Extension: 1224" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "Priority: 1" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(chmod 777 /var/spool/asterisk/outgoing/john.call)
exten => h,n,system(mv /var/spool/asterisk/tmp/john.call /var/spool/asterisk/outgoing/)

0
 

Author Comment

by:ritztech
Comment Utility
ohhh okay I was SOO close last night i was at H extension but didnt know where to put it.


So in this scenario is there a way Without AGI or is that needed to somehow Create a QUEUE or

a way so when code dahdi/g0/8923 ONLY 1 is played at a time but if theres 5 recordings needing to be played Play them in the order but ONLY 1 so it hits the right Page zone on the PBX and so a caller doesnt hear a Busy tone anymore And also so its easy for the caller to just record the page.

Thanks again
0
 

Author Comment

by:ritztech
Comment Utility
also even though 1 Code is played at one time EVEN though i have 4 active OUTBOUND channels always available. ...  i just go out of the dahdi/g0

but each INBOUND code like 1222 is specfic to OUTBOUND code 8923
0
 
LVL 36

Expert Comment

by:grblades
Comment Utility
You dont have to use an AGI program but you will need something which performs a directory listing of files, creates a lock file to indicate a current program is currently processing the new files, and then to create the call file and then to clean up afterwards when the file has been played. This functionality could be done with the system() command and a couple of shell scripts but it would be a lot neater to do it in a perl or php script called via AGI.
0
 

Author Comment

by:ritztech
Comment Utility
that Part carries the 1-1 relationship   but not inbound or outbound channels they are whatever is needed.
0
 
LVL 36

Expert Comment

by:grblades
Comment Utility
If you are having multiple outbound codes then you will have to somehow have a way of linking a file to which outbound code should be used. Probably the easiest way would be to just include the outbound code as part of the filename.
0
 

Author Comment

by:ritztech
Comment Utility
ive messed with tiny Bash but not perl .... is there like an example place i can try and reverse engineer it.
0
 

Author Comment

by:ritztech
Comment Utility
so in theory attach recording.call TO 8923.CALL and recording1.call to 8923.CALL    so  the Outbound code 8923.call and some sort of Que on that so every new record adds to the 8923.CALL file with 10 seconds pause between which would save the current connection on the FXO outbound trunk
0
Free Trending Threat Insights Every Day

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
Comment Utility
sorry to make it seem logical to the picture inbound 1001   outbound 2001 ....
0
 
LVL 36

Expert Comment

by:grblades
Comment Utility
You will probably want to use something like ${UNIQUEID}-8923.wav for the filename to avoid problems of two files being created with the same name.

You could then create a crontab script which runs once a minute which creates a .call file.
In a call file you normally define a local extension which is connected to the channel once it answers. The problem you will have is that you wont know wont channel has to be rung.
What you will have to do is specify a LOCAL channel to be called which can then run a script to find the oldest file, write a lock file and then dial the destination outbound code that it finds in the filename (remember to delete the lock file if the call does not succeed).
The extension which it connects to will then again have to look for the oldest filename and then pay this back and once completed delete the recording (the LOCAL channel code would delete the lock file after its call ended).

You are probably getting the idea that it is not entirely simply and even with the above method you can only play 1 recording per minute. You could call it more often but you cant specify anything less than 1 minute in a crontab. If you try calling it directly after a recording is made aswell then you could run into a race condition with creating the lock file.

I would advise that you get a programmer to take a look aswell as they are familiar with these sort of problems
0
 

Author Comment

by:ritztech
Comment Utility
would you know where to get anyone for assitance on this if needing to pay support I just cant find anyone out there.

Thanks
0
 
LVL 36

Expert Comment

by:grblades
Comment Utility
Sorry I dont know of any off hand.
0
 

Author Comment

by:ritztech
Comment Utility
i have been having a heck of a time contacting asterisk dealers for support do you happen to have a favor for a company as to im trying to see what a normal rate would be .. some one wanted 1800 dollars for this i was like WHHAAT :) haha
0
 

Author Comment

by:ritztech
Comment Utility
so OKAY then ... i got it working when the Caller hangs up by doing ,,,k


exten => 1222,1,GoTo(makerecording,s,1)

exten => 1224,1,playback(beep)
exten => 1224,n,playback(asterisk-recording)
exten => 1224,n,Wait(1)
exten => 1224,n,Hangup

[makerecording]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,set(pageext="dahdi/g0/8923")
exten => s,n,Record(asterisk-recording.ulaw,,,k)
exten => s,n,hangup()

exten => h,1,system(echo "Channel: ${pageext}" > /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "WaitTime: 10" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "Context: from-internal" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "Extension: 1224" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(echo "Priority: 1" >> /var/spool/asterisk/tmp/john.call)
exten => h,n,system(chmod 777 /var/spool/asterisk/outgoing/john.call)
exten => h,n,system(mv /var/spool/asterisk/tmp/john.call /var/spool/asterisk/outgoing/)



Its taking like 5 seconds after the call on the Mitel answers

dahdi/g0/8923 code is dialed it just sits there and then it goes BEEP then recording right away which works but theres a 5 second delay i dont know why.


BUT i would like to have like at least 1

exten => h,n,system(echo "WaitTime: 10" >> /var/spool/asterisk/tmp/john.call)

I tried changing that but then below 8 it doesnt even works so im not sure if using that entry twice is the reason.


thanks

0
 
LVL 36

Accepted Solution

by:
grblades earned 500 total points
Comment Utility
If you have a look to the right you can see the 'hall of fame' list. Click on some of the names and look at their profile. A lot will mention they do contract work so you could get in touch with them.

All I can suggest with your problem is that you connect a normal phone in parallel and listen in to the dialing. It may be that the mitel has a digit timeout for recognising the dtmf tomes so after asterisk has dialled the umber it takes a few seconds before it starts to ring. It could be a number of things but if you listen in and can hear at which stage the delay occurs it will help.
0
 

Author Comment

by:ritztech
Comment Utility
though the Ringing is instant like 2 seconds when i hang up

i have 8923 pointing to a speed call  to call my EXTENSION.

When i Answer the 5 second  delay kicks in.


yea i wish i had my buttset haha. Old telco days ohy vey.
0
 
LVL 36

Expert Comment

by:grblades
Comment Utility
Sorry no idea. I tend to avoid analogue extensions as they cause so many issues with echo and tone detection.
I'll take T1/E1 or SIP any day :P
0
 

Author Comment

by:ritztech
Comment Utility
haha thats funny.

Yea so This 1224 Extension if i DISA into the system internally and dial 1224 5 seconds BEEP then recording .... same timeout is it like a general system thing ....

Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

How To Create Custom / Distinctive Ring Tones on Polycom Phones Purpose and Overview When creating a custom ring tone, you have simple aspirations: to make your phone cooler than everyone else's. Perhaps you need a louder ringer. Perhaps you w…
Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

20 Experts available now in Live!

Get 1:1 Help Now