Allow MGCP to use distinctive ring for call wait
authorMark Spencer <markster@digium.com>
Mon, 28 Feb 2005 22:26:41 +0000 (22:26 +0000)
committerMark Spencer <markster@digium.com>
Mon, 28 Feb 2005 22:26:41 +0000 (22:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5107 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_mgcp.c

index 4e1995e..f4e443c 100755 (executable)
@@ -872,7 +872,17 @@ static int mgcp_call(struct ast_channel *ast, char *dest, int timeout)
        ast_mutex_lock(&sub->lock);
        switch (p->hookstate) {
        case MGCP_OFFHOOK:
-               snprintf(tone, sizeof(tone), "L/wt");
+               if (distinctive_ring && !ast_strlen_zero(distinctive_ring)) {
+                       snprintf(tone, sizeof(tone), "L/wt%s", distinctive_ring);
+                       if (mgcpdebug) {
+                               ast_verbose(VERBOSE_PREFIX_3 "MGCP distinctive callwait %s\n", tone);
+                       }
+               } else {
+                       snprintf(tone, sizeof(tone), "L/wt");
+                       if (mgcpdebug) {
+                               ast_verbose(VERBOSE_PREFIX_3 "MGCP normal callwait %s\n", tone);
+                       }
+               }
                break;
        case MGCP_ONHOOK:
        default: