Stalled in an elevator is not a place one prefers to spend their time or is prepared for that situation. Escalator and maintenance specification states the necessity and actions to be taken under such emergency circumstances.
Press the alarm or help button and use any available communication systems. It is the most sensible thing to do. Push the alarm button and wait for someone to respond to you. In newer elevators, there will be a help button instead of an alarm button. This places call to a party that is trained to take action i.e. elevator company, alarm company etc. It will give the exact location of the building and elevator you are in. Trained emergency personnel will answer the call for service within several minutes.
Some elevators have a two-way speaker system or telephone that elevator modernization consultant engineer can brief you better about. This technique allows for communication between you and the building personnel. Do not be alarmed if you cannot he heard or if the phone does not work. Some phones are designed to only receive calls. Trained personnel should call only when they arrive at the building. Staying calm and following instruction helps great deal.