Make sure we use new tags for sip register calls (bug #2697)
authorMark Spencer <markster@digium.com>
Tue, 16 Nov 2004 23:18:37 +0000 (23:18 +0000)
committerMark Spencer <markster@digium.com>
Tue, 16 Nov 2004 23:18:37 +0000 (23:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4266 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 3b39310..3481f84 100755 (executable)
@@ -4031,8 +4031,11 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char
                if (!auth) {
                        ast_log(LOG_WARNING, "Already have a call??\n");
                        return 0;
-               } else
+               } else {
                        p = r->call;
+                       p->tag = rand();        /* create a new local tag for every register attempt */
+                       p->theirtag[0]='\0';    /* forget their old tag, so we don't match tags when getting response */
+               }
        } else {
                if (!r->callid_valid) {
                        build_callid(r->callid, sizeof(r->callid), __ourip, default_fromdomain);