don't put blank 'version' attr in dialog-info packets

This commit is contained in:
Michael Jerris 2010-09-01 11:46:32 -05:00 committed by Brian West
parent f790cbf20c
commit 749dc86410
1 changed files with 6 additions and 1 deletions

View File

@ -1317,11 +1317,16 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
}
if (is_dialog) {
char *version = switch_event_get_header(helper->event, "event_count");
if (!version) {
version = "0";
}
stream.write_function(&stream,
"<?xml version=\"1.0\"?>\n"
"<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" "
"version=\"%s\" state=\"%s\" entity=\"%s\">\n",
switch_str_nil(switch_event_get_header(helper->event, "event_count")),
version,
!strcasecmp(answer_state, "resubscribe") ? "partial" : "full", clean_id);
}