It is exactly what you bought it for, a wall hanger. "Pistols" of that general type are made throughout Central and Western Asia and North Africa as tourist souvenirs. They are usually non-functional, but that one looks like it either was made to be functional or someone altered it. The nipple and drum appear to be modern.
Regardless, I would strongly advise against attempting to fire it, since you know nothing of the materials from which it was made. That spot on the wall is calling it.