Project TODO List
There are a lot of things that could be done to improve this project. Any help would be greatly appreciated. This page is currently a stub. Refer to the TODO.txt in the Code root directory for now.
- Multiple Matching Contact Handling, provide user with option to pick who it is? At the very least need to fix outbound calling
- Todo this, we need to add a new action to controller.php and add a new column to asteriskLog. The action=setContactId will pass a contact id which will then get written to the asteriskLog db table. Then, in asteriskLogger we check if the contactId is already set before trying to make the relation.
- Need to do custom code for Contacts Subpanels.. (doesn't show magic call icon there).
- Update language files for german and whatever the other language is.
- $sugar_config['asterisk_dialin_ext_match'] = 'Local\/(?:.*?)(\d\d\d?\d?\d?)@'; -- Make this take 3-11 digits. If longer then say 5 characters we need to implement a method to look at users's mobile phones.
- See issues for bug on RingGroups
- Better handling for answering on mobile phone. (currently a chat box still appears).
- Would be cool if we displayed voicemail inside sugar. From what i've read this sounds doable given the options in AMI.
- Ability to record the call... It's unclear whether or not this can be done without complicated AGI scripts or not?
- Have Button to create a new contact when number isn't recognized... (Add to contact--> create new or add to existing)
I'm not aware of any performance issues with using this plugin. That being said... I'm sure there are some optimizations that could be made. This section outlines what we should focus on.
The CallListener.php class is called by every active browser tab that each user has open about every 5 seconds (this is for the call popups). Therefore, this is where any optimization efforts should take place.
- Optimize the query that executes against the asterisk_log table. It selects any recent calls that have occurred in the last hour which haven't been closed by the user. I have very little experience with optimizing database queries.
- Perhaps indexing the timestampCall column would improve performance?
- Alternatively, perhaps we should move older calls to an archive table periodically to improve table scanning.
- When there are active calls, CallListener looks up the contact in the database by phone number each time. We should stop doing this each time by persisting the contact to the asterisk log table once it's been determined. I plan on tackling this when I add multiple matching contact support.
- Need configurable Channel detection in order to assign calls to users when they answer on cell phones.
- Add a configurable option
- (DONE) Need to add dialin prefix (its in sugarListener)
- (DONE) Need to make config option for the dialout. Currently hardcoded to /SIP (in my case i need to do the Local/##@sugarsip/n... see CreateCall... for some reason I don't need it in callListener (presumably b/c it's already SIP at that point).
- (DONE) Parametize the channel --> assigned user id detection, search for Local/LC-52@from-internal-4bbbb in asteriskLogger.
- (DONE) Add max subject length to controller.php (also variables for IBC, OBC);
- Verify Asterisk Logger fix to relogin to AMI works if asterisk goes down.
- (DONE) Currently language is hardcoded in sugarListener.php
- (DONE) AsteriskLogger -> findUser method --> add to query something to detect that user is "Active" so you don't get past employees matchin.
- (Performance) -- Reduce querying in callListener... Perhaps set Contact only in asteriskLogger? -- You'd loose it getting updated if person adds afterwards.
- (Performance) -- Index the timestampCall column?
- (Performance) -- Perhaps create a asterisk_log_archive table and copy entries to it after 1 week to cut down on records that have to be scanned.
- (Performance) -- Ajax calls to callLister continue even after user's session ends (like when you login from a diff browser). Need to somehow stop that.
- Process the AMI response in CallCreate / controller and display errors when they fail in javascript.
- If the database cannot be accessed, this is the error message you get
- (DONE) The previous versions added some custom code around every phone number.
- Fields are added to User, but user needs to go into studio to then add them to template. (This is fine in 6.4 since Users are now "Studioable" but prior it wasn't... so need to have some other way of adding the fields for older versions.)
- Running installer will drop any existing asterisk_log database!
- Create logic hook in manifest See: http://developers.sugarcrm.com/wordpress/2010/05/11/upgrade-safe-user-manager-upgrades/
In my production system, I have 6.4.1. I have an extension which uses JQUERY already (1.4 something)... Here's my results:
If I force include: echo '<script type="text/javascript" src="custom/include/javascript/jquery/jquery.pack.js"></script>'; Asterisk Plugin works fine... But, Dispage Fails.
If I conditionally include JS, works in Firefox... and it chrome...
On my demo 6.4 instance (I don't have any other extensions so jquery isn't loaded).
- Include local copy of jquery works.
- Conditional Include results in: Uncaught ReferenceError: $ is not defined
My conditional code is inserting it after the head... but the code isn't at the head. So, I think I might have to surround my code with some YUI.
YAHOO.util.Event.onDomReady YAHOO.util.Event.onContentReady Uncaught ReferenceError: jQuery is not defined
Ugh... So, I need some YUI or standard javascript way to invoke some code which requires JQuery to be loaded...