Browse Source

超哥威武

Yu.ding 4 years ago
parent
commit
a11161c797
3 changed files with 46 additions and 23 deletions
  1. 22 12
      apps/app_confbridge.c
  2. 8 0
      apps/app_mixmonitor.c
  3. 16 11
      channels/sip/reqresp_parser.c

+ 22 - 12
apps/app_confbridge.c

@@ -657,7 +657,7 @@ static void send_unmute_event(struct confbridge_user *user, struct confbridge_co
 static void set_rec_filename(struct confbridge_conference *conference, struct ast_str **filename, int is_new)
 {
 	char *rec_file = conference->b_profile.rec_file;
-	char *ext;
+	//char *ext;
     char filename_tmp[RECORD_FILENAME_INITIAL_SPACE];
 	time_t now;
 
@@ -672,26 +672,36 @@ static void set_rec_filename(struct confbridge_conference *conference, struct as
 	ast_str_reset(*filename);
 	if (ast_strlen_zero(rec_file)) {
     	bzero(&filename_tmp, sizeof (filename_tmp));
-		sprintf(filename_tmp,"conf/conference-%s-%u.wav", conference->name,
+		sprintf(filename_tmp,"conference/conference-%s-%u.wav", conference->name,
 			(unsigned int) now);
-		//ast_str_set(filename, 0, "confbridge-%s-%u.wav", conference->name,    //change by dingyu
+		//ast_str_set(filename, 0, "confbridge-%s-%u.wav", conference->name,(unsigned int) now);    //change by dingyu
 		ast_str_set(filename, 0, "%s", filename_tmp);
 	} else {
 		/* insert time before file extension */
+    	bzero(&filename_tmp, sizeof (filename_tmp));
+		strcpy(filename_tmp,rec_file);
+		ast_str_set(filename, 0, "%s", filename_tmp);
+		/*
 		ext = strrchr(rec_file, '.');
 		if (ext) {
-			ast_str_set_substr(filename, 0, rec_file, ext - rec_file);
-			ast_str_append(filename, 0, "-%u%s", (unsigned int) now, ext);
+			//ast_str_set_substr(filename, 0, rec_file, ext - rec_file);    //change by dingyu
+			//ast_str_append(filename, 0, "-%u%s", (unsigned int) now, ext);    //change by dingyu
+			substr(filename_tmp, rec_file, ext - rec_file);
+			sprintf(filename_tmp, "%s-%u%s",filename_tmp, (unsigned int) now, ext);
+			ast_str_set(filename, 0, "%s", filename_tmp);
 		} else {
-			ast_str_set(filename, 0, "%s-%u", rec_file, (unsigned int) now);
-		}
+			sprintf(filename_tmp, "%s-%u", rec_file, (unsigned int) now);
+			ast_str_set(filename, 0, "%s", filename_tmp);
+			//ast_str_set(filename, 0, "%s-%u", rec_file, (unsigned int) now);    //change by dingyu
+		} 
+		*/
 	}
 	if (ast_test_flag(&conference->b_profile, BRIDGE_OPT_RECORD_FILE_APPEND)) {
-		//ast_str_append(filename, 0, ",a");		//change by dingyu
-		ast_str_append(filename, 0, ",a,/etc/scripts/confbridge_storage.sh /var/spool/asterisk/monitor/%s",filename_tmp);
-	}
- 	else{
-		ast_str_append(filename, 0, ",,/etc/scripts/confbridge_storage.sh /var/spool/asterisk/monitor/%s",filename_tmp);
+		ast_str_append(filename, 0, ",a");		//change by dingyu
+//		ast_str_append(filename, 0, ",a,/etc/scripts/confbridge_storage.sh /var/spool/asterisk/monitor/%s",filename_tmp);
+//	}
+// 	else{
+//		ast_str_append(filename, 0, ",,/etc/scripts/confbridge_storage.sh /var/spool/asterisk/monitor/%s",filename_tmp);
 	}
 }
 

+ 8 - 0
apps/app_mixmonitor.c

@@ -654,6 +654,7 @@ static void *mixmonitor_thread(void *obj)
 	char *fs_ext = "";
 	char *fs_read_ext = "";
 	char *fs_write_ext = "";
+    char process_cmd[128];
 
 	struct ast_filestream **fs = NULL;
 	struct ast_filestream **fs_read = NULL;
@@ -773,11 +774,18 @@ static void *mixmonitor_thread(void *obj)
 	/* kill the audiohook */
 	destroy_monitor_audiohook(mixmonitor);
 
+/* record all mximonitor info to database      by dingyu
 	if (mixmonitor->post_process) {
 		ast_verb(2, "Executing [%s]\n", mixmonitor->post_process);
 		ast_safe_system(mixmonitor->post_process);
 	}
+*/
 
+    bzero(&process_cmd, sizeof (process_cmd));
+	sprintf(process_cmd,"/etc/scripts/coopaging_storage.sh %s", mixmonitor->filename);
+	ast_verb(2, "Executing [%s]\n", process_cmd);
+	ast_safe_system(process_cmd);
+	
 	ast_verb(2, "End MixMonitor Recording %s\n", mixmonitor->name);
 	ast_test_suite_event_notify("MIXMONITOR_END", "File: %s\r\n", mixmonitor->filename);
 

+ 16 - 11
channels/sip/reqresp_parser.c

@@ -117,20 +117,25 @@ int parse_uri_full(char *uri, const char *scheme, char **user, char **pass,
 			 * If other parameters would occur before ";phone-context=" they will be ignored.
 			 */
 
-                        *c = '\0';
-                        userinfo = uri;
-                        uri = c + 15;
-			*hostport = uri;
-                } else if ('+' == uri[0]) {
-			/* Global number without context or domain; possibly followed by RFC 3966 and optional other parameters. */
-
-                        userinfo = uri;
+            *c = '\0';
+            userinfo = uri;
+            uri = c + 15;
 			*hostport = uri;
 		} else {
-			ast_debug(1, "No RFC 3966 global number or context found in '%s'; returning local number anyway\n", uri);
-                        userinfo = uri;		/* Return local number anyway */
-			error = -1;
+			userinfo = uri;
+			*hostport = uri;
 		}
+//change by dingyu for <tel:08723096401>;tag=sbc05072fe11f4eeb.rqoryuowwosqs-zqtq (RFC 3966 china mobile IMS)
+//        } else if ('+' == uri[0]) {
+			/* Global number without context or domain; possibly followed by RFC 3966 and optional other parameters. */
+
+//            userinfo = uri;
+//			*hostport = uri;
+//		} else {
+//			ast_debug(1, "No RFC 3966 global number or context found in '%s'; returning local number anyway\n", uri);
+//            userinfo = uri;		/* Return local number anyway */
+//			error = -1;
+//		}
 	} else {
 		char *dom = "";
 		if ((c = strchr(uri, '@'))) {