Sip provider during incoming call to our branch office sends our number like email@example.com in To field. And waits this symbols such ANI during outgoing call from our office.
As I understand the only incoming dial-peer matching this symbols is dial-peer with incoming called number "."
After it I cam manipulate this header on CUBE (firstname.lastname@example.org--->email@example.com) and after it translate number to CUCM.
But what is the order of operations such like this?
In debug voip ccapi inout I can see incoming but I can't see outgoing dial-peer. And I can't find any information about manipulation of headers with letters and numbers in fields.
What can I do with incomning/outgoing dial-peers? Are there any examples?
The REQUEST URI (top line of the SIP INVITE) is what is used to route the call. The debug voip ccapi should show what number it is trying to process when it matches the inbound dial-peer. It is possible that it doesn't see an outbound match for the number being processed. I can't tell you much more with out seeing the debug.
As mentioned by Nathan. You don't need to worry about TO header to route calls. You should be looking at Request URI (the start line) for routing calls.
Can you check the format of the Request URI and see how it looks and which dialpeer will it match. Usually the normalization rules are applied after you match an inbound dialpeer which they are associated with.
Ok, as I can see in debug voip ccapi inout :
Called Number=12345$localcity(TON=Unknown, NPI=Unknown), in pcap file in request-uri I also see
12345$localcity as request-uri user part.
The only matching dial-peer for this as incoming is ".", what shouls I do the next? I need to manipulate this header to move it to outgoing dial-peer and manipulate number from 12345$localcity to numerical 12345?
Try this config on your CUBE
voice class sip-profiles 101
request INVITE sip-header SIP-Req-URI modify "(.*)$localcity(.*)" "\1\2"
request REINVITE sip-header SIP-Req-URI modify "(.*)$localcity(.*)" "\1\2"
dial-peer voice x voip
voice-class sip profiles 101
incoming called-number .
CUBE gateways typically drop the text portion automatically, so it should try to route on "12345". It is hard to tell with out full debug text. There is usually a portion of this debug where it looks for an outgoing dial-peer and says no match found.