set callid more early, add option to disable uuid (to reduce message size)

This commit is contained in:
Jehan Monnier 2013-07-12 09:04:10 +02:00
parent 0386daaecf
commit 89f3e2ceda
3 changed files with 13 additions and 4 deletions

View file

@ -205,6 +205,7 @@ static int _sal_op_send_request_with_contact(SalOp* op, belle_sip_request_t* req
belle_sip_provider_t* prov=op->base.root->prov;
belle_sip_uri_t* outbound_proxy=NULL;
belle_sip_header_contact_t* contact;
int result =-1;
_sal_op_add_custom_headers(op, (belle_sip_message_t*)request);
@ -264,7 +265,14 @@ static int _sal_op_send_request_with_contact(SalOp* op, belle_sip_request_t* req
/*hmm just in case we already have authentication param in cache*/
belle_sip_provider_add_authorization(op->base.root->prov,request,NULL,NULL);
}
return belle_sip_client_transaction_send_request_to(client_transaction,outbound_proxy/*might be null*/);
result = belle_sip_client_transaction_send_request_to(client_transaction,outbound_proxy/*might be null*/);
/*update call id if not set yet for this OP*/
if (result == 0 && !op->base.call_id) {
op->base.call_id=ms_strdup(belle_sip_header_call_id_get_call_id(BELLE_SIP_HEADER_CALL_ID(belle_sip_message_get_header_by_type(BELLE_SIP_MESSAGE(request), belle_sip_header_call_id_t))));
}
return result;
}
@ -519,7 +527,7 @@ bool_t sal_op_get_body(SalOp *op, belle_sip_message_t *msg, SalBody *salbody){
salbody->size=belle_sip_header_content_length_get_content_length(clen);
return TRUE;
}
memset(salbody,0,sizeof(salbody));
memset(salbody,0,sizeof(SalBody));
return FALSE;
}
void sal_op_set_privacy(SalOp* op,SalPrivacyMask privacy) {

View file

@ -1230,7 +1230,7 @@ static void misc_config_read (LinphoneCore *lc) {
char tmp[64];
sal_create_uuid(lc->sal,tmp,sizeof(tmp));
lp_config_set_string(config,"misc","uuid",tmp);
}else
}else if (strcmp(uuid,"0")!=0) /*to allow to disable sip.instance*/
sal_set_uuid(lc->sal, uuid);
}

View file

@ -40,7 +40,8 @@ static PayloadType * find_payload_type_best_match(const MSList *l, const Payload
for (elem=l;elem!=NULL;elem=elem->next){
pt=(PayloadType*)elem->data;
/* the compare between G729 and G729A is for some stupid uncompliant phone*/
if ( (strcasecmp(pt->mime_type,refpt->mime_type)==0 ||
if ( pt->mime_type && refpt->mime_type &&
(strcasecmp(pt->mime_type,refpt->mime_type)==0 ||
(strcasecmp(pt->mime_type, "G729") == 0 && strcasecmp(refpt->mime_type, "G729A") == 0 ))
&& pt->clock_rate==refpt->clock_rate){
candidate=pt;