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 Display Modes
  #101 (permalink)  
Old 07-02-2009, 07:46 AM
Senior Member
 
Posts: 63
Default ZCS Version?

Quote:

Dear chlauber,

jensdanne replied to a thread you have subscribed to entitled "Asterisk PBX Integration Zimlet (new)" in the Zimlets section of Zimbra - Forums.

Thread location:
http://www.zimbra.com/forums/zimlets...-new-post.html

There may be other replies, but you will not receive any more notifications until you visit the forum again.

Message that has just been posted:

***************
Dialling out gives me an empty Message Box and the following DEBUG output:

2009-07-02 12:41:48,747 WARN [btpool0-49] [] log - /service/zimlet/ch_bnc_asterisk/asterisk.jsp
org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP

PWC6197: An error occurred at line: 35 in the jsp file: /zimlet/ch_bnc_asterisk/asterisk.jsp
PWC6199: Generated servlet error:
Mailbox.OperationContext cannot be resolved to a type

PWC6197: An error occurred at line: 35 in the jsp file: /zimlet/ch_bnc_asterisk/asterisk.jsp
PWC6199: Generated servlet error:
Mailbox.OperationContext cannot be resolved to a type

PWC6197: An error occurred at line: 35 in the jsp file: /zimlet/ch_bnc_asterisk/asterisk.jsp
PWC6199: Generated servlet error:
Flag.FLAG_IS_MESSAGE_ONLY cannot be resolved


at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:123)
at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:296)
at org.apache.jasper.compiler.Compiler.generateClass( Compiler.java:376)
at org.apache.jasper.compiler.Compiler.compile(Compil er.java:437)
at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:608)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:360)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:502)
at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1148)
at com.zimbra.cs.zimlet.ZimletFilter.doFilter(ZimletF ilter.java:201)
at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1139)
at org.mortbay.servlet.UserAgentFilter.doFilter(UserA gentFilter.java:81)
at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter .java:129)
at org.mortbay.jetty.servlet.ServletHandler$CachedCha in.doFilter(ServletHandler.java:1139)
at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:378)
at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:417)
at org.mortbay.jetty.handler.ContextHandlerCollection .handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle (HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
at org.mortbay.jetty.handler.rewrite.RewriteHandler.h andle(RewriteHandler.java:230)
at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:534)
at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:879)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:747)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(Selec tChannelEndPoint.java:409)
at org.mortbay.thread.BoundedThreadPool$PoolThread.ru n(BoundedThreadPool.java:451)

Any ideas?
Hmm which ZCS version do you use? I tested version 0.65 with 5.0.13 and above.

--
BTW: I cant see the new posts on forms web site?
Reply With Quote
  #102 (permalink)  
Old 07-02-2009, 07:56 AM
Starter Member
 
Posts: 2
Default

Hi, thanks for replying so quick.

I am evaluating beta2 of version 6, so this error might actually be related to the zimbra version.
Reply With Quote
  #103 (permalink)  
Old 07-02-2009, 07:59 AM
Senior Member
 
Posts: 63
Default ZCS Version 6

OK here we habe the issue. My dev machine is not yet on ZCS 6. So it seems there have some things changed in the Message Flags.
Next version will be ZCS 6 aware.

So for the moment you need to stick with ZCS 5.
Reply With Quote
  #104 (permalink)  
Old 07-24-2009, 01:03 PM
Senior Member
 
Posts: 58
Default Number parsing

Thanks very much to the developers for this great zimlet. The addition of user configurable context was a life save for us.

We're having a bit of a problem in a USA based installation with number recognition. Zimbra recognizes phone numbers with dashes and parenthesis but this zimlet doesn't. It sees 1112223333 but not (111)2223333, (111) 222-3333 or 111-222-3333 and hence does not offer to dial on click. I noticed the regex parameter but that appears to be for cleaning input numbers and not for discerning numbers in the email and it does cull dashes and parenthesis. Is there any way to configure how the zimlet recognizes phone numbers?

Would it be possible to have it recognize email addresses as possible SIP adresses, e.g., sip:someuser@mycompany.com or just someuser@mycompany.com? Thanks - John
__________________
www.spiritualoutreach.com
Making Christianity intelligible to secular society
Reply With Quote
  #105 (permalink)  
Old 07-24-2009, 01:58 PM
Senior Member
 
Posts: 58
Default Command line provisioning

We do most of our user provisioning from the command line. How would one set the zimlet preferences, e.g., ID and context, via the command line? Thanks - John
__________________
www.spiritualoutreach.com
Making Christianity intelligible to secular society
Reply With Quote
  #106 (permalink)  
Old 07-24-2009, 05:59 PM
Senior Member
 
Posts: 58
Default

Just for kicks, I removed all characters from the regex to see if it would stop stripping out essential characters from a sip url, e.g., ".". Somewhat to my surprise, dialing sip urls from the zimlet still failed. Of course, this also does not address the issue of identifying sip urls.

I'm guessing the dialing logic would be looking for an "@" in the string and, if found, only stripping out spaces rather than all characters matching the regex. Unfortunately, I don't know a thing about java or writing zimlets or I'd gladly have a look. Thanks - John
__________________
www.spiritualoutreach.com
Making Christianity intelligible to secular society
Reply With Quote
  #107 (permalink)  
Old 07-26-2009, 03:07 PM
Senior Member
 
Posts: 63
Default Matching Regexp

Quote:
Originally Posted by gracedman View Post
Thanks very much to the developers for this great zimlet. The addition of user configurable context was a life save for us.

