Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-28-2009, 02:15 AM
Junior Member
 
Posts: 4
Default An easy Clic to call

Hi,

After migrating from Outlook to Zimbra NE I was missing my daily 'clic to call' partner that save me some times during work.
I had a look at the phone zimlet but
1- I did not wanted to use skype neither a sisco phone, I use Eyebeam from Counterpath (v.1.5)
2 -The french phone numbers where not properly recocgnised.
3- I wanted to keep things simple.
So I did some work on that phone zimlet in order to be able to do an easy 'Clic to call'.

It is quite simple : the zimlet use the Url Handler feature (it can be setup for various softphones, sip or iax like idefisk).

On windows environment (for other platform see firefox url handler addon):
1-Create a sip.reg with the following lines :

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\sip]
"EditFlags"=hex:02,00,00,00
@="URL:Sip Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\sip\shell]
[HKEY_CLASSES_ROOT\sip\shell\open]
[HKEY_CLASSES_ROOT\sip\shell\open\command]
@="\"C:\\Program Files\\CounterPath\\eyeBeam 1.5\\eyeBeam.exe\" -dial=\"%1\""

2- Double-clic on it to import in registry.
3- Deploy the new version of the zimlet : com_zimbra_phone.zip

On this uk version, I left the original zimlet regexp, but for France I had to change the regexp in order to pattern the french dial plan (it is not perfect, but it works).
If you need to improve the dial plan to match your country dial plan, you can go to Regular Expression Library, there are nice samples.
The change of the regexp must be done in com_zimbra_phone.xml.
Becarefull with cache.

For me it was a quick and easy setup and it works fine.

if any questions...

Last edited by pberger; 07-23-2009 at 08:22 AM..
Reply With Quote
  #2 (permalink)  
Old 01-28-2009, 03:17 AM
Moderator
 
Posts: 927
Default

That looks like a useful function, thanks.

It seems that you've modified the original zimlet to make this work, which is fine of couse, but could you detail the actual changes made? Some people may prefer to make the edit's themselves.
Reply With Quote
  #3 (permalink)  
Old 01-28-2009, 04:24 AM
Junior Member
 
Posts: 4
Default

ok,

1-Unzip the com_zimbra_phone.zip
the additional code is in blue color and italic

2-In the com_zimbra_phone.xml
For the regexp english people do not have to change anythings others have to change the dial plan regexp pattern (refer to my post) and put their own.
Code:
<!-- french pattern <regex attrs="g">((\+)?(([\(0-9\)\.\- ]){4}([0-9\-\. ]){5,17}))</regex>-->
<regex attrs="g">(((\+\d{2}[-\. ]\d{5}[-\. ]?\d{5})|(\b(\d{1}[-. ])?(\(?\d{3}\)?[-. ])?\d{3}[-.]\d{4}\b)|(\(\d{3}\)[-\. ]?\d{7}))(( x| ext)[-#: ]?\d{1,5}){0,1})</regex>
Code:
   <menuItem label="${msg.skypeCall}" icon="Telephone" id="CALL"/>
   <menuItem label="${msg.clicCall}" icon="Telephone" id="CLICCALL"/>
</contextMenu>
3-In each property file com_zimbra_phone_xx_XX.properties
of course the value must be change in your own language
Code:
  search = Search
  addToContacts = Add To Contacts
  skypeCall = Skype Call
  clicCall = Call with my SoftPhone
4-Modify phone.js
Code:
function(itemId) {
	switch (itemId) {
		case "SEARCH":		this._searchListener(); break;
		case "ADDCONTACT":	this._contactListener(); break;
		case "CALL":		this._callListener(); break;
		case "CLICCALL":	this._clicCall(); break;
	}
};
The last two updates could be optimized of course by a simple function. I strip unwanted characters from the string for my softphone to be happy.
Code:
Com_Zimbra_Phone.getClicCallToLink =
function(phoneIn) {
	if (!phoneIn) { return ""; }
	var phone = AjxStringUtil.trim(phoneIn, true);
	var reg01 = new RegExp("[\+]","g");
	var reg02 = new RegExp("[-\(\)_\.\s]","g");
	phone = phone.replace(reg01, '00');
	phone = phone.replace(reg02, '');
	phone = phone.replace(/[\s]/g,"");
	return "sip:" + phone;
};


Com_Zimbra_Phone.getCallToLink =
function(phoneIn) {
	if (!phoneIn) { return ""; }
	var phone = AjxStringUtil.trim(phoneIn, true);
	var reg01 = new RegExp("[\+]","g");
	var reg02 = new RegExp("[-\(\)_\.\s]","g");
	phone = phone.replace(reg01, '00');
	phone = phone.replace(reg02, '');
	phone = phone.replace(/[\s]/g,"");
	return "callto:" + phone;
};
5- Re-zip
6- Deploy

7- Try it !
__________________
Pascal Berger
OS integration
DS Digital Systems
ZCS 6.01 on Ubuntu 8.04-LTS server_64
http://www.digsys.fr
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.