diff --git a/CHANGES b/CHANGES
index 52f21a01f2..0cd15a9abe 100644
--- a/CHANGES
+++ b/CHANGES
@@ -84,6 +84,7 @@ Dialplan Functions
* Added STRREPLACE function. This function let's the user search a variable
for a given string to replace with another string as many times as the
user specifies or just throughout the whole string.
+ * Added option to CHANNEL(pickupgroup) allow reading and setting the pickupgroup of channel.
libpri channel driver (chan_dahdi) DAHDI changes
--------------------------
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index c428a6d617..202036e84f 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -85,6 +85,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
R/W call groups for call pickup.
+
+ R/W call groups for call pickup.
+
R/O technology used for channel.
@@ -372,6 +375,9 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
} else if (!strcasecmp(data, "callgroup")) {
char groupbuf[256];
locked_copy_string(chan, buf, ast_print_group(groupbuf, sizeof(groupbuf), chan->callgroup), len);
+ } else if (!strcasecmp(data, "pickupgroup")) {
+ char groupbuf[256];
+ locked_copy_string(chan, buf, ast_print_group(groupbuf, sizeof(groupbuf), chan->pickupgroup), len);
} else if (!strcasecmp(data, "amaflags")) {
char amabuf[256];
snprintf(amabuf,sizeof(amabuf), "%d", chan->amaflags);
@@ -457,9 +463,11 @@ static int func_channel_write_real(struct ast_channel *chan, const char *functio
ast_channel_unlock(chan);
new_zone = ast_tone_zone_unref(new_zone);
}
- } else if (!strcasecmp(data, "callgroup"))
+ } else if (!strcasecmp(data, "callgroup")) {
chan->callgroup = ast_get_group(value);
- else if (!strcasecmp(data, "txgain")) {
+ } else if (!strcasecmp(data, "pickupgroup")) {
+ chan->pickupgroup = ast_get_group(value);
+ } else if (!strcasecmp(data, "txgain")) {
sscanf(value, "%4hhd", &gainset);
ast_channel_setoption(chan, AST_OPTION_TXGAIN, &gainset, sizeof(gainset), 0);
} else if (!strcasecmp(data, "rxgain")) {