res_pjsip_dialog_info: Add missing "direction" attribute in NOTIFY event
authorAlexei Gradinari <alex2grad@gmail.com>
Thu, 7 Apr 2016 21:39:19 +0000 (17:39 -0400)
committerJoshua Colp <jcolp@digium.com>
Fri, 8 Apr 2016 10:49:02 +0000 (05:49 -0500)
BLF pickup isn't working on Cisco SPA and Snom phones
if the direction="recipient" attribute is missing in 'dialog' tag.

This patch adds direction="recipient" if extension state is
Ringing.

ASTERISK-24601 #close

Change-Id: I5b2c097ca29fd59e92ba237ca5d397cb1b0bcd8c

res/res_pjsip_dialog_info_body_generator.c

index e48057b..86f3986 100644 (file)
@@ -133,6 +133,9 @@ static int dialog_info_generate_body_content(void *body, void *data)
 
        dialog = ast_sip_presence_xml_create_node(state_data->pool, dialog_info, "dialog");
        ast_sip_presence_xml_create_attr(state_data->pool, dialog, "id", state_data->exten);
+       if (state_data->exten_state == AST_EXTENSION_RINGING) {
+               ast_sip_presence_xml_create_attr(state_data->pool, dialog, "direction", "recipient");
+       }
 
        state = ast_sip_presence_xml_create_node(state_data->pool, dialog, "state");
        pj_strdup2(state_data->pool, &state->content, statestring);