Answers in line ---
dial-peer voice 1 voip
destination-pattern 555
session target ipv4:10.10.1.1
dial-peer voice 2 voip
destination-pattern 5551212
session target ipv4:10.10.1.2
if in "two stage dialing" , the dialed string "5551212" will match peer 1
because of the "digit-by-digit" nature, am I right?
if in "DID" mode, dialed string "5551212" will match peer 2, because of the
"longest match rull". am I right?
****In this case when you dial 5551212 it will only match the first 3 digits and the routers will try to place call..
The second question you are correct
The third question "$" never seen used in dial-peer..have a look at the link below should be external. No mention of "$" being used in dial-peer as regular expression.
http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121newft/121t/121t1/dt0390s7.htm
4. When the call is coming from PSTN, if it's in "two-stage-dialing" the number
collecting is "digit-by-digit". if it's in "DID" mode the whole dialed number
is used to match the outbound dial-peer, am I right ?
But if the call is coming from ip network, how is the number collected ?
is it "digit-by-digit" or "the whole number used" ?
*** When the call is coming from IP side the called number comes in a setup message as whole number..
Hope this helps..
Ketan