Read the callerid in the correct order and make sure to
authorMark Michelson <mmichelson@digium.com>
Thu, 9 Oct 2008 23:30:47 +0000 (23:30 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 9 Oct 2008 23:30:47 +0000 (23:30 +0000)
read the Urgent flag value from the IMAP headers.

(closes issue #13652)
Reported by: jaroth
Patches:
      imapheaders.patch uploaded by jaroth (license 50)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@148144 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 9f2c335..10b8d56 100644 (file)
@@ -1520,9 +1520,9 @@ static int imap_retrieve_file(const char *dir, const int msgnum, const char *mai
 
        fprintf(text_file_ptr, "%s\n", "[message]");
 
-       get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Num:", buf, sizeof(buf));
-       fprintf(text_file_ptr, "callerid=\"%s\" ", S_OR(buf, ""));
        get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Name:", buf, sizeof(buf));
+       fprintf(text_file_ptr, "callerid=\"%s\" ", S_OR(buf, ""));
+       get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Num:", buf, sizeof(buf));
        fprintf(text_file_ptr, "<%s>\n", S_OR(buf, ""));
        get_header_by_tag(header_content, "X-Asterisk-VM-Context:", buf, sizeof(buf));
        fprintf(text_file_ptr, "context=%s\n", S_OR(buf, ""));
@@ -1532,6 +1532,8 @@ static int imap_retrieve_file(const char *dir, const int msgnum, const char *mai
        fprintf(text_file_ptr, "duration=%s\n", S_OR(buf, ""));
        get_header_by_tag(header_content, "X-Asterisk-VM-Category:", buf, sizeof(buf));
        fprintf(text_file_ptr, "category=%s\n", S_OR(buf, ""));
+       get_header_by_tag(header_content, "X-Asterisk-VM-Flag:", buf, sizeof(buf));
+       fprintf(text_file_ptr, "flag=%s\n", S_OR(buf, ""));
        fclose(text_file_ptr);
 
 exit: