Skip to content

Conversation

@Parantido
Copy link
Contributor

  • Rules preload/translate alghoritm reworked: no more needs to have different buckets for REGEXP and BEST MATCH ones. All rules belong from same bucket. This way opens to many different scenarios and future development without afflicting performances (this rework will also fix issue Wrong rule selected in dialplan translation when both string and regexp rules are matched #696 Wrong rule selected in dialplan translation when both string and regexp rules are matched #696).

  • New "match_var" database column introduced. This column will override "src/dest" dp_translate parameter when filled. It respects same syntax (wrong syntax will cause rule to being discarded at preload time).

  • New "matched_pvar" AVP introduced. It will be filled with last matched rule id. AVP name can be set by modparam directive:

    modparam("dialplan", "matched_pvar", "$avp(dp_ruleid)")
    
  • New "continue_search" database column introduced. When filled to "1", rule matching will continue through other rules. ATTRS and MATCHED_PVAR will be updated as soon as rule matches (next rule match will works on PVAR updated values). After a dp_translate ATTRS and MATCHED_PVAR will be updated with last rule match values.

…SIPS#794)

    Rules preload/translate alghoritm reworked: no more needs to have different buckets for REGEXP and BEST MATCH ones. All rules belong from same bucket. This way opens to many different scenarios and future development without afflicting performances (this rework will also fix issue OpenSIPS#696 OpenSIPS#696).
    New "match_var" database column introduced. This column will override "src/dest" dp_translate parameter when filled. It respects same syntax (wrong syntax will cause rule to being discarded at preload time).

    New "matched_pvar" AVP introduced. It will be filled with last matched rule id. AVP name can be set by modparam directive:

    modparam("dialplan", "matched_pvar", "$avp(dp_ruleid)")

    New "continue_search" database column introduced. When filled to "1", rule matching will continue through other rules. ATTRS and MATCHED_PVAR will be updated as soon as rule matches (next rule match will works on PVAR updated values). After a dp_translate ATTRS and MATCHED_PVAR will be updated with last rule match values.

All new features and code rework default behaviour respects old syntaxes. No database entries or opensips.cfg scripts needs to be changed on module
upgrade
@Parantido
Copy link
Contributor Author

Sorry I totally missed database schema

CREATE TABLE IF NOT EXISTS dialplan (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
dpid int(11) unsigned DEFAULT NULL,
pr int(11) NOT NULL,
match_op int(11) NOT NULL,
match_exp char(64) NOT NULL,
match_flags int(11) DEFAULT NULL,
match_len int(11) NOT NULL,
subst_exp char(64) NOT NULL,
repl_exp char(32) NOT NULL,
disabled int(11) NOT NULL DEFAULT '0',
attrs char(32) DEFAULT NULL,
timerec varchar(255) NOT NULL DEFAULT '',
match_var char(32) DEFAULT NULL,
continue_search tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (id),
);

@Parantido
Copy link
Contributor Author

Hi staff,

sorry for bugging you, I just would to know if logical approach used in related code relase was good for you.

If so I've other features to add.

Thank you

@bogdan-iancu bogdan-iancu added this to the 2.2 milestone Mar 3, 2016
@bogdan-iancu bogdan-iancu self-assigned this Mar 3, 2016
@bogdan-iancu
Copy link
Member

Hi @Parantido, does this PR obsolete #794 ?

@Parantido
Copy link
Contributor Author

Hi @bogdan-iancu I made same changes done in 2.2 (dev) in 2.1 also (stable).
Is this wrong?

@bogdan-iancu
Copy link
Member

@Parantido , 2.1 is a stable version only bug fixes are accepted. New features or improvements go only into devel version.
So we need to close this PR and follow only the one for 2.2 devel version

@Parantido
Copy link
Contributor Author

Ok, understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants