Thursday, March 4, 2010

liferay 5.1.1-send ONLY login information vis HTTPS

1. Apply patch code to liferay-poratl-src/portal-impl/com/liferay/portal/util/PortalImpl.java [change method body : public String getPortalURL(String serverName, int serverPort, boolean secure)](Replace attached file here with PortalImpl-5.1.1Patch.java)

2. change your working directory to : liferay-poratl-src/portal-impl/

3. execute command : ant clean jar

4. delete portal-impl.jar in ext/modules and copy new portal-impl.jar (created in step 3) to ext/modules [ext = extension home directory]

5. add following property to ext/ext-impl/src/portal-ext.properties file.

company.security.auth.requires.https=true
web.server.http.port=8080
web.server.https.port=8443
session.enable.phishing.protection=false

6. stop your running tomcat instance and delete tomcat_home/temp and tomcat_home/work directories.

8. change your working directory to country portal home and execute command : ant clean deploy

9. start your tomcat.

10. delete your current server certificate installed in firefox. (edit > preferences > advanced > encryption > view certificates > servers ) and check.

Patch Code :

public String getPortalURL(
String serverName, int serverPort, boolean secure) {

StringBuilder sb = new StringBuilder();

if (secure || Http.HTTPS.equals(PropsValues.WEB_SERVER_PROTOCOL)) {
sb.append(Http.HTTPS_WITH_SLASH);
}
else {
sb.append(Http.HTTP_WITH_SLASH);
}

if (Validator.isNull(PropsValues.WEB_SERVER_HOST)) {
sb.append(serverName);
}
else {
sb.append(PropsValues.WEB_SERVER_HOST);
}
// enable login through HTTPS start. :add by rangalal: 02-03-2010

/*//comment by rangalal

if (!secure) {
if (PropsValues.WEB_SERVER_HTTP_PORT == -1) {
if ((serverPort != Http.HTTP_PORT) &&
(serverPort != Http.HTTPS_PORT)) {

sb.append(StringPool.COLON);
sb.append(serverPort);
}
}
else {
if ((PropsValues.WEB_SERVER_HTTP_PORT != serverPort) &&
(PropsValues.WEB_SERVER_HTTP_PORT != Http.HTTP_PORT)) {

sb.append(StringPool.COLON);
sb.append(PropsValues.WEB_SERVER_HTTP_PORT);
}
}
}

if (secure) {
if (PropsValues.WEB_SERVER_HTTPS_PORT == -1) {
if ((serverPort != Http.HTTP_PORT) &&
(serverPort != Http.HTTPS_PORT)) {

sb.append(StringPool.COLON);
sb.append(serverPort);
}
}
else {
if ((PropsValues.WEB_SERVER_HTTPS_PORT != serverPort) &&
(PropsValues.WEB_SERVER_HTTPS_PORT != Http.HTTPS_PORT)) {

sb.append(StringPool.COLON);
sb.append(PropsValues.WEB_SERVER_HTTPS_PORT);
}
}
}
*/
// add by rangalal

if ((serverPort != Http.HTTP_PORT) && (serverPort != Http.HTTPS_PORT)) {
sb.append(StringPool.COLON);
sb.append(secure?PropsValues.WEB_SERVER_HTTPS_PORT:PropsValues.WEB_SERVER_HTTP_PORT);
}

// enable login through HTTPS end.

//_log.info("URL : "+sb.toString());

return sb.toString();
}

see : http://issues.liferay.com/browse/LPS-3291

Tuesday, March 24, 2009

How to Connect Asterik & CCM 4.1 Through SIP Trunk

Configure SIP Trunk/Routes in Asterisk


We can connect Asteriks FreePBX system with Cisco Call Manager (CCM) through SIP (Session Intention Protocol) trunk. First of all your CCM should support SIP trunks. The latest versions CCM 4.1 and higher versions are now support for sip trunks.


First i will explain how to configure SIP trunk in FreePBX step by step.


1. Login to FreePBX administration application and select Setup tab > Trunks > Add SIP Trunk.


2. Then provide following specified fields values and others keep as their default values. I will assume that CCM IP as 192.168.5.12

General Settings

Dial Rules:
Your dial rule pattern here.

Ex: 1xx

It means you can dial only three digit numbers starting from 1 as 100, 101 etc

Outgoing Settings

Trunk Name: Your trunk name here.
Ex: InterOffice

PEER Details: Peer FreePBX server details (your CCM).

Ex:

deny=all

allow=g729&alaw

type=friend

host=192.168.5.12

qualify=yes

context=from-internal


Those options mean,


Deny ALL audio codecs. Except for g729 and alaw - if you were in the US, you'd use ulaw Use this entry to send calls to, and receive calls from a device. Use this entry when sending or receiving calls from the host 192.168.5.12 that is your CCM.

It is important to use "qualify" in sip.conf since Call Manager does not support registration for SIP trunks.


Incoming Settings


USER Context : User context name here

Ex : InterOffice-In


USER Details: User details here.


Ex:

context=from-internal

host=192.168.5.12

type=user




3. Now you Asteriks SIP trunk configuration is finished and you have to create outbound route.
4. Go to Setup Tab > Outbound Routes

Route Name: Your route name here
Ex:InterOffice-CCM

Dial Pattern: Your dial pattern here
Ex: 1xx

Trunk Sequence: Your trunk sequence here.
Ex: SIP/InterOffice



5. Now we have to configure SIP trunk from CCM to connect with Asterisk FreePBX. I will assume that asterisk server IP as 172.25.103.52

Configure SIP Trunk/Routes in CCM


