Although the question of how cell signalling pathways maintain their specificity is still a question requiring much research, biologists have been able to define some mechanisms that keep signals from different signalling pathways from activating inappropriate responses.
One model system for studying such crosstalk are the yeast mitogen-activated protein kinase (MAPK) signalling pathways. In yeast, there are a number of different cell surface receptors (that respond to different stimuli) that activate a the family of MAPKs that in turn, activate different cellular responses. Interestingly, one of these MAPKs, Ste11, is shared between both the mating pheromone response pathway and the high osmolarity response pathway. Yet, mating pheromone does not activate the high osmolarity response and high osmolarity does not evoke the mating pheromone response. So, if Ste11 can be activated by either the mating pheromone pathway and the high osmolarity pathway, and it can turn on the responses to both pathways, what keeps the lines of communication from getting crossed?
It turns out that Ste11 is part of a two very different, large protein complex. In both of these complexes, a protein, called a scaffold protein, tethers Ste11's activity to the members of the signalling pathway directly before and after it. So, the mating pheromone receptor can activate Ste11 only if it is associated with the scaffold protein associated with the mating pathway, Ste5. Furthermore, when Ste11 is associated with Ste5, Ste5 allows Ste11 to activate only the downstream effectors of the mating pathway and does not allow Ste11 to activate any effectors of the osmolarity pathway. Pbs2, the scaffold protein associated with the osmolarity pathway, enforces a similar ordering of signalling events on Ste11 except with the proteins involved in the osmolarity pathway. Wendell Lim's group at UCSF demonstrated the importance of these scaffold proteins in regulating the specificity of MAPK signalling by showing that they could rewire these signalling pathways by reengineering the scaffold proteins (Park SH, Zarrinpar A, Lim WA (2003) Rewiring MAP kinase pathways using alternative scaffold assembly mechanisms.
Science 299:1061–1064 http://dx.doi.org/10.1126/science.1076979
PMC3117218).
While this answer is fairly specific to the MAPK signalling problem, it does demonstrate the general principle that controlling protein localization, for example, by joining members of a signalling pathway together via protein-protein interactions or by confining the signalling molecules to specific subcellular regions, is one mechanism by which cells prevent crosstalk between signalling pathways. The problem is obviously more complicated when you consider the small, quickly diffusing second messenger molecules like Ca
2+ or cAMP, however.