12-11-2021 05:27 PM - edited 12-11-2021 05:30 PM
Hello Dears,
It might be a fool question, but I got in stuck in this confusion. Usually I have seen, for example, copying headers from a inbound SIP message in an inbound dial-peer, to outbound SIP message in an outbound dial-peer; all of them using sip profiles. I have seen that they are executed some times using a voice class sip-copylist and apply it to the inbound dial-peer and then using a sip profile applied to the outbound dial-peer using the matching peer-header parameter and the sip-header parameter. But in other cases, the former is not present (sip copylist is not used or not needed).
I have been reviewing information about that, but it is not clear for me yet. For example:
So my dude is, what scenarios it is convenient using sip-copylists in, and what other ones it is not necessary using them in.
Best regards
Solved! Go to Solution.
12-13-2021 11:02 PM - edited 12-13-2021 11:03 PM
Like I said, you cannot copy something from one dial-peer to another dial-peer without copy-lists. That's why they are here for.
In your example, you bind sip-profile 1 to a (outgoing) dial-peer, so this sip-profile is always used, when outgoing SIP messages are sent over this dial-peer.
The first rule of the SIP-profile does, if the outgoing message is an INVITE:
The second rule again is used, when the outgoing message is again an INVITE: it just modifies the Request-URI with the data stored in variable u01, within the same outgoing SIP message.
But:
If there is no sip copy-list applied (or it doesn't contain the TO-header for copying) on the incoming dial-peer, then nothing will be stored in the memory for later use --> nothing can be retrieved by the rule 1 in the sip-profile.
Which means, this sip-profile wouldn't do anything.
So, the peer-header parameter in the rules are for retrieving the headers from the memory, that were previously stored by a copy-list (applied to an incoming dial-peer).
If there wasn't any copy-list in use, or the copy-list doesn't store the needed headers, then the memory has no data of the headers --> no data to retrieve.
--- Please rate this post as "Helpful" or accept as a solution, if your question has been answered ---
12-13-2021 12:37 AM - edited 12-13-2021 12:38 AM
Hi,
if you want to copy data from an incoming message to an outgoing message, then you need a copy-list. It copies any inbound header into the internal memory, for later use in outbound SIP-profiles (content is only stored, until the next outbound SIP message. If an outbound SIP message was sent, the content is flushed)
You cannot achieve this scenario with sip-profiles alone.
With a sip-profile, you can only copy / modify / add / remove something within a message (e.g. copy the number from the PAI into the FROM header, add a custom header, remove any unwanted headers, ...)
--- Please rate this post as "Helpful" or accept as a solution, if your question has been answered ---
12-13-2021 08:15 AM
Hello b.winter,
Thanks for your answer,
I am aware about copy-list is needed to copy something from an inbound SiP message and then applying it in the outbound SIP message,
The problem is that in some scenarios, for example there is just a SIP Profile configured which copies the value from the incoming dial peer for example
Device# voice class sip-profiles 1
!Copy the To header from the incoming dial peer into variable u01:
Device(config-class)# request INVITE peer-header sip TO copy “sip:(.*)@” u01
!Modify the outgoing SIP Invite with this variable:
Device(config-class)# request INVITE sip-header SIP-Req-URI modify “.*@(.*)” “INVITE sip:\u01@\1″
Then, apply the SIP profile to the outgoing dial peer.
Device(config)# dial-peer voice 99 voip
Device(config-dial-peer)# outgoing to CUCM
Device(config-dial-peer)# destination-pattern 02555555.
Device(config-dial-peer)# session protocol sipv2
Device(config-dial-peer)# session target ipv4:10.1.2.3
!Applying SIP profile to the dial peer
Device(config-dial-peer)# voice-class sip profiles 1
Device(config-dial-peer)# voice-class code 1
Device(config-dial-peer)# dtmf-relay rtp-nte
Device(config-dial-peer)# no vad
Thus I see that the first rule
"request INVITE peer-header sip TO copy “sip:(.*)@” u01" does all of the necessary to copy anything from (.*) to a variable u01 from de inbound SIP, and next the second rule " request INVITE sip-header SIP-Req-URI modify “.*@(.*)” “INVITE sip:\u01@\1" " apply the u01 content in the outbound SIP. And finally, this two rules, by mean of the sip profile 1, are applied to the outgoing dial peer; so my questions is, what is the reason to be to use an additional voice class copylist, which is the stuff that I do not understand, if sip-profile 1 is doing all, assuming that the word "peer-header sip" in the first sentence of the sip-profile 1 is matching the respective inbound dial-peer. So I am confused yet.
Kind regards
12-13-2021 10:32 AM
I think with a copy list you can copy more fields than with just a profile and you have the ability to copy information from one field to another.
12-13-2021 03:49 PM - edited 12-13-2021 03:51 PM
Hello Robert,
Yea, I could not agree more with you. You can use a voice class sip-copylist <tag>, and issue more than one sip-header sentences for each header you would want.
The problem is when for example if in a outbound dial-peer sip-profile the sentence " request INVITE peer-header sip From copy "<sip:(.*)@" u01 ", I do no have idea wheter the "peer-header sip" parameter is doing the same of a "voice class sip-copylist <tag> ● sip-header From", or wheter or not it is mandatory to include the "voice class sip-copylist <tag>" to support the outbond dial-peer sip-profile having the "peer-header sip" parameter in the statement, because I understand tha the sip-profile statement having the "peer-header sip" is matching the outbound and inbound dial-peers, and then I am unable to understand if the "voice class sip-copylist <tag>" have any sense. Furthermore, even it is possible to issue several sentences with several variables u0n in a sip-profile using the same n statements with the "peer-header sip parameter", and I am not able to understand a scenario where there is a vitaly mandatory using of the sip-copylist.
Kind regards
12-13-2021 11:02 PM - edited 12-13-2021 11:03 PM
Like I said, you cannot copy something from one dial-peer to another dial-peer without copy-lists. That's why they are here for.
In your example, you bind sip-profile 1 to a (outgoing) dial-peer, so this sip-profile is always used, when outgoing SIP messages are sent over this dial-peer.
The first rule of the SIP-profile does, if the outgoing message is an INVITE:
The second rule again is used, when the outgoing message is again an INVITE: it just modifies the Request-URI with the data stored in variable u01, within the same outgoing SIP message.
But:
If there is no sip copy-list applied (or it doesn't contain the TO-header for copying) on the incoming dial-peer, then nothing will be stored in the memory for later use --> nothing can be retrieved by the rule 1 in the sip-profile.
Which means, this sip-profile wouldn't do anything.
So, the peer-header parameter in the rules are for retrieving the headers from the memory, that were previously stored by a copy-list (applied to an incoming dial-peer).
If there wasn't any copy-list in use, or the copy-list doesn't store the needed headers, then the memory has no data of the headers --> no data to retrieve.
--- Please rate this post as "Helpful" or accept as a solution, if your question has been answered ---
12-14-2021 08:32 AM
Hi b.winter,
I am so grateful to you, your explanation is clear.
Unfortunately the documentation is a bit vague, and I didn't find how sip-profile and copylist get complement each other.
However, with your explanation it is already understandable enough. Many thanks.
Kind regards
12-14-2021 10:36 PM
Hi,
great to here, that I could help a bit
BR
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide