cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
999
Views
20
Helpful
7
Replies

SIP Copylists, when to use them ?

david.alfaro1
Level 1
Level 1

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:

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/voice/cube/configuration/cube-book/copy_sip_headers.html

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

1 Accepted Solution

Accepted Solutions

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:

  1. Take the value from the TO-header, that was previously stored in the memory through a copy-list
  2. extract some data patterns from it
  3. copy the data into variable u01

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 ---

View solution in original post

7 Replies 7

b.winter
VIP
VIP

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 ---

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

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.



Response Signature


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

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:

  1. Take the value from the TO-header, that was previously stored in the memory through a copy-list
  2. extract some data patterns from it
  3. copy the data into variable u01

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 ---

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

Hi,

 

great to here, that I could help a bit

 

BR