summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-01-17 12:37:55 +0000
committerMark Spencer <markster@digium.com>2005-01-17 12:37:55 +0000
commit840f035827cd7d75d1601c29d731d594afe330d4 (patch)
tree34bc6eb8b0c1666b2821cf4e797a9af81b2477e0 /channels
parent441c545ccc7d81e9d5162e7325f017b1fe5efe97 (diff)
Merge hold patch (bug #1840)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_zap.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 292dfc191..36efc2176 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4406,6 +4406,14 @@ static int zt_indicate(struct ast_channel *chan, int condition)
#endif
res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
break;
+#ifdef ZAPATA_PRI
+ case AST_CONTROL_HOLD:
+ res = pri_notify(p->pri->pri, p->call, p->prioffset, PRI_NOTIFY_REMOTE_HOLD);
+ break;
+ case AST_CONTROL_UNHOLD:
+ res = pri_notify(p->pri->pri, p->call, p->prioffset, PRI_NOTIFY_REMOTE_RETRIEVAL);
+ break;
+#endif
case AST_CONTROL_RADIO_KEY:
if (p->radio)
res = zt_set_hook(p->subs[index].zfd, ZT_OFFHOOK);
@@ -8178,6 +8186,27 @@ static void *pri_dchannel(void *vpri)
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
}
break;
+ case PRI_EVENT_NOTIFY:
+ chanpos = pri_find_principle(pri, e->notify.channel);
+ if (chanpos < 0) {
+ ast_log(LOG_WARNING, "Received NOTIFY on unconfigured channel %d/%d span %d\n",
+ PRI_SPAN(e->notify.channel), PRI_CHANNEL(e->notify.channel), pri->span);
+ } else {
+ struct ast_frame f = { AST_FRAME_CONTROL, };
+ ast_mutex_lock(&pri->pvts[chanpos]->lock);
+ switch(e->notify.info) {
+ case PRI_NOTIFY_REMOTE_HOLD:
+ f.subclass = AST_CONTROL_HOLD;
+ zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ break;
+ case PRI_NOTIFY_REMOTE_RETRIEVAL:
+ f.subclass = AST_CONTROL_UNHOLD;
+ zap_queue_frame(pri->pvts[chanpos], &f, pri);
+ break;
+ }
+ ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+ }
+ break;
default:
ast_log(LOG_DEBUG, "Event: %d\n", e->e);
}