Hairpinning refers to the need for a phone to connect to a PBX then back out to another phone. All analog and digital phones do this.
Some IP Phones can “shuffle” meaning that they can connect directly to each other after the initial call setup.
Hairpinning IP Phone to IP Phone is wasteful and should be avoided. IP Phones cannot shuffle is they do not share a common codec.