## Comparing Status Determination Numbers when Negotiating Master/Slave in H.245 (Q120) |

The information in this article applies to: H.323, H.245

There has been some confusion regarding how to negotiate master/slave in H.245. While SDL diagrams try to explain this, it still seems that there is room for ambiguity, as we've seen different vendors implementing the procedures differently.

Most of the confusion lies around the modular arithmetic that is used to compare master/slave determination numbers. Perhaps a straight-forward equation that should probably appear in H.245 is the following:

Result = (MasterSlaveDetermination.statusDeterminationNumber - sv_SDNUM + 2^24) mod 2^24

What some implementers have done is assumed that a - b might result in a negative number, which should never happen. By adding 2^24 to the result of the subtraction operation, we bring the value back into the proper range for the modular arithmetic to be used properly. The "Result" should be used according to Figure C.4/H.245.