diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index d669975c6..5d0ea9b27 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1303,6 +1303,7 @@ static void sip_config_read(LinphoneCore *lc) { lc->sal->use_no_initial_route(!!lp_config_get_int(lc->config,"sip","use_no_initial_route",0)); lc->sal->use_rport(!!lp_config_get_int(lc->config,"sip","use_rport",1)); + lc->sal->set_contact_linphone_specs(lp_config_get_string(lc->config, "sip", "linphone_specs", NULL)); if (!lp_config_get_int(lc->config,"sip","ipv6_migration_done",FALSE) && lp_config_has_entry(lc->config,"sip","use_ipv6")) { lp_config_clean_entry(lc->config,"sip","use_ipv6"); diff --git a/src/sal/op.cpp b/src/sal/op.cpp index 262c53d5e..8d8cb286b 100644 --- a/src/sal/op.cpp +++ b/src/sal/op.cpp @@ -784,8 +784,10 @@ belle_sip_header_contact_t *SalOp::create_contact() { } } } - if (belle_sip_parameters_has_parameter(BELLE_SIP_PARAMETERS(contact_header),"+org.linphone.specs")==0){ - belle_sip_parameters_set_parameter(BELLE_SIP_PARAMETERS(contact_header),"+org.linphone.specs","groupchat"); + if (this->root->linphone_specs && strlen(this->root->linphone_specs) > 0) { + if (belle_sip_parameters_has_parameter(BELLE_SIP_PARAMETERS(contact_header),"+org.linphone.specs") == 0) { + belle_sip_parameters_set_parameter(BELLE_SIP_PARAMETERS(contact_header), "+org.linphone.specs", this->root->linphone_specs); + } } return contact_header; } diff --git a/src/sal/sal.cpp b/src/sal/sal.cpp index 974796253..c87b5e95c 100644 --- a/src/sal/sal.cpp +++ b/src/sal/sal.cpp @@ -395,6 +395,7 @@ Sal::~Sal() { if (this->uuid) ms_free(this->uuid); if (this->root_ca) ms_free(this->root_ca); if (this->root_ca_data) ms_free(this->root_ca_data); + if (this->linphone_specs) ms_free(this->linphone_specs); } void Sal::set_callbacks(const Callbacks *cbs) { @@ -672,6 +673,16 @@ void Sal::use_rport(bool_t use_rports) { ms_message("Sal use rport [%s]", use_rports ? "enabled" : "disabled"); } +void Sal::set_contact_linphone_specs(const char *specs) { + if (this->linphone_specs) { + ms_free(this->linphone_specs); + this->linphone_specs = NULL; + } + if (specs) { + this->linphone_specs = ms_strdup(specs); + } +} + void Sal::set_root_ca(const char* rootCa) { if (this->root_ca) { ms_free(this->root_ca); diff --git a/src/sal/sal.h b/src/sal/sal.h index eece42388..46b1a453e 100644 --- a/src/sal/sal.h +++ b/src/sal/sal.h @@ -170,6 +170,7 @@ public: bctbx_list_t *get_pending_auths() const {return bctbx_list_copy(this->pending_auths);} + void set_contact_linphone_specs(const char *specs); /**********************/ /* Network parameters */ @@ -305,6 +306,7 @@ private: bool_t pending_trans_checking = TRUE; /*testing purpose*/ void *ssl_config = NULL; bctbx_list_t *supported_content_types = NULL; /* list of char* */ + char *linphone_specs = NULL; friend class SalOp; friend class SalCallOp;