Summary:ASTERISK-13037: The Extension field of the Newexten event shows the actual extension even if that in the dial plan involves a pattern
Reporter:Hira Agrawal (hagrawal)Labels:
Date Opened:2008-11-07 14:12:28.000-0600Date Closed:2011-06-07 14:02:50
Versions:Frequency of
Description:The Newexten event has three attributes -- context, extension, and priority -- that uniquely identify the exact location in the dialplan from where the corresponding application was invoked. If, however, the extension specified in the dialplan involves a wildcard pattern, the Newexten event returns the actual extension involved, not the pattern specified in the dialplan. Consider, for example, the following dialplan fragment:

  exten => _NXX.,1,Playback(message1)
  exten => _ZXX.,1,Playback(message2)
  exten => _XXX.,1,Playback(message3)

When I receive a Newexten event that corresponds of one of these Playback invocations, I want to know which of these three three Playback invocations caused that event. Determining this manually is not that difficult in this simple case, but in general it can be quite tricky and the application I am working on needs to automate this determination.

If the current behavior is intentional, is there a way to determine the corresponding wildcard pattern when a NewExten event involves one? If not, can you please add another field to the Newexten event, say "Pattern", that returns the corresponding pattern?

Any fix/help/suggestions/pointers would be greatly appreciated.


Even though I am using version of Asterisk, I suspect this behavior is present in other versions as well.
Comments:By: Jason Parker (jparker) 2008-11-19 17:29:34.000-0600

Showing the actual extension is intended behavior.

Adding the pattern would be a feature request, which shouldn't be handled here.  I would suggest the asterisk-dev mailing list, or publishing a bounty to have it written.