Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Changing the Source URI for outbound calls using VCS Expressway X8.2

Hello All,

I would appreciate a little assistance on a CPL script I am working on. I have been through all of the Support Community examples and I am still struggling. 

We are running on VCS X8.2.  From what I have read, VCS X8.1 has introduced some new CPL capabilities including CPL location node supports regex-based source alias rewriting.  I would like to take advantage of this new feature. I am looking for a tutorial or more advanced direction with examples using this new capability.

 

Here is an overview of my issue:

I have an internal domain "CompanyA.local" and I have a public domain "CompanyA.com". My Cisco Video Endpoints register to VCS Control with a SIP URI of "Endpoint@CompanyA.local".


I receive calls from outside using "Endpoint@CompanyA.com"  and with search rules, I route the calls correctly internally.

 

When I dial an external company, my endpoint is showing a Video SIP URI of "Endpoint@CompanyA.local"

Obviously, this is not a dial-able SIP URI and needs to be changed to "Endpoint@CompanyA.com".

I know this can be achieved using CPL, however I have not used this capability previously.
Any assistance would be appreciated.

 

Please suggest a CPL example script I can review.

I would like to use Regex to cover all of my endpoints similar to the following:

                    source-url-for-message-regex="(.*)@CompanyA.local"
                    source-url-for-message-replace="\1@CompanyA.com"

 

Thanks in advance for any assistance.

 

 

Everyone's tags (1)
2 ACCEPTED SOLUTIONS

Accepted Solutions
New Member

oooooo, that reply above gave

oooooo, that reply above gave me the answer i was looking for. It does work! it appears the syntax for the xml has changed pre x8 and post x8. It looks like i was using the incorrect syntax. I was missing the taa: in the clause to proxy, which made my rule switch version not work. Still not sure why the address-switch wasn't working, but i prefer the rule-switch anyway, so no big loss to me.

I have tested this, and it is fully functional on my lab vm VCS running x8.2

 

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
       <taa:routed>
         <taa:rule-switch>
           <taa:rule origin=".*" destination=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@CompanyA.local" source-url-for-message-replace="\1@CompanyA.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>
         </taa:rule-switch>
       </taa:routed>
</cpl>

New Member

No need to nest in the rule

No need to nest in the rule-switch node, you just list one after another.

It goes down the list in order, so make sure something meant for a rule at the bottom isn't caught at the top, otherwise the rule at the bottom won't do anything. 

Code example, also attached for easier viewing. Also, keep in mind, you can only replace with a URI/URL format X@X.X, can't just put in X, won't work......(many hours wasted trying to figure that one out :P)

 

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
       <taa:routed>
         <taa:rule-switch>

           <!-- Transform Outbound URI for Company A -->
           <taa:rule origin=".*" destination=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@CompanyA.local" source-url-for-message-replace="\1@CompanyA.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>

           <!-- Transform Outbound URI for Company B -->
           <taa:rule origin=".*" destination=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@CompanyB.local" source-url-for-message-replace="\1@CompanyB.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>

         </taa:rule-switch>
       </taa:routed>
</cpl>

27 REPLIES
New Member

Give this a shot. make sure

Give this a shot. make sure that taa:location line doesn't wrap like it does in this text box.

 

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
     <taa:routed>
       <taa:rule-switch>
         <!-- allow calls originating from endpoints registered to VCS-C -->
         <taa:rule originating-zone="NAME OF VCS-C ZONE" destination=".*">
           <taa:location clear="yes" source-url-for-message-regex="(.*)@CompanyA.local" source-url-for-message-replace="\1@CompanyA.com">
           </taa:location>
          <proxy />
         </taa:rule>
      </taa:rule-switch> 
     </taa:routed>
</cpl>

Derek,Thanks very much for

Derek,

Thanks very much for the suggestion.  I tried the example you gave (and changed the relevant parts) but it complains about the "<proxy />" line.  If I remove that line, it allows me to upload the file, but when I SSH into the box it gives the error:

  * warning   Failed to load Call Policy file - Line 14: Error: no supported destination specified in location node

