+ /* A CANCEL must have the same branch as the INVITE that it is canceling.
+ * Similarly, if we need to re-send an INVITE with auth credentials, then we
+ * need to use the same branch as we did the first time we sent the INVITE.
+ */
+ if (sipmethod == SIP_CANCEL || (sipmethod == SIP_INVITE && !ast_strlen_zero(p->options->auth))) {