All pastes #23456 Raw Edit

Unnamed

public text v1 · immutable
#23456 ·published 2005-09-20 18:14 UTC
rendered paste body
diff -u apps/app_valetparking.c.orig apps/app_valetparking.c
--- apps/app_valetparking.c.orig 2005-05-24 21:22:42.000000000 -0500
+++ apps/app_valetparking.c 2005-09-20 13:12:27.000000000 -0500
@@ -24,8 +24,6 @@
 #include <asterisk/translate.h>
 #include <asterisk/say.h>
 #include <asterisk/callerid.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/parking.h>
 #include <asterisk/musiconhold.h>
 #include <asterisk/config.h>
 #include <asterisk/cli.h>
@@ -99,7 +97,8 @@

 static struct valetparkeduser *valetparkinglot;

-static ast_mutex_t valetparking_lock = AST_MUTEX_INITIALIZER;
+/* static ast_mutex_t valetparking_lock = AST_MUTEX_INITIALIZER; */
+AST_MUTEX_DEFINE_STATIC(valetparking_lock);

 static pthread_t valetparking_thread;

@@ -228,6 +227,7 @@

                         pu->chan = chan;
                         /* Start music on hold */
+   ast_say_digits(chan,x, "", chan->language);
                         ast_moh_start(pu->chan, NULL);
                         gettimeofday(&pu->start, NULL);
                         pu->valetparkingnum = x;
@@ -264,10 +264,14 @@
                                                           "Channel: %s\r\n"
                                                           "LotName: %s\r\n"
                                                           "Timeout: %ld\r\n"
+#if MR_T
                                                           "CallerID: %s\r\n"
+#endif
                                                           ,pu->valetparkingnum, pu->chan->name, lotname
                                                           ,(long)pu->start.tv_sec + (long)(pu->valetparkingtime/1000) - (long)time(NULL)
+#if MR_T
                                                           ,(pu->chan->callerid ? pu->chan->callerid : "")
+#endif
                                                           );
                                 return 0;
                 } else {
@@ -330,7 +334,7 @@
                 max = -1;
                 ast_mutex_lock(&valetparking_lock);
                 pl = NULL;
-                pu = valetparkinglot;
+                pu = valetparkinglot;    // valetparkinglot == head-of-list of parked users (pu)
                 gettimeofday(&tv, NULL);
                 FD_ZERO(&nrfds);
                 FD_ZERO(&nefds);
@@ -365,8 +369,10 @@
                         } else {
                                 for (x=0;x<AST_MAX_FDS;x++) {
                                         if ((pu->chan->fds[x] > -1) && (FD_ISSET(pu->chan->fds[x], &rfds) || FD_ISSET(pu->chan->fds[x], &efds))) {
+#if MR_T
                                                 if (FD_ISSET(pu->chan->fds[x], &efds))
                                                         pu->chan->exception = 1;
+#endif
                                                 pu->chan->fdno = x;
                                                 /* See if they need servicing */
                                                 f = ast_read(pu->chan);
@@ -661,9 +667,14 @@
                         ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to Valet Parked call %d in lot %s\n", chan->name, valetpark,lotname);

                 memset(&config,0,sizeof(struct ast_bridge_config));
+#if MR_T
                 config.allowredirect_in = 1;
                 config.allowredirect_out = 1;
                 config.allowdisconnect = 0;
+#else
+  config.features_caller.flags = AST_FEATURE_REDIRECT;
+  config.features_callee.flags = AST_FEATURE_REDIRECT;
+#endif
                 config.timelimit = 0;
                 config.play_warning = 0;
                 config.warning_freq = 0;
@@ -736,11 +747,15 @@
                         "Exten: %d\r\n"
                         "Channel: %s\r\n"
                         "Timeout: %ld\r\n"
+#if MR_T
                         "CallerID: %s\r\n"
+#endif
                         "\r\n"
                         ,cur->valetparkingnum, cur->chan->name
                         ,(long)cur->start.tv_sec + (long)(cur->valetparkingtime/1000) - (long)time(NULL)
+#if MR_T
                         ,(cur->chan->callerid ? cur->chan->callerid : "")
+#endif
                         );

                 cur = cur->next;