[asterisk-ss7] chan_ss7: limit opc and dpc to 14 bits?

Cristian Dimache cristian.dimache at digicom.ro
Fri Feb 22 04:53:24 CST 2008


Hello,

	We have found an issue while using chan_ss7 we cannot use values above 0x3fff 
for opc and dpc.
	The coresponding lines of code say (in mtp.c)

if(peerpc(m) < 0 || peerpc(m) >= (1<<14)) {
	ast_log(LOG_ERROR, "Invalid value 0x%x for peerpc.\n", peerpc(m));

	Allthough we have quickly patched this, we have found that the entire code in 
mtp.c is organized for a maximum of 14 bits of processing (as the following 
code from the same mtp.c shows):

void mtp3_put_label(int sls, int opc, int dpc, unsigned char *buf) {
  buf[0] = dpc & 0xff;
  buf[1] = ((dpc & 0x3f00) >> 8) | ((opc & 0x0003) << 6);
  buf[2] = ((opc & 0x03fc) >> 2);
  buf[3] = ((opc & 0x3c00) >> 10) | (sls << 4);
}

	Any ideas of the reason behind this limit?
	
Thanks,
-- 
Cristian Dimache



More information about the asterisk-ss7 mailing list