diff --git a/coreapi/bellesip_sal/sal_op_info.c b/coreapi/bellesip_sal/sal_op_info.c index 2e2eb3e49..7ecf8e68b 100644 --- a/coreapi/bellesip_sal/sal_op_info.c +++ b/coreapi/bellesip_sal/sal_op_info.c @@ -20,12 +20,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. int sal_send_info(SalOp *op, const char *from, const char *to, const SalBodyHandler *body_handler){ - if (op->dialog){ + if (op->dialog && belle_sip_dialog_get_state(op->dialog) == BELLE_SIP_DIALOG_CONFIRMED){ belle_sip_request_t *req; belle_sip_dialog_enable_pending_trans_checking(op->dialog,op->base.root->pending_trans_checking); req=belle_sip_dialog_create_queued_request(op->dialog,"INFO"); belle_sip_message_set_body_handler(BELLE_SIP_MESSAGE(req), BELLE_SIP_BODY_HANDLER(body_handler)); return sal_op_send_request(op,req); + }else{ + ms_error("Cannot send INFO message on op [%p] because dialog is not in confirmed state yet.", op); } return -1; } diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index a71b76a96..ac4c895f8 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -140,7 +140,7 @@ static char * create_resource_list_xml(const LinphoneFriendList *list) { xmlTextWriterPtr writer; int err; - if (bctbx_list_size(list->friends) <= 0) return NULL; + if (list->friends == NULL) return NULL; buf = xmlBufferCreate(); if (buf == NULL) {