And obviously doesn't work :)

Any suggestions?  I am a total CPL noob so please forgive me if it's something obvious :)

 

EDIT: I should also note that I tried it as "<proxy/>" (without the space)

New Member

Whoops. I see what i did

Whoops. I see what i did wrong. I don't think you can use taa:location inside of a taa:rule node.

Try this one. I made sure to test it on one of my Lab VCS's running x8.2, so i was able to fix the syntax before giving it to you this time :)

 

Again make sure the taa:location line doesn't wrap. or copy and paste from the txt file i've uploaded.

 

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
     <taa:routed>
       <address-switch field="registered-origin">
         <address regex="(.*)@CompanyA.local">
           <proxy>
             <default>
               <taa:location clear="yes" source-url-for-message-regex="(.*)@CompanyA.local" source-url-for-message-replace="\1@CompanyA.com">
                 <proxy/>
               </taa:location>
             </default>
           </proxy>
         </address>
       </address-switch>
     </taa:routed>
</cpl>

Hi Derek,Thanks again.With

Hi Derek,

Thanks again.

With the changes above, it accepted the file first time without giving an error, but I still can't get it to work.  After it didn't work, I tried broadening the regex to catch anything, but still had no luck.  Here's the exact text (noting that I copied from your uploaded file so didn't have the text wrapping issues):

 

<?xml version="1.0" encoding="UTF-8" ?>
- <cpl xmlns="urn:ietf:params:xml:ns:cpl" xmlns:taa="http://www.tandberg.net/cpl-extensions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
- <taa:routed>
- <address-switch field="registered-origin">
- <address regex="(.*)">
- <proxy>
- <default>
- <taa:location clear="yes" source-url-for-message-regex="(.*)" source-url-for-message-replace="test@mycompany.com">
<proxy />
</taa:location>
</default>
</proxy>
</address>
</address-switch>
</taa:routed>
</cpl>
 
EDIT: Looks like VCS is throwing up an alarm related to CPL - " Line 11: Error: no supported destination specified in location node"
 
 
New Member

Did some serious testing, and

Did some serious testing, and I can only sort of get it to work. It does not appear this newly added feature is fully functional.

 

So, its complaining because we are only trying to modify its source alias, and not a destination alias. It will change the source alias, but only if your destination alias is transformed exactly the same way, in the same clause.

ex:

<taa:location source-url-for-message-regex="(.*)@mycompany.net" source-url-for-message-replace="test@mycompany.com" regex="(.*)@mycompany.net replace="test@mycompany.com>

 

So, dialing source alias (.*)@company.net to destination alias (.*)@company.net, and being transformed to source alias test@company.com to destination alias test@company.com

It does not work with any other combination at all.

I'm guessing this feature is for a VCS that accepts registrations on a different domain, but wants one single unified domain for call routing. This extension to the CPL accommodates that, but doesn't let you spoof your SIP source alias.

Not sure if this is an intentional design limitation, or its broken, or what. Disappointing in any case.

Thanks Derek, I really

Thanks Derek, I really appreciate your help with this.

If what you say is the case, it seems this feature is a bit pointless, as least for me :P

It would be good if someone from Cisco could chime in on this - I've seen a few questions around it.

New Member

oooooo, that reply above gave

oooooo, that reply above gave me the answer i was looking for. It does work! it appears the syntax for the xml has changed pre x8 and post x8. It looks like i was using the incorrect syntax. I was missing the taa: in the clause to proxy, which made my rule switch version not work. Still not sure why the address-switch wasn't working, but i prefer the rule-switch anyway, so no big loss to me.

I have tested this, and it is fully functional on my lab vm VCS running x8.2

 

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
       <taa:routed>
         <taa:rule-switch>
           <taa:rule origin=".*" destination=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@CompanyA.local" source-url-for-message-replace="\1@CompanyA.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>
         </taa:rule-switch>
       </taa:routed>
