Re: LUA scripting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 7, 2012 at 2:16 PM, Robert Kulagowski <rkulagow@xxxxxxxxx> wrote:
> Any pointers on how to use lua to do things?

To expand on this, I'm wondering if Lua is going to assist me.

I have implemented a "flat" dialplan in my company.  Endpoints
register to the GnuGK using countrycode-ISDN-number, so in the U.S.
they're registered as 13125678901, in the UK they're registered as
442072987654, etc.

The issue I run into is that users are used to dialing international
escape codes, even when they don't need them, so a user in the U.S.
may dial 011442072987654 to reach an internal system.

To avoid unnecessary ISDN charges, I wrote a vqueue perl script that's
triggered on 011, 00, 0011 which are the international escape codes
that I see worldwide.

The script takes off the escape code, then does a lookup of the number
that remains, and checks if that number maps to an internal alias.

it then has logic that does this:

rejectRoute is true when we don't want the endpoint to use one of the
ISDN gateways. isAlias is true when we've mapped a dialed ISDN number
to an internal H323-name.

        if ( !$rejectRoute ) {
            if ($isAlias) {
                print "destination alias is $destinationAlias and
destinationIP is $dialedDestination\n";
                print "routetoalias $destinationAlias"." $EP_ID $CRV\n";
                print $sock "routetoalias $destinationAlias"." $EP_ID $CRV\n";
                $sock->getline();
                $isAlias = false;
            }
            else {
                print "routetogateway $destinationAlias $destinationIP
$EP_ID $CRV\n";
                print $sock "routetogateway $destinationAlias
$destinationIP $EP_ID $CRV\n";
                $sock->getline();
            }
        }
        else    #route was rejected, so EP should use its native ISDN
        {
            $rejectRoute = false;
            print "Rejecting route\n";
            print $sock "routereject $EP_ID $CRV\n";
            $sock->getline();
        }
    }
}

Would Lua allow more flexibility in how numbers are manipulated and
rewritten prior to a final routing decision being made by GnuGK?

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/


[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux