osip-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [osip-dev] INVITE Server transaction - matching requests


From: Aymeric Moizard
Subject: Re: [osip-dev] INVITE Server transaction - matching requests
Date: Mon, 16 Sep 2013 09:53:57 +0200

Great! It's already commited!

Tks for the report

Sidenote: you didn't answered about which --old-- software you use?

Aymeric



2013/9/16 David Ramirez <address@hidden>
Hi Aymeric,

That's exactly the solution!

Regards,
David


On 11/09/13 21:49, Aymeric Moizard wrote:
Hi David,

I understood your reply and you are right: my patch is wrong.

I obviously didn't understood your initial patch: I though you
proposed to remove the "if" and thus, just skipping the check...

i misread it as you replaced "tr->to" by "tr->orig_request->to" which
is... the way to go!!

I just added NULL check:

    if (0 != osip_to_tag_match (tr->to, request->to))
      return OSIP_UNDEFINED_ERROR;

becomes:

    if (tr->orig_request==NULL || tr->orig_request->to==NULL)
      return OSIP_UNDEFINED_ERROR;
    if (0 != osip_to_tag_match (tr->orig_request->to, request->to))
      return OSIP_UNDEFINED_ERROR;


Do you confirm?
Regards
Aymeric



2013/9/11 David Ramirez <address@hidden>
Hi Aymeric,

This solution won't work. The problem arises when the user has already sent a To-tag response (Status-Code > 100). In that case the osip transaction will have a value in the To tag but incoming INVITE will lack To tag. Let me show you a call flow to explain.

Alice                      Bob
  |      ---> INVITE -->     |
  |       X-  180  < ---     | (At this time Bob generate To tag, but this response is lost)
  |      ---> INVITE -->     | (New INVITE lack To tag)

When the second INVITE reaches Bob osip stack: "tr->to" will have a value and "request->to" won't.
Your proposal won't match in this case.

Regards,
David



On 11/09/13 16:39, Aymeric Moizard wrote:
Hi David,

The text you quoted is for compatibility with old rfc2543!! You still receive INVITE with magic cookie branch?...

So I should replace:

 if (0 != osip_to_tag_match (tr->to, request->to))
      return OSIP_UNDEFINED_ERROR;


WITH:

    osip_generic_param_t *tag_from1;
    osip_generic_param_t *tag_from2;

    osip_from_param_get_byname (tr->to, "tag", &tag_from1);
    osip_from_param_get_byname (request->to, "tag", &tag_from2);
    if (tag_from1 == NULL && tag_from2 == NULL) {
      /*skip when no to tag in both */
    } else if (0 != osip_to_tag_match (tr->to, request->to))
      return OSIP_UNDEFINED_ERROR;

Right?

Regards,
Aymeric

Le 11 sept. 2013 13:49, "David Ramirez" <address@hidden> a écrit :
Hi,

There is a non-compliant behavior when matching INVITE requests in IST state machine.
As stated in RFC3261 17.2.3:
The INVITE request matches a transaction if the Request-URI, To tag,
   From tag, Call-ID, CSeq, and top Via header field match those of the
   INVITE request which created the transaction.

In file "src/osip2/osip_transaction.c" the function you can find the following code:
__osip_transaction_matching_request_osip_to_xist_17_2_3 (osip_transaction_t * tr, osip_message_t * request)
  
  ...
  if (MSG_IS_ACK (request)) {
    [...]
  }
  else {
    if (0 != osip_to_tag_match (tr->to, request->to))
      return OSIP_UNDEFINED_ERROR;

The function osip_to_tag_match() may return a wrong return code when INVITE retransmission is received. The "request->to" will ever be empty (as it is an INVITE request), however "tr->to" may have a value if the user has already sent a response that includes To tag.
The above sentence should be replaced by the following sentence in order to avoid that behaviour:
osip_to_tag_match (tr->orig_request->to, request->to)
This sentence will match, as every INVITE will lack the To tag, and it fits accurately to the RFC.

Regards,
David

--
David Ramírez
Ingeniería
Mantica
Tel.: +34 914 904 103
Móv.: +34 663 82 21 38
Fax: +34 914 903 601
address@hidden
http://www.mantica-solutions.com
Antes de imprimir este mensaje, asegúrese de que es necesario. El medio ambiente está en nuestra mano.
 
AVISO LEGAL
Este mensaje y, en su caso, los ficheros adjuntos, se dirigen exclusivamente a su/s destinatario/s y pueden contener información privilegiada o confidencial. Si no es Vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.
 
CONFIDENTIAL NOTICE
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.

_______________________________________________
osip-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/osip-dev



--
David Ramírez
Ingeniería
Mantica
Tel.: +34 914 904 103
Móv.: +34 663 82 21 38
Fax: +34 914 903 601
address@hidden
http://www.mantica-solutions.com
Antes de imprimir este mensaje, asegúrese de que es necesario. El medio ambiente está en nuestra mano.
 
AVISO LEGAL
Este mensaje y, en su caso, los ficheros adjuntos, se dirigen exclusivamente a su/s destinatario/s y pueden contener información privilegiada o confidencial. Si no es Vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.
 
CONFIDENTIAL NOTICE
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.



--
Antisip - http://www.antisip.com


--
David Ramírez
Ingeniería
Mantica
Tel.: +34 914 904 103
Móv.: +34 663 82 21 38
Fax: +34 914 903 601
address@hidden
http://www.mantica-solutions.com
Antes de imprimir este mensaje, asegúrese de que es necesario. El medio ambiente está en nuestra mano.
 
AVISO LEGAL
Este mensaje y, en su caso, los ficheros adjuntos, se dirigen exclusivamente a su/s destinatario/s y pueden contener información privilegiada o confidencial. Si no es Vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.
 
CONFIDENTIAL NOTICE
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.



--
Antisip - http://www.antisip.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]