aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-17 12:37:55 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-17 12:37:55 +0000
commitc78d9df51eade074509d76f119780a8fcee35fc9 (patch)
tree34bc6eb8b0c1666b2821cf4e797a9af81b2477e0 /channels
parent8f16ca10695470c3283716b19816baf7d9f21746 (diff)
Merge hold patch (bug #1840)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4823 f38db490-d61c-443f-a65b-d21fe96a405b
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);
}