[Asterisk-code-review] dial.c: Removed dial string 80 character limitation (asterisk[13])

Joshua Colp asteriskteam at digium.com
Tue Mar 31 12:07:02 CDT 2020


Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14065 )

Change subject: dial.c: Removed dial string 80 character limitation
......................................................................

dial.c: Removed dial string 80 character limitation

The dial application had 80 characters of destination length
limitation. But this limitation causes unexpected dial string
cut if the dial string is long.

Removed unnecessary limited buffer to support longer dial
destination.

ASTERISK-27946

Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330
---
M main/dial.c
1 file changed, 3 insertions(+), 11 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved



diff --git a/main/dial.c b/main/dial.c
index ffa4405..95a2499 100644
--- a/main/dial.c
+++ b/main/dial.c
@@ -292,7 +292,6 @@
 /*! \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];
 	struct ast_format_cap *cap_all_audio = NULL;
 	struct ast_format_cap *cap_request;
 	struct ast_format_cap *requester_cap = NULL;
@@ -315,9 +314,6 @@
 		}
 	}
 
-	/* Copy device string over */
-	ast_copy_string(numsubst, channel->device, sizeof(numsubst));
-
 	if (cap && ast_format_cap_count(cap)) {
 		cap_request = cap;
 	} else if (requester_cap) {
@@ -329,7 +325,7 @@
 	}
 
 	/* If we fail to create our owner channel bail out */
-	if (!(channel->owner = ast_request(channel->tech, cap_request, &assignedids, chan, numsubst, &channel->cause))) {
+	if (!(channel->owner = ast_request(channel->tech, cap_request, &assignedids, chan, channel->device, &channel->cause))) {
 		ao2_cleanup(cap_all_audio);
 		return -1;
 	}
@@ -413,7 +409,6 @@
 /*! \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];
 	int res = 1;
 	char forwarder[AST_CHANNEL_NAME];
 
@@ -429,11 +424,8 @@
 		ast_channel_unlock(channel->owner);
 	}
 
-	/* Copy device string over */
-	ast_copy_string(numsubst, channel->device, sizeof(numsubst));
-
 	/* Attempt to actually call this device */
-	if ((res = ast_call(channel->owner, numsubst, 0))) {
+	if ((res = ast_call(channel->owner, channel->device, 0))) {
 		res = 0;
 		ast_hangup(channel->owner);
 		channel->owner = NULL;
@@ -443,7 +435,7 @@
 		}
 		ast_channel_publish_dial(async ? NULL : chan, channel->owner, channel->device, NULL);
 		res = 1;
-		ast_verb(3, "Called %s\n", numsubst);
+		ast_verb(3, "Called %s\n", channel->device);
 	}
 
 	return res;

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I72c8f0319a4b47e8180817a66a7e9bde063cb330
Gerrit-Change-Number: 14065
Gerrit-PatchSet: 3
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200331/6b696597/attachment-0001.html>


More information about the asterisk-code-review mailing list