[asterisk-commits] mattf: branch mattf/asterisk-ss7 r42354 - /team/mattf/asterisk-ss7/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Sep 7 16:12:21 MST 2006


Author: mattf
Date: Thu Sep  7 18:12:20 2006
New Revision: 42354

URL: http://svn.digium.com/view/asterisk?rev=42354&view=rev
Log:
Add support for SS7 ISUP progress events (send and receive) CPG

Modified:
    team/mattf/asterisk-ss7/channels/chan_zap.c

Modified: team/mattf/asterisk-ss7/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/channels/chan_zap.c?rev=42354&r1=42353&r2=42354&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/channels/chan_zap.c (original)
+++ team/mattf/asterisk-ss7/channels/chan_zap.c Thu Sep  7 18:12:20 2006
@@ -5167,7 +5167,19 @@
 				}
 				p->alerting = 1;
 			}
-#endif
+
+#endif
+#ifdef HAVE_SS7
+			if ((!p->alerting) && (p->sig == SIG_SS7) && p->ss7 && !p->outgoing && (chan->_state != AST_STATE_UP)) {
+				if (p->ss7->ss7) {
+					ss7_grab(p, p->ss7);
+					isup_cpg(p->ss7->ss7, p->ss7call, CPG_EVENT_ALERTING);
+					p->alerting = 1;
+					ss7_rel(p->ss7);
+				}
+			}
+#endif
+
 			res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_RINGTONE);
 			if (chan->_state != AST_STATE_UP) {
 				if ((chan->_state != AST_STATE_RING) ||
@@ -5190,6 +5202,17 @@
 						ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
 				}
 				p->proceeding = 1;
+			}
+#endif
+#ifdef HAVE_SS7
+			if (!p->proceeding && p->sig==SIG_SS7 && p->ss7 && !p->outgoing) {
+				if (p->ss7->ss7) {
+					ss7_grab(p, p->ss7);
+					isup_cpg(p->ss7->ss7, p->ss7call, CPG_EVENT_INBANDINFO);
+					p->proceeding = 1;
+					ss7_rel(p->ss7);
+
+				}
 			}
 #endif
 			/* don't continue in ast_indicate */
@@ -8268,11 +8291,39 @@
 			case MTP2_LINK_UP:
 				ast_log(LOG_DEBUG, "MTP2 link up\n");
 				break;
+			case ISUP_EVENT_CPG:
+				chanpos = ss7_find_cic(linkset, e->cpg.cic);
+				if (chanpos < 0) {
+					ast_log(LOG_WARNING, "CPG on unconfigured CIC %d\n", e->cpg.cic);
+					break;
+				}
+				p = linkset->pvts[chanpos];
+				ast_mutex_lock(&p->lock);
+				switch (e->cpg.event) {
+				case CPG_EVENT_ALERTING:
+					p->alerting = 1;
+					p->subs[SUB_REAL].needringing = 1;
+					break;
+				case CPG_EVENT_PROGRESS:
+				case CPG_EVENT_INBANDINFO:
+					{
+						struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
+						ast_log(LOG_DEBUG, "Queuing frame PROGRESS on CIC %d\n", p->cic);
+						zap_queue_frame(p, &f, ss7);
+						p->progress = 1;
+					}
+					break;
+				default:
+					ast_log(LOG_DEBUG, "Do not handle CPG with event type 0x%x\n", e->cpg.event);
+				}
+
+				ast_mutex_unlock(&p->lock);
+				break;
 			case ISUP_EVENT_RSC:
 				ast_verbose("Resetting CIC %d\n", e->rsc.cic);
 				chanpos = ss7_find_cic(linkset, e->rsc.cic);
 				if (chanpos < 0) {
-					ast_log(LOG_WARNING, "RSC on unconfigured CIC %d\n", e->iam.cic);
+					ast_log(LOG_WARNING, "RSC on unconfigured CIC %d\n", e->rsc.cic);
 					break;
 				}
 				p = linkset->pvts[chanpos];



More information about the asterisk-commits mailing list