vasan Posted January 2, 2009 Report Share Posted January 2, 2009 Hello When we dail a 6 digit number I want to delete 3 digits and send the remainig 3 digits to different trunks. E.g 501110 delete 501 and send 110 to trunk1 501111 delete 501 and send 111 to trunk1 501112 delete 501 and send 112 to trunk2 501113 delete 501 and send 113 to trunk2 501123 delete 501 and send 123 to trunk3 Is this ok for trunk1 Pattern 50111([0-1])* Replacement 11* and repeat similarly for the rest of the trunks or there is a better way to do it. Thanks Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted January 3, 2009 Report Share Posted January 3, 2009 When we dail a 6 digit number I want to delete 3 digits and send the remainig 3 digits to different trunks. E.g 501110 delete 501 and send 110 to trunk1 501111 delete 501 and send 111 to trunk1 501112 delete 501 and send 112 to trunk2 501113 delete 501 and send 113 to trunk2 501123 delete 501 and send 123 to trunk3 Is this ok for trunk1 Pattern 50111([0-1])* Replacement 11* and repeat similarly for the rest of the trunks or there is a better way to do it. I would use pattern 501xxx and no replacement. Or use 501([0-9]{3}), no replacement. Quote Link to comment Share on other sites More sharing options...
vasan Posted January 3, 2009 Author Report Share Posted January 3, 2009 I would use pattern 501xxx and no replacement. Or use 501([0-9]{3}), no replacement. If I use 501xxx all 501xxx calls will be routed to say trunk1 How to diffrentiate 501110 and 501111 to trunk 1 501112 and 501113 to trunk 2 thanks Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted January 3, 2009 Report Share Posted January 3, 2009 If I use 501xxx all 501xxx calls will be routed to say trunk1 How to diffrentiate 501110 and 501111 to trunk 1 501112 and 501113 to trunk 2 thanks You can still use ERE. For example 501([0-9]{2}[01]) will match 501xx0 and 501xx1 (and return the last three digits). ERE are very flexible, though not so easy to read. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.