</cpl>

Thanks guys - the new one

Thanks guys - the new one worked first time for me!

New Member

Hello Derek Ody,I really

Hello Derek Ody,

I really appreciate your input and this did fix the issue. I was out of the country and only now had the ability to test.

I have a quick followup question that may be obvious, however I do not have any experience with CPL Scripting.

If I have two seperate Companies  A and B using the same VCS Expressway and each company needs the above fix.  How can I nest the rules within the CPL script to accomodate both companies?

 

Regards

New Member

No need to nest in the rule

No need to nest in the rule-switch node, you just list one after another.

It goes down the list in order, so make sure something meant for a rule at the bottom isn't caught at the top, otherwise the rule at the bottom won't do anything. 

Code example, also attached for easier viewing. Also, keep in mind, you can only replace with a URI/URL format X@X.X, can't just put in X, won't work......(many hours wasted trying to figure that one out :P)

 

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
       <taa:routed>
         <taa:rule-switch>

           <!-- Transform Outbound URI for Company A -->
           <taa:rule origin=".*" destination=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@CompanyA.local" source-url-for-message-replace="\1@CompanyA.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>

           <!-- Transform Outbound URI for Company B -->
           <taa:rule origin=".*" destination=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@CompanyB.local" source-url-for-message-replace="\1@CompanyB.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>

         </taa:rule-switch>
       </taa:routed>
</cpl>

New Member

Thanks Derek Ody,This worked

Thanks Derek Ody,

This worked great.  I really appreciate your assistance with this.

 

regards

Patrick

New Member

I was trying to use this

I was trying to use this script to change my domain when I make outbound SIP calls. I was able to upload the script fine, but the cpl says nomatch in the debug logs. 

I am running VCS 8.1

I also was not sure if this policy should be on the VCSc or VCSe.

The only thing I changed in the script was:

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
       <taa:routed>
         <taa:rule-switch>

           <!-- Transform Outbound URI for Company A -->
           <taa:rule  sourcedetination=".*" message-regex=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@MY.ORG" source-url-for-message-replace="\1@MY.COM">
               <taa:proxy/>
             </taa:location>
           </taa:rule>
         </taa:rule-switch>
       </taa:routed>
</cpl>

I appreciate any assistance.

Thanks,

Alex

New Member

Well, you misspelled

Well, you misspelled sourcedestination, but that is not supported nor correct syntax. It would be origin=".*" desination=".*" origin is source, wording is just different.

For your requirements of outbound SIP only, this would be on the VCS-E.

 

Give this a shot:

<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
       <taa:routed>
         <taa:rule-switch>

           <!-- Transform Outbound URI for Company A -->
           <taa:rule originating-zone="VCSzonedestination=".*" message-regex=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@MY.ORG" source-url-for-message-replace="\1@MY.COM">
               <taa:proxy/>
             </taa:location>
           </taa:rule>
         </taa:rule-switch>
       </taa:routed>
</cpl>

New Member

Derek,I tried the example

Derek,

I tried the example that you gave with no luck. When I make a sip call, it still shows up as from sip:xxxxx@my.org.  I really appreciate your time.

I looked in the log and it says nomatch. should I do a debug?

Thanks,

New Member

You did change the "VCSzone"

You did change the "VCSzone" to whatever your vcs zone is actually named in your expressway, correct?

 

odd that its not happy, but this transform is really picky i've found. if you did correctly name the zone exactly as its listed in the expressway, give this a shot. Should work the same since your origin domain should only become from inside anyway.

 

           <!-- Transform Outbound URI for Company A -->
           <taa:rule origin=".*" destination=".*" message-regex=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@MY.org" source-url-for-message-replace="\1@MY.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>

New Member

I changed it to the zone that

I changed it to the zone that was showing up in a debug log.

So I know this is an old

So I know this is an old thread - but does anyone know if I can change the source URI as above (which I am already doing using this method) without changing the Caller ID/Display name?

 