1. Open up the CallManager Administration web page. 2. Since a SIP trunk requires MTP, make sure you have one:
  1. Service -> Media Resource -> Media Termination Point
  2. Normally your CallManager server should appear there if you do an empty query
  3. if not, go to the CallManager Serviceabilty web page, and activate the Cisco IP Voice Media Streaming App service

3. Select Device->Trunk from the menu.



4. Select the "Add a New Trunk" link from the upper right hand corner of the "Find and List Trunks" page.



5. Select "SIP Trunk" as the "Trunk type" and "SIP" as the "Device Protocol". Click on the "Next" button.



6. Enter a name in the "Device Name". Valid characters are letters, numbers, dashes, dots (periods), and underscores. The device name is only used internally in Call Manager so it can be anything you want.
7. Enter a description in the "Description" field.
8. Select a device pool.
9. Enter the IP address of your Asterisk server in the "Destination Address" field.



10. Select "UDP" as the "Outgoing Transport Type".
11. Modify any other settings as needed for your ((CiscoCallManager|CallManager) installation.





12. Click on the "Insert" button.
13. Add route pattern from CCM Ex: 409





Now you should be able to make a call from CISCO phones registered with CCM to phone/extensions registered with Asterisk FreePBX vise versa.

Make sure that both your dialing pattern meet the extention range.

Monday, November 12, 2007

Why Personal Websites Matter

I learned HTML back in 1997 to put up a webpage for students of an introductory programming course. Apart from that webpage it never occurred to me that a personal website can be useful. The big question always has been, why waste the time. Sure, I could put a few personal pictures and other stuff but what good is that?

The crucial insight came only after I started this website. In the three months since I started my website, I have discovered that a personal website is not about putting private information online. It is about making available information/opinions that a person finds interesting, and in the process indirectly documenting his/her interests, opinions, skills, and personality.

PaulGraham.Com and Stallman.Org are websites of two well-known individuals in the computing industry. The two websites make very different statements about the respective individuals. Paul Graham's site is neat, and organized. Richard M. Stallman's site has lots of information and links related to his idealogies. Even the choice of the domain name reflects something about their personalities. Paul Graham has chosen a dot com, while Stallman prefers a dot org.

A valid question at this point is that what would one gain by making such information public? The short answer is, just about anything. A popular website provides access to an audience. How someone uses that access is upto that person.

Money can be made from a personal webpage but almost always indirectly. A good personal website creates demand for a person's services. A resume is one or two pages of text. A website can be any number of pages of text and graphics.

My friend Amaan Akram created his website WarpedSpace.org, some years back. He is a computer graphics (CG) artist who has no formal training in art, and no relevant job experience. Last I talked to him, he was planning on moving to London to work as a CG artist. The company that hired him was interested enough to arrange a work-permit and a visa for him. Could he have gotten hired on the basis of his resume?

A resume can contain false information. It is much harder to fool people with a website. A person can claim to be a very organized person in his/her resume, but a website will make the truth self-evident. The person evaluating the website can go back in time and see how the site looked six months, a year, two years back. Of course unorganized, lazy, and stupid people want to hide these qualities by not having a website. On the other hand smart individuals are simply handicapping themselves by not documenting their marketable skills.

Creating a good website requires time and effort. A good website is not about graphics, and fancy layout. It is about high quality content. High quality content is information that many people are likely to find useful. Such information takes the form of tutorials, interesting articles, fascinating images, and the like. No one can come up with high quality content overnight.

If a person is consistently able to come up with good content s/he will be recognized for that. People will perceive that person as an expert on topics s/he writes regularly about. There is no organization which awards people titles such as expert and wizard. Experts and wizards are known as so only on account of their reputations. Articles on a personal website are a great way to demonstrate one's knowledge and build a reputation.

Try searching for "lighting tutorial" in a Google searchbox. Amaan Akram's lighting tutorial will come up topmost in the list of results. He wrote that tutorial back in 1999. Unfortunately, he never read this article (he couldn't have) otherwise he might have posted dozens of CG tutorials by now. His website could have been ten times more popular than it is now.

Good content always find an audience on the web. This being a consequence of the dearth of content on the web. The web is vast but it is also very shallow. If the web was not shallow people would be using search-engines only occasionally. They would be relying on their bookmarks to find all the information they require. People are always searching for content, and if someone puts content on the web, it will be found. Time spent on creating a high quality website is never wasted. It will attract an audience but might not do so immediately.

A website can also be used to collect information. Polls, statistics, and old fashioned requests for information, all depend on having a popular website. Once a person has a popular website they can ask for help with almost anything.

I routinely do programming work for classic-trash, a popular gaming website. I got to know the administrator of the site only because he posted an advert for a programmer on his website. In exchange for programming work, I get free hosting, a shell account, links, and other small favors. If the administrator of classic-trash had to pay for programming work he probably wouldn't be able to make improvements to his website.

In the future personal websites will have an increasingly important role in our lives. Individuals and employers will depend on them to make decisions. People who have invested time and effort in creating interesting websites will have a distinct advantage over people who expended their efforts elsewhere.


by Usman Latif [Nov 08, 2003]

Links:

FAQ for creating a website
Slashdot discussion for this article
A different perspective on the same topic

Website Clarifications

As the popularity of the internet and World Wide Web (www) have increased most of the business organizations and individuals have established a online website for information, marketing purposes.

Basically we can categorize website according to their content and purpose.

1. Family websites :
Used to share information and pictures of you and your family with your friends or other family members who lived abroad or far away from you.


2. Entertainment websites

Used to play and downloads games and play online games and other entertainment activities.

3. Community websites

Used to share information, Schedule, Pictures of your community and organizations. (Alumni, Old boys Associations, School Club etc. )


4. Online Business websites

Sell and delivery product by accepting online transactions.