[asterisk-bugs] [Asterisk 0015680]: [patch] Dynamic mapping between peer and extensions using regexten

Asterisk Bug Tracker noreply at bugs.digium.com
Sat Aug 8 08:19:10 CDT 2009


The following issue has been UPDATED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15680 
====================================================================== 
Reported By:                Flavio
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15680
Category:                   Channels/chan_sip/NewFeature
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 211197 
Request Review:              
====================================================================== 
Date Submitted:             2009-08-08 08:15 CDT
Last Modified:              2009-08-08 08:19 CDT
====================================================================== 
Summary:                    [patch] Dynamic mapping between peer and extensions
using regexten
Description: 
The parameter regexten is really confuse. It creates an extension with the
application Noop in the first priority. While the application of regexten
in the high availability is clear with DUNDI, the user still have to map
manually the extensions to peers in the dialplan. 

The objective of this patch is to allow the dynamic mapping between peers
and extensions. It creates the application Set(PEERNAME=device) in the
first priority instead of Noop, than you might use a construction such as:

Suppose the extensions are numbered from 1000-1999. 

sip.conf
regcontext=sip_autoreg

[device1]
regexten=1000
context=from-internal

[device2]
regexten=1001
context=from-internal

extensions.conf
[from-internal]
include=sip_autoreg
exten=_1XXX,2,Dial(SIP/${PEERNAME})
exten=_1XXX,n,Hangup()

Now with the patch the extension 1000 would be created in the sip_autoreg
context.
exten=1000,1,Set(PEERNAME=device1)
exten=1001,1,Set(PEERNAME=device2)

The advantage is to avoid creating a line for each extension to map the
device name. I tried to avoid the patch as much as possible, reading about
regexten, but I haven't found another way to do the automatic mapping. In
all cases I had to create all the peer mappings manually. Maybe, there is a
better way. 

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-08-08 08:19 Flavio         Summary                  Dynamic mapping between
peer and extensions using regexten => [patch] Dynamic mapping between peer and
extensions using regexten
======================================================================




More information about the asterisk-bugs mailing list