Right now it seems that after using CPL to change my source URI, it's no longer sending the display name (or it's changing the display name to the new source URI).

New Member

It looks like its dropping

It looks like its dropping the SIP Display name, which causes SIP to just display the URI itself.

Looks like a limitation of the function, and it would need an enhancement request to the VCS product to get this functionality added.

New Member

Derek,I changed originating

Derek,

I changed originating-zone to unauthenticated-origin and it worked. I really appreciate your time.

Thanks,

Alex

New Member

Interesting, but just be

Interesting, but just be careful, if you ever decide to use a username/password to register endpoints, or use movi/jabber, this unauthenticated-origin will fail, since the are authenticated via the VCS.

New Member

Hi Dereck,I'm facing to the

Hi Dereck,

I'm facing to the same problem ( Change the URI Source alias domain for outbound calls). I'm running with a ExpresswayE 8.5.2.

I tried to use your CPL xml file guide line but it does not work.

 

Do you aware on modification on Expressway release 8.5 regarding CPL configuration.

See my txt file.

 

I appreciate your lights..:)

Regards

New Member

Nothing has changed as far as

Nothing has changed as far as I'm aware. I think in you rule switch node, the message-regex".*" might be breaking it's match. 

The domain url re-write targets all SIP and H.323 searches, and the message-regex only targets SIP, and never H.323, so perhaps that's whats making it not match your search rules.

also, make sure your originating-zone matches exactly the zone name in your expressway.


<?xml version="1.0" encoding="UTF-8" ?>
<cpl xmlns="urn:ietf:params:xml:ns:cpl"
     xmlns:taa="http://www.tandberg.net/cpl-extensions"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="urn:ietf:params:xml:ns:cpl cpl.xsd">
       <taa:routed>
         <taa:rule-switch>
           <taa:rule originating-zone="DNS_Zone_for_ExtCompany.com" destination=".*" message-regex=".*">
             <taa:location clear="yes" regex="(.*)" replace="\1" source-url-for-message-regex="(.*)@int.domain.com" source-url-for-message-replace="\1@domain.com">
               <taa:proxy/>
             </taa:location>
           </taa:rule>
         </taa:rule-switch>
       </taa:routed>
</cpl>
New Member

Thanks for this reply,I'm

Thanks for this reply,

I'm doing strickly outbound SIP calls, not H323, so How to specify in rule only SIP?

I verified, the originating-zone, it matches exactly the zone name.

Question for my best comprehension,

the CPL script needs to configure only in Policy Menu, you don't need to apply it the  on the zone?

 

Thanks

New Member

The CPL only targets searches

The CPL only targets searches, so it hits everything, you cannot just choose SIP or H323.

This is important, because even though it won't change H323 IP dials, it still looks at the invite header in the h323 packet, and because of this, its making some change somewhere in the header, and it completely breaks H323 IP dialing to endpoints on the public internet that are not behind a gatekeeper of some sorts.

 

CPL is a global setting, affects all searches.

VIP Purple

Hello all -I had a similar

Hello all -

I had a similar question, actually the same question in another discussion here: ask-expert-cisco-telepresence-enterprise.  I've edited there example to take into consideration all calls being made through the VCS from any source to any destination, then match based the source url, and finally replace that source url with another, and it works for me.  Suggest you take a look, it might fit your needs and what you're looking for.

New Member

Thanks for this!I didn't

Thanks for this!

I didn't realize the syntax changed post x8, I was still using pre x8 syntax. So that explains why my rule-switch code didn't work. All is functioning now, and allows for full SIP-SRC URI spoofing. I hope no one here decides to use it for nefarious purposes though.......

 

VIP Purple

I hope no one here decides to

I hope no one here decides to use it for nefarious purposes though.......

Haha, right!

I'm using it to alter an IP address and relevant display name to be more user friendly within our environment.

Glad it helped.

2031
Views
53
Helpful
27
Replies
CreatePlease login to create content