Re: [openh323gk-users] using RegexRewrite in Routing::Sql

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

 



WARNING: You receive this message on the old GnuGk mailinglist
that will go away soon. Please re-subscribe for the new mailinglist at
https://lists.gnugk.org/cgi-bin/mailman/listinfo/gnugk-users

Hi Nguyen,

yes, that seems to be a bug.

Can you please mail me a diff for your change ?

Thanks,
Jan

-- 
Jan Willamowius, Founder of the GNU Gatekeeper Project
EMail  : jan@xxxxxxxxxxxxxx
Website: https://www.gnugk.org
Support: https://www.willamowius.com/gnugk-support.html

Relaxed Communications GmbH
Frahmredder 91
22393 Hamburg
Geschäftsführer: Jan Willamowius
HRB 125261 (Amtsgericht Hamburg)
USt-IdNr: DE286003584

Nguyen Nam wrote:
> 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

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: https://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/openh323gk-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