[Asterisk-code-review] dial.c: Added AST_MAX_DIAL_ADDR constant (asterisk[master])

sungtae kim asteriskteam at digium.com
Thu Mar 26 17:27:50 CDT 2020


sungtae kim has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14033 )


Change subject: dial.c: Added AST_MAX_DIAL_ADDR constant
......................................................................

dial.c: Added AST_MAX_DIAL_ADDR constant

The dial application had a 80 character of destination length
limitation. But this limitation was wrong and made a problem if
the destination is long.

Added the proper constant and set the max length to 1024.

Change-Id: I8a419591ff22f2c82afba14f5e01f87d189e4857

ASTERISK-27946

Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330
---
M include/asterisk/dial.h
M main/dial.c
2 files changed, 8 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/33/14033/1

diff --git a/include/asterisk/dial.h b/include/asterisk/dial.h
index 168c509..0d25a1a 100644
--- a/include/asterisk/dial.h
+++ b/include/asterisk/dial.h
@@ -38,6 +38,12 @@
 
 typedef void (*ast_dial_state_callback)(struct ast_dial *);
 
+#ifdef LOW_MEMORY
+#define AST_MAX_DIAL_ADDR     80    /*!< Max length of a destination dial address */
+#else
+#define AST_MAX_DIAL_ADDR     1024  /*!< Max length of a destination dial address */
+#endif
+
 /*! \brief List of options that are applicable either globally or per dialed channel */
 enum ast_dial_option {
 	AST_DIAL_OPTION_RINGING,                 /*!< Always indicate ringing to caller */
diff --git a/main/dial.c b/main/dial.c
index d0492dc..f6cea7d 100644
--- a/main/dial.c
+++ b/main/dial.c
@@ -331,7 +331,7 @@
 /*! \brief Helper function that requests all channels */
 static int begin_dial_prerun(struct ast_dial_channel *channel, struct ast_channel *chan, struct ast_format_cap *cap, const char *predial_string)
 {
-	char numsubst[AST_MAX_EXTENSION];
+	char numsubst[AST_MAX_DIAL_ADDR];
 	struct ast_format_cap *cap_all_audio = NULL;
 	struct ast_format_cap *cap_request;
 	struct ast_format_cap *requester_cap = NULL;
@@ -454,7 +454,7 @@
 /*! \brief Helper function that does the beginning dialing per-appended channel */
 static int begin_dial_channel(struct ast_dial_channel *channel, struct ast_channel *chan, int async, const char *predial_string, struct ast_channel *forwarder_chan)
 {
-	char numsubst[AST_MAX_EXTENSION];
+	char numsubst[AST_MAX_DIAL_ADDR];
 	int res = 1;
 	char forwarder[AST_CHANNEL_NAME];
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14033
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330
Gerrit-Change-Number: 14033
Gerrit-PatchSet: 1
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200326/4a05f2d8/attachment-0001.html>


More information about the asterisk-code-review mailing list