Hi Llandry
You don't need to change the dial plans on the phone to do what you want.
You can strip leading digits in the Trunk. It is done in the transformation mask. To strip a 9 use 9: to strip an 8 use 8: to strip either a 9 or an 8 use 9: 8:
You can read about transformation masks in the docs here...
http://www.selintra.com/docs/cgi-bin/view/Main/DocChapter096#Transformation_maskSAIL Outbound Call flow is:- ROUTE->TRUNK->Dial statement.
To handle your 9/8 prefix requirement, - build two routes, one to handle each dial plan. So you might build a route called POTS with a dialplan of _8XXXX. This will pick up any dialled number (more than 4 digits) prefixed with 8. Also in the route, choose the analogue trunk or group as the primary trunk. Now, any number prefixed with 8 will be shunted out through the analogue trunk. Finaly, in the analogue trunk, you can strip the 8 just before the actual dial is done with a transformation mask of 8:
You can do the same thing with 9 in your VOIP trunk.
End result, you dial 85136622300 and it goes out on the analogue trunk as 5136622300.
As an aside you can also nominate a two digit "pre-select" code for each trunk. It also is specified in the trunk definition. When you use the preselect code at the beginning of a dialled number, the Route is ignored and the number is simply shunted onto the selected line with the pre-select digits stripped off. So, if you allocate "98" to your X100P line, you can simply dial 985136622300 and 5136622300 will be shunted out over the X100P.
Finally, because you have full access to asterisk dial syntax in the route, you may find that you can define your dialled numbers without needng to use pre-fixes.
Kind Regards
S