Merged revisions 290375 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r290375 | dvossel | 2010-10-05 14:54:50 -0500 (Tue, 05 Oct 2010) | 10 lines
  
  Fixes PickupChan() not working with full channel name.
  
  (closes issue #18011)
  Reported by: schern
  Patches:
        app_directed_pickup.c.2.patch uploaded by schern (license 995)
        app_directed_pickup.c.trunk.patch uploaded by schern (license 995)
  Tested by: schern, dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.6
David Vossel 15 years ago
parent bba086cfd6
commit 2a2b6a96d4

@ -179,18 +179,24 @@ static struct ast_channel *my_ast_get_channel_by_name_locked(const char *channam
char *chkchan; char *chkchan;
struct pickup_by_name_args pickup_args; struct pickup_by_name_args pickup_args;
pickup_args.len = strlen(channame) + 1; /* Check if channel name contains a '-'.
* In this case the channel name will be interpreted as full channel name.
chkchan = alloca(pickup_args.len + 1);
/* need to append a '-' for the comparison so we check full channel name,
* i.e SIP/hgc- , use a temporary variable so original stays the same for
* debugging.
*/ */
strcpy(chkchan, channame); if (strchr(channame, '-')) {
strcat(chkchan, "-"); /* check full channel name */
pickup_args.len = strlen(channame);
pickup_args.name = chkchan; pickup_args.name = channame;
} else {
/* need to append a '-' for the comparison so we check full channel name,
* i.e SIP/hgc- , use a temporary variable so original stays the same for
* debugging.
*/
pickup_args.len = strlen(channame) + 1;
chkchan = alloca(pickup_args.len + 1);
strcpy(chkchan, channame);
strcat(chkchan, "-");
pickup_args.name = chkchan;
}
return ast_channel_callback(pickup_by_name_cb, NULL, &pickup_args, 0); return ast_channel_callback(pickup_by_name_cb, NULL, &pickup_args, 0);
} }

Loading…
Cancel
Save