summaryrefslogtreecommitdiffstats
path: root/main/asterisk-audio-konf/0001-add-n-flag-to-prevent-dynamic-create-of-conference.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-08 16:32:13 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-06-08 16:32:46 +0300
commite12859824cf0593ceeb9acae9d30d5a99aa2d031 (patch)
tree017a8e3ba4e874cf538aedde0de7adc8e3ff5b54 /main/asterisk-audio-konf/0001-add-n-flag-to-prevent-dynamic-create-of-conference.patch
parenta42d0a4b6cba74ec312b433cd83511bcb2241618 (diff)
downloadaports-e12859824cf0593ceeb9acae9d30d5a99aa2d031.tar.bz2
aports-e12859824cf0593ceeb9acae9d30d5a99aa2d031.tar.xz
main/asterisk-audio-konf: moved from testing
Diffstat (limited to 'main/asterisk-audio-konf/0001-add-n-flag-to-prevent-dynamic-create-of-conference.patch')
-rw-r--r--main/asterisk-audio-konf/0001-add-n-flag-to-prevent-dynamic-create-of-conference.patch151
1 files changed, 151 insertions, 0 deletions
diff --git a/main/asterisk-audio-konf/0001-add-n-flag-to-prevent-dynamic-create-of-conference.patch b/main/asterisk-audio-konf/0001-add-n-flag-to-prevent-dynamic-create-of-conference.patch
new file mode 100644
index 000000000..115c42fa2
--- /dev/null
+++ b/main/asterisk-audio-konf/0001-add-n-flag-to-prevent-dynamic-create-of-conference.patch
@@ -0,0 +1,151 @@
+From 2040c4ebe42ed6a222b87f0148c0c08701afc2fd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Mon, 7 Jun 2010 14:20:42 +0300
+Subject: [PATCH] add 'n' flag to prevent dynamic create of conference
+
+---
+ konference/Dialplan.txt | 2 ++
+ konference/conference.c | 27 ++++++++++++++++++---------
+ konference/conference.h | 2 +-
+ konference/member.c | 12 +++++++-----
+ konference/member.h | 3 +++
+ 5 files changed, 31 insertions(+), 15 deletions(-)
+
+diff --git a/konference/Dialplan.txt b/konference/Dialplan.txt
+index 455703d..17287dd 100644
+--- a/konference/Dialplan.txt
++++ b/konference/Dialplan.txt
+@@ -45,6 +45,8 @@ exten => <ext>,<pri>,Konference(<confname>,<flags>,<optional args>,<more optiona
+ 'r' : record the conference. it will be recorded to KONFERENCE_RECORDINGFILE with the format KONFERENCE_RECORDINGFORMAT
+ default for KONFERENCE_RECORDINGFILE is: konference-{conference-name}-{member-uniqueid}
+ default for KONFERENCE_RECORDINGFORMAT is: wav
++ 'n' : do not create new conference, only join existing ones.
++ if conference does not exist KONFERENCE is set to NOTFOUND
+
+ Future development (these are not implemented yet):
+ ?
+diff --git a/konference/conference.c b/konference/conference.c
+index 9790d2e..98fed28 100644
+--- a/konference/conference.c
++++ b/konference/conference.c
+@@ -620,7 +620,7 @@ void init_conference( void )
+ argument_delimiter = ( !strcmp(PACKAGE_VERSION,"1.4") ? "|" : "," ) ;
+ }
+
+-struct ast_conference* join_conference( struct ast_conf_member* member, char* max_users_flag, const char* recfile, const char *recformat )
++struct ast_conference* join_conference( struct ast_conf_member* member, const char* recfile, const char *recformat )
+ {
+ struct ast_conference* conf = NULL ;
+
+@@ -634,15 +634,25 @@ struct ast_conference* join_conference( struct ast_conf_member* member, char* ma
+ // unable to find an existing conference, try to create one
+ if ( conf == NULL )
+ {
+- // create a new conference
+- DEBUG("attempting to create requested conference\n") ;
++ if ( member->no_create_flag )
++ {
++ DEBUG("conference not found, and create of new conference not allowed\n") ;
++ pbx_builtin_setvar_helper(member->chan, "KONFERENCE", "NOTFOUND");
++ }
++ else
++ {
++ // create a new conference
++ DEBUG("attempting to create requested conference\n") ;
+
+- // create the new conference with one member
+- conf = create_conf( member->conf_name, member ) ;
++ // create the new conference with one member
++ conf = create_conf( member->conf_name, member ) ;
+
+- // return an error if create_conf() failed
+- if ( conf == NULL )
+- ast_log( LOG_ERROR, "unable to find or create requested conference\n" ) ;
++ // return an error if create_conf() failed
++ if ( conf == NULL ) {
++ ast_log( LOG_ERROR, "unable to find or create requested conference\n" ) ;
++ pbx_builtin_setvar_helper(member->chan, "KONFERENCE", "NORESOURCES");
++ }
++ }
+ }
+ else
+ {
+@@ -656,7 +666,6 @@ struct ast_conference* join_conference( struct ast_conf_member* member, char* ma
+ add_member( member, conf ) ;
+ } else {
+ pbx_builtin_setvar_helper(member->chan, "KONFERENCE", "MAXUSERS");
+- *max_users_flag = 1;
+ conf = NULL;
+ }
+ }
+diff --git a/konference/conference.h b/konference/conference.h
+index 3322f3f..e8da836 100644
+--- a/konference/conference.h
++++ b/konference/conference.h
+@@ -157,7 +157,7 @@ int hash( const char *channel_name ) ;
+
+ int count_exec( struct ast_channel* chan, void* data ) ;
+
+-struct ast_conference* join_conference( struct ast_conf_member* member, char* max_users_flag, const char* recfile, const char* recformat ) ;
++struct ast_conference* join_conference( struct ast_conf_member* member, const char* recfile, const char* recformat ) ;
+
+ int end_conference( const char *name, int hangup ) ;
+
+diff --git a/konference/member.c b/konference/member.c
+index c18fcdc..ff93b36 100644
+--- a/konference/member.c
++++ b/konference/member.c
+@@ -758,14 +758,13 @@ int member_exec( struct ast_channel* chan, void* data )
+ // setup a conference for the new member
+ //
+
+- char max_users_flag = 0 ;
+- conf = join_conference( member, &max_users_flag, recfile, recformat ) ;
++ conf = join_conference( member, recfile, recformat ) ;
+
+ if ( conf == NULL )
+ {
+- ast_log( LOG_NOTICE, "unable to setup member conference %s: max_users_flag is %d\n", member->conf_name, max_users_flag ) ;
++ ast_log( LOG_NOTICE, "unable to setup member conference %s\n", member->conf_name) ;
+ delete_member( member) ;
+- return (max_users_flag ? 0 : -1 ) ;
++ return -1;
+ }
+
+ //
+@@ -1349,7 +1348,7 @@ struct ast_conf_member* create_member( struct ast_channel *chan, const char* dat
+ else
+ #endif
+ {
+- // allowed flags are C, c, L, l, V, D, A, C, X, r, R, T, t, M, S, z, o, F, H
++ // allowed flags are C, c, L, l, V, D, A, C, X, r, R, T, t, M, S, z, o, F, H, n
+ // mute/no_recv options
+ switch ( flags[i] )
+ {
+@@ -1405,6 +1404,9 @@ struct ast_conf_member* create_member( struct ast_channel *chan, const char* dat
+ case 'M':
+ member->ismoderator = 1;
+ break;
++ case 'n':
++ member->no_create_flag = 1;
++ break;
+ #ifdef VIDEO
+ case 'N':
+ member->no_camera = 1;
+diff --git a/konference/member.h b/konference/member.h
+index 0f9005b..28eff6b 100644
+--- a/konference/member.h
++++ b/konference/member.h
+@@ -105,6 +105,9 @@ struct ast_conf_member
+ // wait option flag
+ char wait_for_moderator_flag;
+
++ // creation of new conference not allowed
++ char no_create_flag;
++
+ // temp flag for when star is pressed
+ char star_pressed;
+
+--
+1.7.0.4
+