[asterisk-dev] To-tag checks in chan_sip 1.8

Walter Doekes walter+asterisk-dev at osso.nl
Mon Nov 18 09:35:17 CST 2013


On 18/11/13 15:39, Olle E. Johansson wrote:
> Someone (I can't track the change down in svn here) changed the to-tag handling in chan_sip to this:
>
> /* Get their tag if we haven't already */
>          if (ast_strlen_zero(p->theirtag) || (resp >= 200)) {
>                  char tag[128];
>
>                  gettag(req, "To", tag, sizeof(tag));
>                  ast_string_field_set(p, theirtag, tag);
>          } else {
>                  /* Store theirtag to track for changes when 200 responses to invites are received without SDP */
>                  ast_string_field_set(p, theirprovtag, p->theirtag);
>          }

The code on top was there since the dawn of time:

>   1383   markster       /* Get their tag if we haven't already */
>   6576   markster       if (ast_strlen_zero(p->theirtag) || (resp >= 200)) {
>   7797  kpfleming               char tag[128];
>   7797  kpfleming
>   7797  kpfleming               gettag(req, "To", tag, sizeof(tag));
>   7797  kpfleming               ast_string_field_set(p, theirtag, tag);
>   1383   markster       }

The else bit was added here:

> https://reviewboard.asterisk.org/r/2827/diff/


Cheers,
Walter



More information about the asterisk-dev mailing list