chan_ooh323: fix h323 log file path
[asterisk/asterisk.git] / res / res_pjsip_mwi_body_generator.c
index 14c3d62..29b2ed0 100644 (file)
@@ -46,7 +46,7 @@ static void *mwi_allocate_body(void *data)
        if (!mwi_str) {
                return NULL;
        }
-       *mwi_str = ast_str_create(64);
+       *mwi_str = ast_str_create(128);
        if (!*mwi_str) {
                ast_free(mwi_str);
                return NULL;
@@ -61,6 +61,9 @@ static int mwi_generate_body_content(void *body, void *data)
 
        ast_str_append(mwi, 0, "Messages-Waiting: %s\r\n",
                        counter->new_msgs ? "yes" : "no");
+       if (!ast_strlen_zero(counter->message_account))  {
+               ast_str_append(mwi, 0, "Message-Account: %s\r\n", counter->message_account);
+       }
        ast_str_append(mwi, 0, "Voice-Message: %d/%d (0/0)\r\n",
                        counter->new_msgs, counter->old_msgs);
 
@@ -85,6 +88,7 @@ static void mwi_destroy_body(void *body)
 static struct ast_sip_pubsub_body_generator mwi_generator = {
        .type = MWI_TYPE,
        .subtype = MWI_SUBTYPE,
+       .body_type = AST_SIP_MESSAGE_ACCUMULATOR,
        .allocate_body = mwi_allocate_body,
        .generate_body_content = mwi_generate_body_content,
        .to_string = mwi_to_string,
@@ -106,8 +110,9 @@ static int unload_module(void)
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP MWI resource",
-               .support_level = AST_MODULE_SUPPORT_CORE,
-               .load = load_module,
-               .unload = unload_module,
-               .load_pri = AST_MODPRI_CHANNEL_DEPEND,
+       .support_level = AST_MODULE_SUPPORT_CORE,
+       .load = load_module,
+       .unload = unload_module,
+       .load_pri = AST_MODPRI_CHANNEL_DEPEND,
+       .requires = "res_pjsip,res_pjsip_pubsub",
 );