l can't see to get the Lua extension matching to work: [Oct 23 19:13:12] NOTICE[4288]: chan_sip.c:23577 handle_request_invite: Call from 'user' (XXX.XXX.XXX.XXX:33962) to extension '107' rejected because extension not found in context 'luaentry'. extensions = {} extensions.luaentry = {} extensions.luaentry["_NXX"] = function(c,e) return app.goto("ael-dial-exten", e, 1); end Shouldn't _NXX match 107? I also tried: extensions = { ["luaentry"] = { ["NXX"] = function(c,e) app.verbose("Redirecting to internal extension") return app.goto("ael-dial-exten", e, 1); end; ["_1NXXNXXXXXX"] = function(c,e) internalDialOut(e) end; ["_NXXNXXXXXX"] = function(c,e) internalDialOut("1"..e) end; i = function() app.playback("invalid") app.hangup() end; }; }; And that didn't work either. Any tips or tricks? My users.conf looks like: [503] fullname = Cody Harris email = qbasicer at gmail.com secret = XXXXXX vmsecret = XXXX context = luaentry hasvoicemail = yes callwaiting = yes hasip = yes qualify=yes nat=yes host=dynamic canreinvite=no -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20121023/7a36a531/attachment.htm>
Sorry for the reply so quick, I should mention I'm running on 10.9.0 On Tue, Oct 23, 2012 at 3:15 PM, Cody Harris <qbasicer at gmail.com> wrote:> l can't see to get the Lua extension matching to work: > > [Oct 23 19:13:12] NOTICE[4288]: chan_sip.c:23577 handle_request_invite: > Call from 'user' (XXX.XXX.XXX.XXX:33962) to extension '107' rejected > because extension not found in context 'luaentry'. > > extensions = {} > extensions.luaentry = {} > extensions.luaentry["_NXX"] = function(c,e) > return app.goto("ael-dial-exten", > e, 1); > end > > > Shouldn't _NXX match 107? > > I also tried: > > extensions = { > ["luaentry"] = { > ["NXX"] = function(c,e) > app.verbose("Redirecting to internal extension") > return app.goto("ael-dial-exten", e, 1); > end; > ["_1NXXNXXXXXX"] = function(c,e) > internalDialOut(e) > end; > ["_NXXNXXXXXX"] = function(c,e) > internalDialOut("1"..e) > end; > i = function() > app.playback("invalid") > app.hangup() > end; > }; > }; > > And that didn't work either. > > Any tips or tricks? > > My users.conf looks like: > > [503] > fullname = Cody Harris > email = qbasicer at gmail.com > secret = XXXXXX > vmsecret = XXXX > context = luaentry > hasvoicemail = yes > callwaiting = yes > hasip = yes > qualify=yes > nat=yes > host=dynamic > canreinvite=no > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20121023/58ccb7dd/attachment.htm>
Richard Mudgett
2012-Oct-23 19:32 UTC
[asterisk-users] Can't get Lua Pattern Matching to work
> l can't see to get the Lua extension matching to work: > > > > [Oct 23 19:13:12] NOTICE[4288]: chan_sip.c:23577 > handle_request_invite: Call from 'user' (XXX.XXX.XXX.XXX:33962) to > extension '107' rejected because extension not found in context > 'luaentry'. > > > > extensions = {} > extensions.luaentry = {} > extensions.luaentry["_NXX"] = function(c,e) > return app.goto("ael-dial-exten", e, 1); > end > > > > > Shouldn't _NXX match 107?No. I wouldn't expect it to match 107. X Matches any single digit from 0 to 9. Z Matches any single digit from 1 to 9. N Matches any single digit from 2 to 9. Richard