Commit 390837ee authored by Simon Morlat's avatar Simon Morlat

Fix crash in getDialogId() when the dialog is in NULL state, ie with to-tag not yet known.

parent 7e6b5df4
...@@ -434,7 +434,11 @@ string SalOp::getDialogId () const { ...@@ -434,7 +434,11 @@ string SalOp::getDialogId () const {
if (!mDialog) if (!mDialog)
return string(); return string();
stringstream ss; stringstream ss;
ss << mCallId << ";to-tag=" << belle_sip_dialog_get_remote_tag(mDialog) << ";from-tag=" << belle_sip_dialog_get_local_tag(mDialog); const char *to_tag = belle_sip_dialog_is_server(mDialog) ? belle_sip_dialog_get_local_tag(mDialog) : belle_sip_dialog_get_remote_tag(mDialog);
const char *from_tag = belle_sip_dialog_is_server(mDialog) ? belle_sip_dialog_get_remote_tag(mDialog) : belle_sip_dialog_get_local_tag(mDialog);
if (!to_tag) to_tag = "";
if (!from_tag) from_tag = ""; /* Not having from-tag should never happen.*/
ss << mCallId << ";to-tag=" << to_tag << ";from-tag=" << from_tag;
return ss.str(); return ss.str();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment