[Home]

Summary:ASTERISK-16178: [patch] dialplan add failing to create context if context doesn't exist
Reporter:leearcher (leearcher)Labels:
Date Opened:2010-06-01 02:54:00Date Closed:2011-04-04 12:32:07
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) context_auto_create.diff
Description:I was told that contexts will be created as needed when using the dialplan add command but this doesn't seem to be the case.

dialplan add extension 1234,1,NoOp,hello into default Extension '1234,1,NoOp,hello' added into 'default' context
   -- Added extension '1234' priority 1 to default (0x8e8f520)

dialplan add extension 1234,1,NoOp,hello into test Failed to add '1234,1,NoOp,hello' extension into 'test' context

I've tried it with 1.6.1.20 and 1.6.2.7.
Comments:By: Paul Belanger (pabelanger) 2010-06-01 09:23:43

Who told you it would be created?  Where in the documentation do you see it will be created if it does not exist?

By: leearcher (leearcher) 2010-06-01 09:25:31

Tilghman Lesher [tlesher@digium.com] in the users group.

-----Original Message-----
From: asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Tilghman Lesher
Sent: 19 May 2010 16:44
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Adding a context from the console

On Wednesday 19 May 2010 02:28:02 Lee Archer wrote:
> Hi, is it possible to add a context from the console using the
dialplan
> command?

Yes, just add an extension to it.  The context will be created as needed.

--
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode) Check us out at: www.digium.com & www.asterisk.org

By: Paul Belanger (pabelanger) 2010-06-01 10:27:58

Confirmed with Tilghman on #asterisk-bugs.  This should be something Asterisk should handle, but may not exist.

By: Leif Madsen (lmadsen) 2010-06-02 11:02:31

This is technically a feature request, so I'm setting it as such. Might still get merged into releases though as it seems like something that should be supported. I know Kobaz was talking about this today as well.

By: Mark Murawski (kobaz) 2010-06-02 11:31:49

Uploaded patch

By: Mark Murawski (kobaz) 2010-06-02 11:33:42

Whoops.. typo in patch... uploaded new one

By: Mark Murawski (kobaz) 2010-06-02 11:39:08

the patch is against trunk by the way.

By: Leif Madsen (lmadsen) 2010-06-08 10:26:53

This is now Ready for Testing. Please report back on your findings.

By: Mark Murawski (kobaz) 2010-06-08 11:32:39

New patch... ast_add_extension is expecting a const char

By: leearcher (leearcher) 2010-06-11 05:00:32

I've tested it with trunk and the patch does work.  I had initially tried it without the patch which failed and after applying the patch and rebuilding the contexts were created properly.

By: Mark Murawski (kobaz) 2010-06-11 08:17:47

The 'already exists' is probably another bug... I've seen that before...

By: Mark Murawski (kobaz) 2010-08-09 11:48:46

So far, no problems for me testing wise.

By: leearcher (leearcher) 2010-08-09 15:13:28

It's still working fine for me.  I'd say it's ready to be released.

By: leearcher (leearcher) 2010-09-22 02:57:02

Any chance of this being merged in then?

By: Leif Madsen (lmadsen) 2010-10-04 10:49:19

You may want to post this to reviewboard and get a ship it. If that is the case, then I'd be happy to get this merged in for you.

By: leearcher (leearcher) 2010-10-04 10:51:27

Is that something I need to do?

By: Mark Murawski (kobaz) 2010-10-04 11:19:30

Yeah you should put it on the reviewboard.

The current issue status means that it's the time period where the code looks good from initial review, and the official people need to report their feedback from review and testing.  Otherwise it's almost ready to go into mainline.



By: leearcher (leearcher) 2010-12-23 10:38:56.000-0600

How do I go about putting this on the reviewboard then?

By: Mark Murawski (kobaz) 2010-12-23 10:43:55.000-0600

I can add it to the reviewboard since I wrote the patch.

By: leearcher (leearcher) 2011-02-20 07:42:14.000-0600

Hi kobaz, did you post this to the reviewboard?

By: Mark Murawski (kobaz) 2011-02-20 11:59:16.000-0600

Nope, it's not on rb.  I can do that today.

By: Mark Murawski (kobaz) 2011-02-20 23:06:17.000-0600

Updated patch to be against latest trunk.
Reviewboard link: https://reviewboard.asterisk.org/r/1124/

By: Digium Subversion (svnbot) 2011-04-04 12:32:06

Repository: asterisk
Revision: 312678

U   trunk/CHANGES
U   trunk/pbx/pbx_config.c

------------------------------------------------------------------------
r312678 | jrose | 2011-04-04 12:32:05 -0500 (Mon, 04 Apr 2011) | 11 lines

Makes 'dialplan add extension' create the specified context if it does not already exist.

If the user invokes 'dialplan add extension' into a non-existing context, the context will be created
and a message informing the user of the context being created will be issued in cli.

(closes issue ASTERISK-16178)
Reported by: leearcher
Patches:
     context_auto_create.diff uploaded by kobaz (license 834)
Tested by: leearcher, kobaz, jrose

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=312678

By: Ben Langfeld (benlangfeld) 2012-05-17 11:45:29.045-0500

Can this please be back-ported to 1.8, where the bug remains?