Implement pin usage in MeetMe. Bug #816
authorJeremy McNamara <jj@nufone.net>
Mon, 12 Jan 2004 23:21:29 +0000 (23:21 +0000)
committerJeremy McNamara <jj@nufone.net>
Mon, 12 Jan 2004 23:21:29 +0000 (23:21 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1990 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c
apps/app_voicemail.c
sounds.txt

index b1555e9..580ebb5 100755 (executable)
@@ -699,13 +699,36 @@ static int conf_exec(struct ast_channel *chan, void *data)
                                        strcpy(confno, "");
                        } else {
                                if (strlen(cnf->pin)) {
-                                       /* XXX Should prompt user for pin if pin is required XXX */
+                                       char pin[AST_MAX_EXTENSION];
 
+                                       if (inpin && *inpin) {
+                                               strncpy(pin, inpin, sizeof(pin) - 1);
+                                       } else {
+                                               /* Prompt user for pin if pin is required */
+                                               res = ast_app_getdata(chan, "conf-getpin", pin, sizeof(pin) - 1, 0);
+                                       }
+                                       if (res == 0) {
+                                               if (!strcasecmp(pin, cnf->pin)) {
+                                                       /* Pin correct */
+                                                       allowretry = 0;
+                                                       /* Run the conference */
+                                                       res = conf_run(chan, cnf, confflags);
+                                               }
+                                       }
+                                       /* Pin invalid or error */
+                                       res = ast_streamfile(chan, "conf-invalidpin", chan->language);
+                                       if (!res)
+                                               ast_waitstream(chan, "");
+                                       res = -1;
+                                       if (allowretry)
+                                               strcpy(confno, "");
+                               } else {
+                                       /* No pin required */
+                                       allowretry = 0;
+
+                                       /* Run the conference */
+                                       res = conf_run(chan, cnf, confflags);
                                }
-                               allowretry = 0;
-
-                               /* Run the conference */
-                               res = conf_run(chan, cnf, confflags);
                        }
                }
        } while (allowretry);
index 10bd7d8..c1902a0 100755 (executable)
@@ -1467,8 +1467,12 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
                                                myserveremail = vmu->serveremail;
                                        sendpage(myserveremail, vmu->pager, msgnum, ext, chan->callerid, end - start, vmu);
                                }
-                       } else
+                       } else {
+                               res = ast_streamfile(chan, "vm-mailboxfull", chan->language);
+                               if (!res)
+                                       res = ast_waitstream(chan, "");
                                ast_log(LOG_WARNING, "No more messages possible\n");
+                       }
                } else
                        ast_log(LOG_WARNING, "No format for saving voicemail?\n");                                      
                free_user(vmu);
index 924245d..b3acf57 100755 (executable)
 
 %conf-getchannel.gsm%Please enter your channel number followed by the pound key.
 
+%conf-getpin.gsm%Please enter the conference pin number.
+
 %conf-invalid.gsm%That is not a valid conference number.  Please try again.
 
+%conf-invalidpin.gsm%That pin is invalid for this conference.
+
 %conf-onlyperson.gsm%You are currently the only person in this conference.
 
 %demo-abouttotry.gsm%I am about to attempt an Inter-Asterisk Exchange connection to a demonstration server located at Digium.  In order for this to work you must already be connected to the Internet.  Please wait a moment while I attempt to make the connection.