[svn-commits] tilghman: branch 1.4 r123113 - /branches/1.4/channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 16 14:50:12 CDT 2008


Author: tilghman
Date: Mon Jun 16 14:50:12 2008
New Revision: 123113

URL: http://svn.digium.com/view/asterisk?view=rev&rev=123113
Log:
Port "hasvoicemail" change from SIP to other channel drivers

Modified:
    branches/1.4/channels/chan_dahdi.c
    branches/1.4/channels/chan_h323.c
    branches/1.4/channels/chan_iax2.c
    branches/1.4/channels/chan_mgcp.c
    branches/1.4/channels/chan_skinny.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=123113&r1=123112&r2=123113
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Mon Jun 16 14:50:12 2008
@@ -10656,7 +10656,7 @@
 /** The length of the parameters list of 'dahdichan'. 
  * \todo Move definition of MAX_CHANLIST_LEN to a proper place. */
 #define MAX_CHANLIST_LEN 80
-static int process_dahdi(struct dahdi_chan_conf *confp, struct ast_variable *v, int reload, int skipchannels)
+static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct ast_variable *v, int reload, int skipchannels)
 {
 	struct dahdi_pvt *tmp;
 	char *ringc; /* temporary string for parsing the dring number. */
@@ -10736,6 +10736,10 @@
 				confp->chan.dtmfrelax = 0;
 		} else if (!strcasecmp(v->name, "mailbox")) {
 			ast_copy_string(confp->chan.mailbox, v->value, sizeof(confp->chan.mailbox));
+		} else if (!strcasecmp(v->name, "hasvoicemail")) {
+			if (ast_true(v->value) && ast_strlen_zero(confp->chan.mailbox)) {
+				ast_copy_string(confp->chan.mailbox, cat, sizeof(confp->chan.mailbox));
+			}
 		} else if (!strcasecmp(v->name, "adsi")) {
 			confp->chan.adsi = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "usesmdi")) {
@@ -11425,7 +11429,7 @@
 	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
 
 	v = ast_variable_browse(cfg, "channels");
-	res = process_dahdi(&conf, v, reload, 0);
+	res = process_dahdi(&conf, "", v, reload, 0);
 	ast_mutex_unlock(&iflock);
 	ast_config_destroy(cfg);
 	if (res)
@@ -11434,7 +11438,7 @@
 	if (cfg) {
 		char *cat;
 		const char *chans;
-		process_dahdi(&conf, ast_variable_browse(cfg, "general"), 1, 1);
+		process_dahdi(&conf, "", ast_variable_browse(cfg, "general"), 1, 1);
 		for (cat = ast_category_browse(cfg, NULL); cat ; cat = ast_category_browse(cfg, cat)) {
 			if (!strcasecmp(cat, "general"))
 				continue;
@@ -11443,7 +11447,7 @@
 				struct dahdi_chan_conf sect_conf;
 				memcpy(&sect_conf, &conf, sizeof(sect_conf));
 
-				process_dahdi(&sect_conf, ast_variable_browse(cfg, cat), reload, 0);
+				process_dahdi(&sect_conf, cat, ast_variable_browse(cfg, cat), reload, 0);
 			}
 		}
 		ast_config_destroy(cfg);

Modified: branches/1.4/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_h323.c?view=diff&rev=123113&r1=123112&r2=123113
==============================================================================
--- branches/1.4/channels/chan_h323.c (original)
+++ branches/1.4/channels/chan_h323.c Mon Jun 16 14:50:12 2008
@@ -1489,6 +1489,10 @@
 			peer->ha = ast_append_ha(v->name, v->value, peer->ha);
 		} else if (!strcasecmp(v->name, "mailbox")) {
 			ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
+		} else if (!strcasecmp(v->name, "hasvoicemail")) {
+			if (ast_true(v->value) && ast_strlen_zero(peer->mailbox)) {
+				ast_copy_string(peer->mailbox, name, sizeof(peer->mailbox));
+			}
 		}
 	}
 	ASTOBJ_UNMARK(peer);

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=123113&r1=123112&r2=123113
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Mon Jun 16 14:50:12 2008
@@ -9347,6 +9347,10 @@
 				ast_string_field_set(peer, secret, v->value);
 			} else if (!strcasecmp(v->name, "mailbox")) {
 				ast_string_field_set(peer, mailbox, v->value);
+			} else if (!strcasecmp(v->name, "hasvoicemail")) {
+				if (ast_true(v->value) && ast_strlen_zero(peer->mailbox)) {
+					ast_string_field_set(peer, mailbox, name);
+				}
 			} else if (!strcasecmp(v->name, "mohinterpret")) {
 				ast_string_field_set(peer, mohinterpret, v->value);
 			} else if (!strcasecmp(v->name, "mohsuggest")) {

Modified: branches/1.4/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_mgcp.c?view=diff&rev=123113&r1=123112&r2=123113
==============================================================================
--- branches/1.4/channels/chan_mgcp.c (original)
+++ branches/1.4/channels/chan_mgcp.c Mon Jun 16 14:50:12 2008
@@ -3728,6 +3728,10 @@
 				canreinvite = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mailbox")) {
 				ast_copy_string(mailbox, v->value, sizeof(mailbox));
+			} else if (!strcasecmp(v->name, "hasvoicemail")) {
+				if (ast_true(v->value) && ast_strlen_zero(mailbox)) {
+					ast_copy_string(mailbox, gw->name, sizeof(mailbox));
+				}
 			} else if (!strcasecmp(v->name, "adsi")) {
 				adsi = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "callreturn")) {

Modified: branches/1.4/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_skinny.c?view=diff&rev=123113&r1=123112&r2=123113
==============================================================================
--- branches/1.4/channels/chan_skinny.c (original)
+++ branches/1.4/channels/chan_skinny.c Mon Jun 16 14:50:12 2008
@@ -2202,6 +2202,10 @@
 				cancallforward = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mailbox")) {
 				ast_copy_string(mailbox, v->value, sizeof(mailbox));
+			} else if (!strcasecmp(v->name, "hasvoicemail")) {
+				if (ast_true(v->value) && ast_strlen_zero(mailbox)) {
+					ast_copy_string(mailbox, cat, sizeof(mailbox));
+				}
 			} else if (!strcasecmp(v->name, "callreturn")) {
 				callreturn = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "callwaiting")) {




More information about the svn-commits mailing list