Paid Opportunity For Someone

Hi everyone, a while back my friend’s Internet Reseller business gradually changed over into a telesales business. He now has 30 sales people in the team, all of which only make outgoing calls.

There are 2 things that we really want to get set up.

  1. Call Recordings
    All the calls made by the sales people are recorded and some of the suppliers require us to send them copies of the calls where sales have been made. Obviously only a small percentage of calls result in a sale, but with that many people they quickly add up.
    In an ideal world we want some way where the sales people can tell the system that the call they have just made has ended in a sale. The system could then email the recording or store it in a different location, or something like that. I have been thinking about it this evening and havent really come with a way of doing it. What would be nice would be a user interface that each sales person has to log into, here they could see all their calls live, and mark the ones that ended in a sale. At the end of the day the system could then email all the marked calls. Not knowing how everything works, there is a probably a million better ways of doing it but i am open to ideas.
    My worry of doing it the way i describe is that i guess we would need to be constantly polling the cdr database so im worried this would massively impact performance.

  2. Device and user mode
    Our second issue is with device and user, when i first looked at device and user I naively assumed that when a call was placed from a device with a user logged in, it would use the users context, not the device. Obviously i was wrong.
    I would like to have a setup where you cannot make outbound calls on a device without a user logged in to it. This would make it much easier to track who was making the calls as they would always originate from the user ext no. regardless of what actual handset they were using. Preferably i would like the system to auto log out all users from devices every night.

So they are my 2 issues. If anyone is interested in getting involved in either of them, or both, paid or unpaid then let me know. Im not promising huge amounts of cash but we are willing to stump up something to get these features out there. Hopefully there are others out there that will also find them useful once done.



There have been many, many requests from the community to give recording some tlc. I suggest that you start drawing up a list of features that you feel are important, have others comment as well, and see how much people are willing to commit to.

Hi Moshe, thanks for the reply. As you say I am really looking for other peoples input as well on this to see what other people think about my problem and proposed solution. My worry as it gets side tracked off with millions of other issues and ideas. I was seeing this as a sort of add on module rather than being built in to the recordings stuff. Although i have done a reasnoble amount of installs and things now, my linux and general coding is pretty basic so i dont really know enough about these things to know whether my ideas about solving them are plausible.

Hopefully others will chirp in with some input on this and some other sugestions on useful features of the recordings stuff.


concerning (2) there is an option you could use if you make sure that all your devices have a different numbering scheme then the users.

For example, let’s say we are going to number all our devices 11XXXX as a numbering convention, and all users XXXX.

