[asterisk-commits] branch oej/multiparking - r8289 in /team/oej/multiparking: channels/ configs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 19 13:04:36 MST 2006


Author: oej
Date: Thu Jan 19 14:04:34 2006
New Revision: 8289

URL: http://svn.digium.com/view/asterisk?rev=8289&view=rev
Log:
- Add parkinglots to chan_iax
- Add parkinglots to chan_sip
- Add configuration entries

Modified:
    team/oej/multiparking/channels/chan_iax2.c
    team/oej/multiparking/channels/chan_sip.c
    team/oej/multiparking/configs/iax.conf.sample
    team/oej/multiparking/configs/sip.conf.sample

Modified: team/oej/multiparking/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_iax2.c?rev=8289&r1=8288&r2=8289&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_iax2.c (original)
+++ team/oej/multiparking/channels/chan_iax2.c Thu Jan 19 14:04:34 2006
@@ -26,6 +26,8 @@
  * \arg \ref Config_iax
  *
  * \ingroup channel_drivers
+ * 
+ * \todo Implement musicclass settings for IAX2 devices
  */
 
 #include <stdlib.h>
@@ -144,6 +146,7 @@
 static const char channeltype[] = "IAX2";
 
 static char context[80] = "default";
+static char default_parkinglot[AST_MAX_EXTENSION];
 
 static char language[MAX_LANGUAGE] = "";
 static char regcontext[AST_MAX_CONTEXT] = "";
@@ -281,6 +284,7 @@
 	int authmethods;
 	int encmethods;
 	char accountcode[AST_MAX_ACCOUNT_CODE];
+	char parkinglot[AST_MAX_EXTENSION];		/*!< Default parkinglot for device */
 	char inkeys[80];				/*!< Key(s) this user can use to authenticate to us */
 	char language[MAX_LANGUAGE];
 	int amaflags;
@@ -305,6 +309,7 @@
 	char regexten[AST_MAX_EXTENSION];		/*!< Extension to register (if regcontext is used) */
 	char peercontext[AST_MAX_EXTENSION];		/*!< Context to pass to peer */
 	char mailbox[AST_MAX_EXTENSION];		/*!< Mailbox */
+	char parkinglot[AST_MAX_EXTENSION];		/*!< Default parkinglot for device */
 	struct ast_codec_pref prefs;
 	struct ast_dnsmgr_entry *dnsmgr;		/*!< DNS refresh manager */
 	struct sockaddr_in addr;
@@ -585,6 +590,7 @@
 	int calling_pres;
 	char dproot[AST_MAX_EXTENSION];
 	char accountcode[AST_MAX_ACCOUNT_CODE];
+	char parkinglot[AST_MAX_EXTENSION];		/*!< Default parkinglot for device */
 	int amaflags;
 	struct iax2_dpcache *dpentries;
 	struct ast_variable *vars;
@@ -1101,6 +1107,7 @@
 			iaxs[x]->amaflags = amaflags;
 			ast_copy_flags(iaxs[x], (&globalflags), IAX_NOTRANSFER | IAX_USEJITTERBUF | IAX_FORCEJITTERBUF);	
 			ast_copy_string(iaxs[x]->accountcode, accountcode, sizeof(iaxs[x]->accountcode));
+			ast_copy_string(iaxs[x]->parkinglot, default_parkinglot, sizeof(iaxs[x]->parkinglot));
 		} else {
 			ast_log(LOG_WARNING, "Out of resources\n");
 			ast_mutex_unlock(&iaxsl[x]);
@@ -3407,6 +3414,8 @@
 		tmp->cid.cid_tns = i->calling_tns;
 		if (!ast_strlen_zero(i->accountcode))
 			ast_copy_string(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode));
+		if (!ast_strlen_zero(i->parkinglot))
+			ast_copy_string(tmp->parkinglot, i->parkinglot, sizeof(tmp->parkinglot));
 		if (i->amaflags)
 			tmp->amaflags = i->amaflags;
 		ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
@@ -4846,6 +4855,8 @@
 		}
 		if (!ast_strlen_zero(user->accountcode))
 			ast_copy_string(iaxs[callno]->accountcode, user->accountcode, sizeof(iaxs[callno]->accountcode));
+		if (!ast_strlen_zero(user->parkinglot))
+			ast_copy_string(iaxs[callno]->parkinglot, user->parkinglot, sizeof(iaxs[callno]->parkinglot));
 		if (user->amaflags)
 			iaxs[callno]->amaflags = user->amaflags;
 		if (!ast_strlen_zero(user->language))
