Whistling by people can be done without a whistle. Hard to describe, it is done by creating a small opening with one's lips and then blowing or sucking air through the hole. The air is moderated by the lips, curled tongue, teeth or fingers (placed over the mouth).
The use of pursed lips, tongue and sometimes fingers is to create turbulence The curled tongue acts as a resonant chamber, acting as a type of Helmholtz resonator. The art of whistling is a hard task to accomplish but is much easier once mastered.
Whistling is done to make people at a distance hear your signal. Sometimes used to call a cab, it can be used in dense forest or on hill-tops. It is a non-verbal method of communication which says, in effect, "take notice, I'm here". Whistling is widely used by shepherds to control their dogs.