We're having a bit of a problem in a USA based installation with number recognition. Zimbra recognizes phone numbers with dashes and parenthesis but this zimlet doesn't. It sees 1112223333 but not (111)2223333, (111) 222-3333 or 111-222-3333 and hence does not offer to dial on click. I noticed the regex parameter but that appears to be for cleaning input numbers and not for discerning numbers in the email and it does cull dashes and parenthesis. Is there any way to configure how the zimlet recognizes phone numbers?

Would it be possible to have it recognize email addresses as possible SIP adresses, e.g., sip:someuser@mycompany.com or just someuser@mycompany.com? Thanks - John
Hi gracedman

Sadly i didn't find yet a way to make a configure option to change the regexp that parses the phone numbers. But you can unpack the zipfile and change the matching regexp for phone numbers. Just change the following regexp in ch_bnc_asterisk.xml to your needs, repack as zip and install the zimlet.
Code:
<matchOn>
    <regex attrs="g">(\s|\t|^)\+?(\s?((\(\d{1,4}\))|(\d{1,4}))){6,10}(=?((\.|\,)?(\n|\r\n|\s|\t|$)))</regex>
</matchOn>
Reply With Quote
  #108 (permalink)  
Old 07-27-2009, 04:56 PM
Senior Member
 
Posts: 58
Default

Thanks for showing me where that is. I think the regex may be a bit off. I'm not a regex guru and am certainly unfamiliar with positive lookaheads but let me see if I can interpret it, understand why it is not matching, and propose an alternate. I'm testing with a handy regex evaluator at RegEx: online regular expression testing

(\s|\t|^)\+?(\s?((\(\d{1,4}\))|(\d{1,4}))){6,10}(= ?((\.|\,)?(\n|\r\n|\s|\t|$)))

I think this is saying, start with white space or a tab. Isn't \t included in \s?
We then have an optional single "+" for the country code. At this point, it gets a little fuzzy. I think ((\(\d{1,4}\))|(\d{1,4})) is a statement to mean match one to four digits either within or without parenthesis. Since we are not using backreferences, I would think this would be more efficient as (?:(\(\d{1,4}\))|(\d{1,4})).

We then enclose this statement in parenthesis with optional white space:
(\s?((\(\d{1,4}\))|(\d{1,4}))). Again, I think this would be more efficient as:
(?:\s?(?:(\(\d{1,4}\))|(\d{1,4}))). Please correct me if I am wrong.

This is where I think it breaks. We then take that whole expression and add {6,10}. Doesn't than mean I match a minimum of 6 and maximum of 10 of the previous units? In other words between 6 and 10 groups of 1-4 digits with or without parenthesis?

I'm then really confused by the positive lookahead. I think it is saying that these groups of 6 to 10 groups of digits MUST OPTIONALLY (hence is this really useful) be followed by a "." or "," and some kind of white space (which I would think are all subsumed in \s.

Thus, I think the match makes no provision for "-" and may require far too many digits before it ever allows a "." or ",".

I would propose this:
(?:\s|^)(?:\+\d{1,3})?\s?(?:\(\d{1,4}\))?\s?\d{1,1 1}(?:(?:\-|\.|\,)\d{1,10}){0,3}\s?$

To break it down:
(?:\s|^) nothing or a space at the beginning
(?:\+\d{1,3})? a one to three digit country code - are any longer than three digits?
\s? an optional space
(?:\(\d{1,4}\))? an optional parenthetic code, e.g., area code in the US or (0) in the UK
\s? optional space
\d{1,11} match 1 to 11 digits - who know where the delimiter will be - are any phone numbers longer than 11 digits?
(?:(?:\-|\.|\,\s)\d{1,10}){0,3} optionally have up to three additional clusters of numbers separated by dash, dot, comma, or space (I use \s instead of " " to account for typos, e.g., double space)
\s?$ an optional space at the end

The matching is intentionally loose in that I figured we are better off giving the user the option to dismiss a false match rather than not be able to dial a valid number we did not anticipate.

Would anyone mind testing this against different country phone number formats? So far, it works for any I imagined. Again, I tested using RegEx: online regular expression testing - no affiliation - just very grateful to have found it. Hope this helps - John
__________________
www.spiritualoutreach.com
Making Christianity intelligible to secular society

Last edited by gracedman : 07-27-2009 at 04:58 PM. Reason: Better formatting
Reply With Quote
  #109 (permalink)  
Old 07-27-2009, 05:30 PM
Senior Member
 
Posts: 58
Default

OK - how do I install the revised zimlet

I edited the file (copied the matchOn line, commented it out, and edited the new one), rezipped, copied to zimlets with the proper name, undeployed, deployed, restarted mailboxd and I still did not see matched that tested positively on the regex testing site. I even restarted zimbra.

By the way, I'm not matching 207 985 7880 for some reason so I still have some tweaking to do. Thanks - John
__________________
www.spiritualoutreach.com
Making Christianity intelligible to secular society
Reply With Quote
  #110 (permalink)  
Old 07-27-2009, 06:42 PM
Senior Member
 
Posts: 58
Default

Found it! I missed an or pipe between the comma and the space. This should work:

(?:\s|^)(?:\+\d{1,3})?\s?(?:\(\d{1,4}\))?\s?\d{1,1 1}(?:(?:\-|\.|\,|\s)\d{1,10}){0,3}\s?$

I'll try repackaging the zimlet again and see if I can get it to take effect. Thanks - John
__________________
www.spiritualoutreach.com
Making Christianity intelligible to secular society
Reply With Quote
Reply


Thread Tools
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.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0