|
From: | FEICHTER Christoph |
Subject: | Re: [osip-dev] problem with eXosip_register_build_initial_register_withqvalue |
Date: | Thu, 20 Oct 2016 06:39:41 +0000 |
hi aymeric, thanks for the review and commit. I agree with both of your changes below. I pulled the git – and its fine like this. regards, christoph From: Aymeric Moizard [mailto:address@hidden
Hi Christoph, I have commited the 2 changes and pushed them in the git! About your change: Let me know, if it seems all fine! Regards Aymeric 2016-10-18 12:06 GMT+02:00 FEICHTER Christoph <address@hidden>: hi aymeric, ok, so you use
REMOVE_ELEMENT instead of
eXosip_register_remove, right ? … I am interested in your fix and did a ‘git pull’, but I could not yet find you changes. … probably because you are on travel ;-) btw: there is a similar issue with publications ! here is the suggested fix marked in yellow:
int
eXosip_publish (struct eXosip_t *excontext, osip_message_t * message,
const char *to)
{
osip_transaction_t *transaction;
osip_event_t *sipevent;
int i;
eXosip_pub_t *pub = NULL;
int element_added = FALSE;
if (message == NULL)
return OSIP_BADPARAMETER;
if (message->cseq == NULL || message->cseq->number == NULL) {
osip_message_free (message);
return OSIP_SYNTAXERROR;
}
if (to == NULL) {
osip_message_free (message);
return OSIP_BADPARAMETER;
}
i = _eXosip_pub_find_by_aor (excontext, &pub, to);
if (i != 0 || pub == NULL) {
osip_header_t *expires;
osip_message_get_expires (message, 0, &expires);
if (expires == NULL || expires->hvalue == NULL) {
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: missing expires header in PUBLISH!"));
osip_message_free (message);
return OSIP_SYNTAXERROR;
}
else {
/* start a new publication context */
i = _eXosip_pub_init (excontext, &pub, to, expires->hvalue);
if (i != 0) {
osip_message_free (message);
return i;
}
ADD_ELEMENT (excontext->j_pub, pub);
element_added = TRUE;
}
}
else {
if (pub->p_sip_etag[0] != '\0') {
/* increase cseq */
osip_message_set_header (message,
"SIP-If-Match", pub->p_sip_etag);
}
{
osip_header_t *expires;
osip_message_get_expires (message, 0, &expires);
if (expires == NULL || expires->hvalue == NULL) {
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_ERROR, NULL,
"eXosip: missing expires header in PUBLISH!"));
osip_message_free (message);
return OSIP_SYNTAXERROR;
}
pub->p_period = atoi (expires->hvalue);
}
if (pub->p_last_tr != NULL && pub->p_last_tr->cseq != NULL && pub->p_last_tr->cseq->number != NULL) {
int osip_cseq_num = osip_atoi (pub->p_last_tr->cseq->number);
int length = (int) strlen (pub->p_last_tr->cseq->number);
osip_cseq_num++;
osip_free (message->cseq->number);
message->cseq->number = (char *) osip_malloc (length + 2);
/* +2 like for 9 to 10 */
if (message->cseq->number == NULL) {
osip_message_free (message);
return OSIP_NOMEM;
}
snprintf (message->cseq->number, length + 2,
"%i", osip_cseq_num);
}
}
i = _eXosip_transaction_init (excontext, &transaction, NICT, excontext->j_osip, message);
if (i != 0) {
osip_message_free (message);
if (element_added)
{
REMOVE_ELEMENT (excontext->j_pub, pub);
}
_eXosip_pub_free(excontext->j_pub, pub);
return i;
}
if (pub->p_last_tr != NULL)
osip_list_add (&excontext->j_transactions, pub->p_last_tr, 0);
pub->p_last_tr = transaction;
sipevent = osip_new_outgoing_sipmessage (message);
sipevent->transactionid = transaction->transactionid;
osip_transaction_add_event (transaction, sipevent);
_eXosip_wakeup (excontext);
return transaction->transactionid;
} br, Christoph From: Aymeric
Moizard [mailto:address@hidden]
Hi Chrisptoph, I did a fix in the git. I only remove the context if it was previously created. Also, because we already have the context, I do not call the method "remove" because it would add an extra search. Tks a lot Aymeric 2016-10-17 18:47 GMT+02:00 Aymeric Moizard <address@hidden>: Hi Christophe! I will check the issue later! I'm travelling now. Tks for reporting! Le 17 oct. 2016 8:26 PM, "FEICHTER Christoph" <address@hidden> a écrit :
--
Antisip -
http://www.antisip.com
-- Antisip -
http://www.antisip.com |
[Prev in Thread] | Current Thread | [Next in Thread] |