@@ -8386,6 +8397,8 @@
 				ast_set_flag(user, IAX_HASCALLERID);	
 			} else if (!strcasecmp(v->name, "accountcode")) {
 				ast_copy_string(user->accountcode, v->value, sizeof(user->accountcode));
+			} else if (!strcasecmp(v->name, "parkinglot")) {
+				ast_copy_string(user->parkinglot, v->value, sizeof(user->parkinglot));
 			} else if (!strcasecmp(v->name, "language")) {
 				ast_copy_string(user->language, v->value, sizeof(user->language));
 			} else if (!strcasecmp(v->name, "amaflags")) {
@@ -8586,6 +8599,8 @@
 #ifdef SO_NO_CHECK
 	nochecksums = 0;
 #endif
+	/* Reset default parking lot */
+	default_parkinglot[0] = '\0';
 
 	min_reg_expire = IAX_DEFAULT_REG_EXPIRE;
 	max_reg_expire = IAX_DEFAULT_REG_EXPIRE;
@@ -8735,6 +8750,8 @@
 		} else if (!strcasecmp(v->name, "tos")) {
 			if (ast_str2tos(v->value, &tos))
 				ast_log(LOG_WARNING, "Invalid tos value at line %d, should be 'lowdelay', 'throughput', 'reliability', 'mincost', or 'none'\n", v->lineno);
+		} else if (!strcasecmp(v->name, "parkinglot")) {
+			ast_copy_string(default_parkinglot, v->value, sizeof(default_parkinglot));
 		} else if (!strcasecmp(v->name, "accountcode")) {
 			ast_copy_string(accountcode, v->value, sizeof(accountcode));
 		} else if (!strcasecmp(v->name, "amaflags")) {

Modified: team/oej/multiparking/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_sip.c?rev=8289&r1=8288&r2=8289&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_sip.c (original)
+++ team/oej/multiparking/channels/chan_sip.c Thu Jan 19 14:04:34 2006
@@ -8003,6 +8003,7 @@
 		}
 		ast_cli(fd, "  Context      : %s\n", peer->context);
 		ast_cli(fd, "  Subscr.Cont. : %s\n", ast_strlen_zero(peer->subscribecontext)?"<Not set>":peer->subscribecontext);
+		ast_cli(fd, "  Parking lot  : %s\n", peer->parkinglot);
 		ast_cli(fd, "  Language     : %s\n", peer->language);
 		if (!ast_strlen_zero(peer->accountcode))
 			ast_cli(fd, "  Accountcode  : %s\n", peer->accountcode);

Modified: team/oej/multiparking/configs/iax.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/configs/iax.conf.sample?rev=8289&r1=8288&r2=8289&view=diff
==============================================================================
--- team/oej/multiparking/configs/iax.conf.sample (original)
+++ team/oej/multiparking/configs/iax.conf.sample Thu Jan 19 14:04:34 2006
@@ -275,6 +275,10 @@
 ;rtignoreexpire=yes		; When reading a peer from Realtime, if the peer's registration
 				; has expired based on its registration interval, used the stored
 				; address information regardless. (yes|no)
+
+;parkinglot=edvina		; Default parkinglot for IAX peers and users
+				; This can also be configured per device
+				; Parkinglots are defined in features.conf
 
 ; Guest sections for unauthenticated connection attempts.  Just specify an
 ; empty secret, or provide no secret section.

Modified: team/oej/multiparking/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/configs/sip.conf.sample?rev=8289&r1=8288&r2=8289&view=diff
==============================================================================
--- team/oej/multiparking/configs/sip.conf.sample (original)
+++ team/oej/multiparking/configs/sip.conf.sample Thu Jan 19 14:04:34 2006
@@ -75,6 +75,9 @@
 ;allow=ilbc			; 
 ;musicclass=default		; Sets the default music on hold class for all SIP calls
 				; This may also be set for individual users/peers
+;parkinglot=plaza		; Sets the default parking lot for call parking
+				; This may also be set for individual users/peers
+				; Parkinglots are configured in features.conf
 ;language=en			; Default language setting for all users/peers
 				; This may also be set for individual users/peers
 ;relaxdtmf=yes			; Relax dtmf handling



More information about the asterisk-commits mailing list