Dial Plan Breakdown

Been searching the forum for a question such as this but wasn’t really sure what to look up. And haven’t seen any dial plans on the web with quite what I need, but I am wanting to know if it is possible to have asterisk breakdown different parts of a number entered into a softphone such as X-lite.

To clarify a little more, what I mean is if I dialed: *4149724443456 I would want asterisk to use the *4 to come to this particular context, enter the 14 into the user field of the CDR and then actually dial the number 9724443456. So this one series of numbers entered into x-lite would be broken up into three basic parts. [*4][14][9724443456]

Just FYI, what I’m trying to do is implement a click-to-call function in a call center environment. I have been able to send phone #'s from a sip url to x-lite, but now trying to also link individual records to my call details. Any help, ideas, or explianation anyone could provide would be greatly appreciated.

you can use ${EXTEN:cut:offset}…

on your demo number *4149724443456

${EXTEN:0:2} would return *4
${EXTEN:2:2} should return 14
${EXTEN:4} will return everything minus the first 4 digits, ie 9724443456

this of course requires extens to match the same pattern where the first 2 digits are context, second two are account and everything else is the exten…

Thanks.