diff options
Diffstat (limited to 'main/callerid.c')
-rw-r--r-- | main/callerid.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/main/callerid.c b/main/callerid.c index 04b45ab4f..c1d5e80b9 100644 --- a/main/callerid.c +++ b/main/callerid.c @@ -555,7 +555,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int cid->sawflag = 2; break; case 2: /* Get lead-in */ - if ((b == 0x04) || (b == 0x80)) { + if ((b == 0x04) || (b == 0x80) || (b == 0x06) || (b == 0x82)) { cid->type = b; cid->sawflag = 3; cid->cksum = b; @@ -591,8 +591,10 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int cid->number[0] = '\0'; cid->name[0] = '\0'; + /* Update flags */ + cid->flags = 0; /* If we get this far we're fine. */ - if (cid->type == 0x80) { + if ((cid->type == 0x80) || (cid->type == 0x82)) { /* MDMF */ /* Go through each element and process */ for (x = 0; x < cid->pos;) { @@ -626,6 +628,13 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int memcpy(cid->name, cid->rawdata + x + 1, res); cid->name[res] = '\0'; break; + case 11: /* Message Waiting */ + res = cid->rawdata[x + 1]; + if (res) + cid->flags |= CID_MSGWAITING; + else + cid->flags |= CID_NOMSGWAITING; + break; case 17: /* UK: Call type, 1=Voice Call, 2=Ringback when free, 129=Message waiting */ case 19: /* UK: Network message system status (Number of messages waiting) */ case 22: /* Something French */ @@ -643,12 +652,17 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int x += cid->rawdata[x]; x++; } + } else if (cid->type == 0x6) { + /* VMWI SDMF */ + if (cid->rawdata[2] == 0x42) { + cid->flags |= CID_MSGWAITING; + } else if (cid->rawdata[2] == 0x6f) { + cid->flags |= CID_NOMSGWAITING; + } } else { /* SDMF */ ast_copy_string(cid->number, cid->rawdata + 8, sizeof(cid->number)); } - /* Update flags */ - cid->flags = 0; if (!strcmp(cid->number, "P")) { strcpy(cid->number, ""); cid->flags |= CID_PRIVATE_NUMBER; |