[gnugk-users] using RegexRewrite in Routing::Sql

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

 



Hello,
First time user here. I'm having trouble to get the regex in SQL
routing to work.
The sql itself is working okay, like this:

2018/04/28 21:45:35.741 5              gksql.cxx(323)   Sql
Executing query: (select alias,ip from routes where
prefix=LEFT('8110201',3)) union (select 'reject' ,'ignore' ) Limit 1
2018/04/28 21:45:35.742 5           tlibthrd.cxx(485)   PTLib
Started thread 0x7f7f28010bc0 (1473) Worker:0x7f7f51f67700
2018/04/28 21:45:35.742 5                job.cxx(162)   JOB     Worker
140184812680960 started
2018/04/28 21:45:35.742 5                job.cxx(180)   JOB
Starting Job GkStatus at Worker thread 140184812680960
2018/04/28 21:45:35.796 5            Routing.cxx(2198)  Sql     Query
result : {\1}@aabbcc.com.vn, xxx.39.30.30

but the regex didnt work, so we have this alias:

destinationAddress = 1 entries {
          [0]=url_ID "{\\1}@aabbcc.com.vn"
        }

looking through the code at Routing.cxx, in  SqlPolicy::RunPolicy, I
think the current code  apply regex when returned data only contain
ONE column (like {\1}@aabbcc.com.vn). When 2 columns are returned, the
code didnt check for regex at all. I did modify the code to support
regex when 2 columns returned  (regex alias + ip).

Well it works for me, but not sure if it breaks any intended behavior?
Regards,
Nguyen
_______________________________________________________

Posting: mailto:gnugk-users@xxxxxxxxxxxxxxx
Archive: https://lists.gnugk.org/pipermail/gnugk-users/
Unsubscribe: https://lists.gnugk.org/lists/listinfo/gnugk-users
Homepage: https://www.gnugk.org/




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

  Powered by Linux