Create your first outbound route, call it Emergency, and put in your dial pattern for emergency dialing, e.g. 911, 1911, etc. Make sure it is your first route. All phones can now dial 911 (you want to make sure they don’t have to be logged in for that :slight_smile:

Next, create a route call ‘blocked numbers’ and in that route put the following dial pattern:

FreePBX 2.7:


FreePBX 2.8+:

match_pattern: X.
CallerId: 11XXXX

now provide a ‘bogus’ trunk for that route, or even better, create a custom trunk that points back to a call recording telling them they must log into the phone to make calls.

Lastly, create your normal routes.

The effect this will have is to assure all phones can call 911. Next, all phones who’s CallerID is 11XXXX will use the next route since it catches all numbers dialed of 1 or more digits. (It won’t catch * codes though so if you need that make the appropriate adjustments). Any phone that is not logged into will results in it’s device id being transmitted as its caller id.

All other calls (logged in users, call forwarding, etc) will fall through to any remaining routes which you configure how ever you need based on your normal dialing and trunk needs.

Philippe, nice and elegant! rjefferis, for the longest time I have been wanting to rip recordings our of the core module and give them the home (i.e. their own module) that they deserve. So lets get the ideas rolling, perhaps we’ll set up a wiki page or something where we can collect the ideas and set a bounty.

Hi guys, apologies for delayed response. Philippe that looks great. My next problem is that trixbox only seems to have freepbx 2.5 but hopefully it wont screw anything upgrading it.

Moshe, I’m with you, this sounds like it is going to get fairly complex though. As you say we need some ideas on the end product to start us off. Maybe i should start a new thread with a slightly more exciting name as this doesnt seem to be attracting much attention. What do you think?

Maybe some type of integration with the Orecx open source product. It does a fairly credible job, considering the price. It also moves the recording off the FreePbx server onto a dedicated recording server.

Hi thanks for the input, thats a good point. I had also been toying with the idea of moving the cdr database and recording storage off onto another server. I havent played with orecx but will have a look into it.

To give the user the option to move the database and storage location would surely be fairly simple would it not?

Philippe, sorry to fire this back at you directly. I have been playing around with updating freepbx and I must admit i am slightly loathe to do it. Not from a freepbx side but from a trixbox side.

I had pretty much moved away from trixbox when it originally switched over from [email protected], the only reason i moved back to it on this occasion was that the trixbox cdr report handles large amounts of call recordings much better than the standard ari.

Is there any way of me accomplishing what you have described, without upgrading freepbx from 2.5?

Thanks again.


no. that capability was not introduced until 2.7.

also keep in mind that 2.5 is not being supported at all. (In fact. 2.6 is effectively out of support as well).

If there are features on their reporting that would be beneficial, feel free to open up tickets requesting those features so that they stay on the radar scope when we are working on new stuff.

Hi Philippe, once again thanks for the response. I sort of thought that might be the answer. I will carry on playing around with the upgrade.

I did find this guy who was doing something with a pre dial hook

exten => s,1,NoOp(Trunk is ${OUT_${DIAL_TRUNK}}, CallerID ${CALLERID(num)} calling ${OUTNUM} )
exten => s,n,GotoIf($["${CALLERID(num)}" != “xxxxxxxxx”]?endit)
exten => s,n,GotoIf($["${OUT_${DIAL_TRUNK}:4:11}" != “CAPI/contr1”]?endit)
exten => s,n,GotoIf($["${OUTNUM}:0:4}" = “1800”]?endit)
exten => s,n,Set(OUTNUM=1xxx${OUTNUM})
exten => s,n(endit),MacroExit()

I might try and work out what was going on here and see if its any use.

The main difference between the way the trixbox cdr report handles the recordings compared to ari, is that ari seems to go off and actually look for the files every page load. Trixbox seems to just link to the file regardless. The fact it is not having to scan a monitor folder with say half a million files or more speeds the whole interface up. This is what i have noticed anyway.



you could write some custom code that blocked device CID’s from making outbound calls (except 911, don’t block those).

concerning the link to the recording file, are you saying that every single call in the trixbox CDR report has a link to a potential recording file whether or not one is there?

If the issue you are running into wrt to the ARI relates to scaling issues because of scanning the directory, there may be some things that could be investigated that may get around that. It may be possible to index the contents and cache the index or something similar…

oh, I stand corrected, it does seem to check whether the file is available as i just tested it. It certainly seems quicker and more robust than the ari interface with regards to handling large volumes of recordings.

I thought maybe it had been showing the link only if there was a uniqueid listed in the cdr database, and not actually checking whether the file was still there or not. Doesnt seem to be the case though.

There is a thread here about it from a while back.

I think as Moshe says it would be nice to discuss a seperate module for voicemail management. That would allow things like storage to subfolders by day/week/month to avoid file system limits. Archiving support. Obviously for me some way of users managing their calls and tagging important ones for action. An option for external database and file storage.

With regards to my dialing out conundrum, i was thinking i might try and use a hook to set context by the dialing ext no. Will let you know how I get on.

You can take the trixbox CDR program and install it on any build if you meet the dependencies. I would not hold let that hold you back.

Second, if you are running a pre-forked trixbox by all means upgrade your FreePBX.