Summary:ASTERISK-08992: make the app_dial resources configurable when returning back from a parking timeout
Reporter:Caio Begotti (caio1982)Labels:
Date Opened:2007-03-12 15:31:40Date Closed:2011-06-07 14:08:26
Versions:Frequency of
Environment:Attachments:( 0) asterisk_parkdialoptions_60916.diff
Description:The most interesting part in returning back to the park-dial context after the timeout on parking slots would be to configure the aspect of the next Dial() command executed by Asterisk (automatically). However, it's not possible at the moment thus making this return almost out of control.

It's not that interesting to have the "t" in this dial (right below in the info box) without being able to personalize the other dial options. It would be a really nice improvement for res_features and custom parking :-)

Maybe some extra option like parkingdialopts="30,TtWwKk" to let users and sysadmins configure the timeout and flags of Dial() in the park-dial context?



1573                     if (con) {
1574                         char returnexten[AST_MAX_EXTENSION];
1575                         snprintf(returnexten, sizeof(returnexten), "%s||t", peername);
1576                         ast_add_extension2(con, 1, peername, 1, NULL, NULL, "Dial", strdup(returnexten), ast_free, registrar);
1577                     }
Comments:By: Caio Begotti (caio1982) 2007-03-12 15:32:52

I don't know if it's up for discussion, but in case it is I'm willing to test any patch that enable this behavior :-)

By: Serge Vecher (serge-v) 2007-03-12 15:52:12

bugtracker is not a good place for discussion and feature requests. You can start a thread on the asterisk-dev mailing list or the #asterisk-dev IRC channel.

By: Caio Begotti (caio1982) 2007-03-15 08:25:17

Serge-v, follows my e-mail to the asterisk-dev list which didn't get any reply. I decided to reopen this bug because I really think it's a bug now. Let me know what do you think, please :-)

That's my original e-mail:

Last night I was thinking about that and I realized that actually it may be a bug...

I hope to explain my idea clearly: my extensions and dial strings are dynamic (changes all the time, each user modifying its parameters as they want). Each user has his own set of dial flags, they can be allowed to monitor calls, to activate blind and attended transfer and park calls OR NOT. If I set a given extension to NOT be allowed to make any transfer and I park him, actually the call will return after parking's default timeout to the internal context "park-dial" with this "t" flag. Thus my whole permission system is gone and broken.

I understand that I chose to develop such permission thing but Asterisk has a hard-coded dial option that can bother admins not interested in any kind of transfers being made by his users. I'd even name this a security problem, in the sense Asterisk could not workaround configured permissions.


By: Caio Begotti (caio1982) 2007-03-26 09:34:53

Could someone comment on this so I can figure out whether it's a bug or not? I think it really is a bug but maybe it's not the case to be fixed now.

By: Caio Begotti (caio1982) 2007-04-09 09:58:29

I've uploaded a patch that enables both timeout and dial options when dialing back from a parking timeout. I'm not a real programmer, I just did some copy and paste and then I tested it in my environment (even using Realtime) and it works with trunk.

Some cristicism would be awesome and fixes to the code is needed yet :-)
By the way, I din't know if I had to update anything in "ast_add_extension2".

By: Joshua C. Colp (jcolp) 2007-04-09 10:06:06

Please reply back once you have a disclaimer on file. Thanks! Oh - this would also go into trunk since it's a new feature.

By: Caio Begotti (caio1982) 2007-04-09 11:40:12

Disclaimer sent some minutes ago. Not sure if it was correctly received.

By: Clod Patry (junky) 2007-04-09 11:53:43

I will have a talk with caio on IRC, regarding this.
But it might be a fix to ASTERISK-6769 to handle all this.

By: Caio Begotti (caio1982) 2007-04-09 12:24:12

JunK-Y, after take a look at the "||t" part after returning from the parking command. I'm now using the comebacktoorigin parameter (set to "yes", of course) and it didn't solve my dial options problem in trunk. For me it'd be best to fall through my own dialplan routines so any macro with any dial options would be followed, but that's not happening now.

By the way, the "comebacktoorigin" config isn't documented in features.conf.sample. You may want to fix it in another issue :-)

   -- Executing [s@macro-dial:17] Dial("SIP/5050-08224c88", "SIP/5050|45|TtKk") in new stack
   -- Called 5050
   -- SIP/5050-08245aa0 is ringing
   -- SIP/5050-08245aa0 answered SIP/5050-08224c88
   -- Started music on hold, class 'default', on SIP/5050-08224c88
 == Parked SIP/5050-08224c88 on 701@parkedcalls. Will timeout back to extension [extensions] 5050, 1 in 45 seconds
   -- Added extension '701' priority 1 to parkedcalls
   -- Stopped music on hold on SIP/5050-08224c88
   -- Started music on hold, class 'default', on SIP/5050-08224c88
   -- Stopped music on hold on SIP/5050-08224c88
   -- Started music on hold, class 'default', on SIP/5050-08224c88
   -- Stopped music on hold on SIP/5050-08224c88
   -- Started music on hold, class 'default', on SIP/5050-08224c88
   -- Stopped music on hold on SIP/5050-08224c88
      > cdr_odbc: Query Successful!
 == Spawn extension (macro-dial, s, 1) exited KEEPALIVE in macro 'dial' on 'SIP/5050-08224c88'
 == Spawn extension (macro-dialinexten, s, 12) exited KEEPALIVE in macro 'dialinexten' on 'SIP/5050-08224c88'
 == Spawn extension (extensions, 5050, 1) exited KEEPALIVE on 'SIP/5050-08224c88'
   -- Registered extension context 'park-dial'
   -- Added extension 'SIP/5050' priority 1 to park-dial
 == Timeout for SIP/5050-08224c88 parked on 701. Returning to park-dial,SIP/5050,1
   -- Executing [SIP/5050@park-dial:1] Dial("SIP/5050-08224c88", "SIP/5050||t") in new stack
   -- Called 5050
   -- SIP/5050-08226678 is ringing
   -- Got SIP response 486 "Busy Here" back from
   -- SIP/5050-08226678 is busy
      > cdr_odbc: Query Successful!
 == Everyone is busy/congested at this time (1:1/0/0)
 == Auto fallthrough, channel 'SIP/5050-08224c88' status is 'BUSY'

By: Caio Begotti (caio1982) 2007-04-09 12:28:16

Just to let you know that my 5050 extension in its priority 1 I have this:
'5050' =>         1. Macro(dialinexten|${EXTEN})                [pbx_config]

(that's expanded by a include command in my "extensions" context)

By: Clod Patry (junky) 2007-04-11 12:39:03

Since http://bugs.digium.com/view.php?id=6953 solves exactly that issue.