]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
If dringXcontext is null, fallback to default context value.
authorPaul Belanger <paul.belanger@polybeacon.com>
Tue, 27 Jul 2010 02:57:33 +0000 (02:57 +0000)
committerPaul Belanger <paul.belanger@polybeacon.com>
Tue, 27 Jul 2010 02:57:33 +0000 (02:57 +0000)
(closes issue #17693)
Reported by: iasgoscouk
Patches:
      issue17693.patch uploaded by pabelanger (license 224)
Tested by: iasgoscouk

Review: https://reviewboard.asterisk.org/r/803/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279755 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 0e64fac096cd9315a922aa25d175e52433e07ffd..20accac2689c5625cc812250d4a2decd0f902074 100644 (file)
@@ -1825,8 +1825,8 @@ static int my_distinctive_ring(struct ast_channel *chan, void *pvt, int idx, int
 
                        if (distMatches == 3) {
                                /* The ring matches, set the context to whatever is for distinctive ring.. */
-                               ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
-                               ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
+                               ast_copy_string(p->context, S_OR(p->drings.ringContext[counter].contextData, p->defcontext), sizeof(p->context));
+                               ast_copy_string(chan->context, S_OR(p->drings.ringContext[counter].contextData, p->defcontext), sizeof(chan->context));
                                ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
                                break;
                        }
@@ -10184,8 +10184,8 @@ static void *analog_ss_thread(void *data)
 
                                                        if (distMatches == 3) {
                                                                /* The ring matches, set the context to whatever is for distinctive ring.. */
-                                                               ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
-                                                               ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
+                                                               ast_copy_string(p->context, S_OR(p->drings.ringContext[counter].contextData, p->defcontext), sizeof(p->context));
+                                                               ast_copy_string(chan->context, S_OR(p->drings.ringContext[counter].contextData, p->defcontext), sizeof(chan->context));
                                                                ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
                                                                break;
                                                        }
@@ -10422,8 +10422,8 @@ static void *analog_ss_thread(void *data)
                                                        }
                                                        if (distMatches == 3) {
                                                                /* The ring matches, set the context to whatever is for distinctive ring.. */
-                                                               ast_copy_string(p->context, p->drings.ringContext[counter].contextData, sizeof(p->context));
-                                                               ast_copy_string(chan->context, p->drings.ringContext[counter].contextData, sizeof(chan->context));
+                                                               ast_copy_string(p->context, S_OR(p->drings.ringContext[counter].contextData, p->defcontext), sizeof(p->context));
+                                                               ast_copy_string(chan->context, S_OR(p->drings.ringContext[counter].contextData, p->defcontext), sizeof(chan->context));
                                                                ast_verb(3, "Distinctive Ring matched context %s\n",p->context);
                                                                break;
                                                        }