That's done the trick:

Code:

void nbtoname(char *nbname)
{
int i;

for(i = 1 ; i < 32 ; i = i + 2)
{

fprintf(stdout, "%c", ((nbname[i] - 65) << 4) | (nbname[i + 1] - 65));
}

fprintf(stdout, "\n");
return;
}



I thought the PDU encoding on SMS messages was arse about face. I would've gladly discarded the netbios names but for some reason the system sticks an important identifier in there. Oh well, that part was written over a decade ago to work on Windows 3.1 machines without an IP stack.

Thanks a million guys, you've made me look like a genius to my boss!

EDIT: I thought the <20> bit was a red herring, it appears to come from the next byte in the packet as I've just had a value other than <20> appear and only one byte in the packet changed. I don't need it anyway, however I'll keep it in the struct for possible future use.
_________________________
Cheers,

Andy M