Commit feb4630f authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added configuration option for org.linphone.specs contact param

parent 382c22a8
......@@ -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");
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
......
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