diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-26 17:24:17 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-26 17:24:17 +0000 |
commit | 74269bc7b651daefef4383e912fbbb5e7ad1563b (patch) | |
tree | 7a19a54b6a7849de0f87a43f7a83d392a7b9c1b4 /res | |
parent | 950477ef5d0a7b63e3506949a58118fc595dcdc5 (diff) |
Don't try to send a parked call back to itself.
(closes issue #11622, reported by djrodman, patched by me)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94793 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_features.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/res/res_features.c b/res/res_features.c index 865cfd398..1915eae37 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -372,9 +372,8 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, in pu->parkingtime = (timeout > 0) ? timeout : parkingtime; if (extout) *extout = x; - if (!ast_strlen_zero(orig_chan_name)) - ast_copy_string(pu->peername, orig_chan_name, sizeof(pu->peername)); - else if (peer) + + if (peer) ast_copy_string(pu->peername, peer->name, sizeof(pu->peername)); /* Remember what had been dialed, so that if the parking @@ -420,7 +419,7 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, in if (!con) /* Still no context? Bad */ ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con); /* Tell the peer channel the number of the parking space */ - if (peer && ((pu->parkingnum != -1 && ast_strlen_zero(orig_chan_name)) || (strlen(orig_chan_name) == strlen(peer->name) && !strncasecmp(peer->name, orig_chan_name, strlen(peer->name))))) { /* Only say number if it's a number and the channel hasn't been masqueraded away */ + if (peer && ((pu->parkingnum != -1 && ast_strlen_zero(orig_chan_name)) || !strcasecmp(peer->name, orig_chan_name))) { /* Only say number if it's a number and the channel hasn't been masqueraded away */ /* Make sure we don't start saying digits to the channel being parked */ ast_set_flag(peer, AST_FLAG_MASQ_NOSTREAM); ast_say_digits(peer, pu->parkingnum, "", peer->language); @@ -1831,7 +1830,7 @@ static int park_call_exec(struct ast_channel *chan, void *data) res = ast_safe_sleep(chan, 1000); /* Park the call */ if (!res) - res = park_call_full(chan, chan, 0, NULL, orig_chan_name); + res = park_call_full(chan, NULL, 0, NULL, orig_chan_name); ast_module_user_remove(u); |