aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_softhangup.c
diff options
context:
space:
mode:
authordhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b>2009-09-02 01:49:53 +0000
committerdhubbard <dhubbard@f38db490-d61c-443f-a65b-d21fe96a405b>2009-09-02 01:49:53 +0000
commit81241f8ae9de588c66ad2134defd18bc2ccc2f1a (patch)
treefccee9d0983545001d2502da9205ef74cdc8ed72 /apps/app_softhangup.c
parent55c0455b5224dd76b3349c9a712b2d86000eed70 (diff)
Merged revisions 215338 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r215338 | dhubbard | 2009-09-01 20:16:59 -0500 (Tue, 01 Sep 2009) | 18 lines Merged revisions 215270 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r215270 | dhubbard | 2009-09-01 18:04:52 -0500 (Tue, 01 Sep 2009) | 12 lines Use strrchr() so SoftHangup will correctly truncate multi-hyphen channel names In general channel names are in the form Foo/Bar-Z, but the channel name could have multiple hyphens and look like Foo/B-a-r-Z. Use strrchr to truncate the channel name at the last hyphen. (closes issue #15810) Reported by: dhubbard Patches: dw-softhangup-1.4.patch uploaded by dhubbard (license 733) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@215376 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_softhangup.c')
-rw-r--r--apps/app_softhangup.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/app_softhangup.c b/apps/app_softhangup.c
index a7ba753fd..c4297cd2e 100644
--- a/apps/app_softhangup.c
+++ b/apps/app_softhangup.c
@@ -99,11 +99,13 @@ static int softhangup_exec(struct ast_channel *chan, void *data)
ast_copy_string(name, c->name, sizeof(name));
if (ast_test_flag(&flags, OPTION_ALL)) {
/* CAPI is set up like CAPI[foo/bar]/clcnt */
- if (!strcmp(c->tech->type, "CAPI"))
+ if (!strcmp(c->tech->type, "CAPI")) {
cut = strrchr(name, '/');
/* Basically everything else is Foo/Bar-Z */
- else
- cut = strchr(name, '-');
+ } else {
+ /* use strrchr() because Foo/Bar-Z could actually be Foo/B-a-r-Z */
+ cut = strrchr(name,'-');
+ }
/* Get rid of what we've cut */
if (cut)
*cut = 0;