[Asterisk-cvs] asterisk/channels chan_zap.c,1.299,1.300
markster at lists.digium.com
markster at lists.digium.com
Sun Jul 18 17:04:35 CDT 2004
Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv6087/channels
Modified Files:
chan_zap.c
Log Message:
Grab the Message-ID too
Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -d -r1.299 -r1.300
--- chan_zap.c 17 Jul 2004 20:58:00 -0000 1.299
+++ chan_zap.c 18 Jul 2004 20:50:37 -0000 1.300
@@ -4972,6 +4972,35 @@
case SIG_FXSLS:
case SIG_FXSGS:
case SIG_FXSKS:
+ if (p->pri) {
+ /* This is a GR-303 trunk actually. Wait for the first ring... */
+ struct ast_frame *f;
+ int res;
+ time_t start;
+
+ time(&start);
+ ast_setstate(chan, AST_STATE_RING);
+ while(time(NULL) < start + 3) {
+ res = ast_waitfor(chan, 1000);
+ if (res) {
+ f = ast_read(chan);
+ if (!f) {
+ ast_log(LOG_WARNING, "Whoa, hangup while waiting for first ring!\n");
+ ast_hangup(chan);
+ return NULL;
+ } else if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_RING)) {
+ res = 1;
+ } else
+ res = 0;
+ ast_frfree(f);
+ if (res) {
+ ast_log(LOG_DEBUG, "Got ring!\n");
+ res = 0;
+ break;
+ }
+ }
+ }
+ }
if (p->use_callerid) {
cs = callerid_new();
if (cs) {
More information about the svn-commits
mailing list