diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-26 15:34:34 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-26 15:34:34 +0000 |
commit | 1f0b4c34e7229e55b615614d4ae7cfe02e89e343 (patch) | |
tree | b0474a6c0be5d70673729b58c6c01fedc752324f /devicestate.c | |
parent | 1423ff5180e4f75a977a6d7511064d2b5d311b2a (diff) |
look for the last '-' in the channel name instead of the first (issue #5514)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6854 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'devicestate.c')
-rwxr-xr-x | devicestate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/devicestate.c b/devicestate.c index fabed739d..086cadbf4 100755 --- a/devicestate.c +++ b/devicestate.c @@ -195,12 +195,13 @@ static void do_state_change(const char *device) static int __ast_device_state_changed_literal(char *buf) { - char *device; - char *parse; + char *device, *tmp; struct state_change *change = NULL; - parse = buf; - device = strsep(&parse, "-"); + device = buf; + tmp = strrchr(device, '-'); + if (tmp) + *tmp = '\0'; if (change_thread != AST_PTHREADT_NULL) change = calloc(1, sizeof(*change) + strlen(device)); |