[Asterisk-cvs] asterisk/channels chan_zap.c,1.399,1.400
markster at lists.digium.com
markster at lists.digium.com
Mon Jan 17 06:34:35 CST 2005
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv27355/channels
Modified Files:
chan_zap.c
Log Message:
Merge hold patch (bug #1840)
Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.399
retrieving revision 1.400
diff -u -d -r1.399 -r1.400
--- chan_zap.c 15 Jan 2005 21:51:37 -0000 1.399
+++ chan_zap.c 17 Jan 2005 12:37:55 -0000 1.400
@@ -4406,6 +4406,14 @@
#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 @@
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);
}
More information about the svn-commits
mailing list