[Home]

Summary:ASTERISK-03424: [patch] fix incompatibility with phone switch (pridialplan=dynamic)
Reporter:raarts (raarts)Labels:
Date Opened:2005-02-11 14:47:28.000-0600Date Closed:2008-01-15 15:26:48.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) dialplan.patch
( 1) dialplan-2.patch
Description:At a customers' location I could only dial out to local
numbers. Any longdistance or international number got
rejected.

****** ADDITIONAL INFORMATION ******

I recently encountered a phone switch that *required*
asterisk to dynamically adjust pridialplan and
prilocaldialplan depending if you call a local, national
or international number. I could not get KPN to change
settings in the switch, as this 'would affect all 40000
subscribers on the switch'.

So I created a patch that enables setting the pridialplan
settings to dynamic. It uses the nationalprefix
and international prefix to check where we are dialing
out to, strips that prefix from the phone number and
sets pridialplan and prilocaldialplan accordingly for
that call.

This patch is tested to work on BRI lines, but I think
it will work on PRI too.

This is the first patch I submit, I will fax the waiver
after the weekend.
Comments:By: raarts (raarts) 2005-02-11 14:50:40.000-0600

I forgot to mention that part of this patch was also
sent to kapejod so it may be included in bri-stuff as well.

By: Mark Spencer (markster) 2005-02-11 17:22:16.000-0600

This looks great.  Just a few things:

1) Please use C style comments, not C++ style comments (i.e. no //'s)

2) I recommend that pridialplan be set to "-1" rather than "0" when you choose dynamic mode due to the .

3) You may need to abstract pri_plan2str to be able to know about this dynamic version.

Then as soon as we get your disclaimer we can merge this.  Nicely done and thought through!

By: raarts (raarts) 2005-02-11 17:51:10.000-0600

Sorry, forgot about the comment requirement.

What do you mean "when you choose dynamic mode due to the ." ?

I thought the dynamic option would also make a nice default,
for when you don't specify pridialplan or prilocaldialplan.

On the other hand you always will need nationalprefix and
internationalprefix when using dynamic, so it wouldn't be much
of a default.

Okay, I'll submit a new patch later on.

By: Mark Spencer (markster) 2005-02-12 12:42:08.000-0600

Sorry I didn't complete the thought in #2 :)

When we have channels that are part of a PRI, we check to see if settings have been specified and if they have, and are then changed, we warn the user.  If you use "0" for dynamic, then we would not warn a user if they declared some channels as dynamic and some as another dialplan.

By: Tilghman Lesher (tilghman) 2005-02-13 08:32:35.000-0600

Out of curiosity, without this patch, does the system work correctly with pridialplan=unknown?  This is how other people have solved the problem with switches that pay attention to this field.

By: raarts (raarts) 2005-02-13 18:30:54.000-0600

No, it didn't, calls were being rejected even when set to unknown.
Lost a week trying to convince KPN to change their settings, because
kapejod told me he knew of one other case like this in
the Netherlands, and in that case KPN changed them.
In my case they wouldn't, so I created this patch.

By: raarts (raarts) 2005-02-18 10:09:53.000-0600

My disclaimer should be on file now.

By: Mark Spencer (markster) 2005-03-02 00:17:23.000-0600

This patch still seems to use 0 in some places and -1 in others to refer to dynamic mode, and also uses "//" comments in some places still.   Other than that i think we're about there.

By: raarts (raarts) 2005-03-03 10:09:58.000-0600

Sorry, I thought I already uploaded the new version.
Here it is.

By: raarts (raarts) 2005-03-03 10:11:47.000-0600

Maybe if I use another filename?

By: Mark Spencer (markster) 2005-03-03 11:03:23.000-0600

Added to CVS head, thanks!

By: Russell Bryant (russell) 2005-03-09 12:43:53.000-0600

not included in 1.0 since it is a new feature

By: Digium Subversion (svnbot) 2008-01-15 15:26:48.000-0600

Repository: asterisk
Revision: 5129

U   trunk/channels/chan_zap.c

------------------------------------------------------------------------
r5129 | markster | 2008-01-15 15:26:47 -0600 (Tue, 15 Jan 2008) | 2 lines

Add dynamic dialplan support (bug ASTERISK-3424)

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

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