cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
401
Views
1
Helpful
4
Replies

Having trouble adding endpoint data to a new gateway I created.

dhoskins
Level 1
Level 1

I have a script designed to extract endpoint information from a port on a VG350 gateway named "vg777." My objective is to take this extracted data and upload it to another VG350 gateway named "vg350," which I've created for this purpose.

When I utilize the "addGatewayEndpointAnalogAccess" function to add the endpoint data from the "vg777" gateway, I encounter an error message that states: "Error occurred: Could not update a row in the table."

I suspect that the issue might be related to the UUIDs within the endpoint data of the "vg777" gateway. As a result, I've removed these UUIDs.

My question pertains to the Axl Schema: How can I determine if a particular field is required? I'm uncertain if I inadvertently omitted a required field when transferring the endpoint data.

Is there anything else I can clarify or any other information I need to provide?

Below is the endpoint data I have pulled from the vg777 gateway. I have it in my script to adjust the domain name to the vg350 as well as the name of the ports.

 

{
"domainName": "vg777",
"gatewayUuid": null,
"unit": 2,
"subunit": 0,
"endpoint": {
"index": 34,
"name": "AALN/S2/SU0/34@vg777",
"description": "AALN/S2/SU0/34@vg777",
"product": "Cisco MGCP FXS Port",
"model": "MGCP Station",
"class": "Gateway",
"protocol": "Analog Access",
"protocolSide": "User",
"callingSearchSpaceName": {
"_value_1": null
},
"devicePoolName": {
"_value_1": "Default"
},
"commonDeviceConfigName": {
"_value_1": null
},
"networkLocale": null,
"locationName": {
"_value_1": "Hub_None"
},
"mediaResourceListName": {
"_value_1": null
},
"automatedAlternateRoutingCssName": {
"_value_1": null
},
"aarNeighborhoodName": {
"_value_1": null
},
"vendorConfig": null,
"mlppDomainId": null,
"useTrustedRelayPoint": "Default",
"retryVideoCallAsAudio": "true",
"cgpnTransformationCssName": {
"_value_1": null
},
"useDevicePoolCgpnTransformCss": "true",
"geoLocationName": {
"_value_1": null
},
"geoLocationFilterName": {
"_value_1": null
},
"port": {
"portNumber": 1,
"attendantDn": null,
"unattendedPort": "false",
"callerIdDn": null,
"callerIdEnable": "false",
"callingPartySelection": "Originator",
"digitSending": "DTMF",
"expectedDigits": 0,
"sigDigits": {
"_value_1": 0,
"enable": false
},
"lines": {
"line": {
"index": 1,
"label": null,
"display": null,
"dirn": {
"pattern": "5378",
"routePartitionName": {
"_value_1": "Global Learned Enterprise Numbers"
}
},
"ringSetting": "Ring",
"consecutiveRingSetting": "Use System Default",
"ringSettingIdlePickupAlert": null,
"ringSettingActivePickupAlert": null,
"displayAscii": null,
"e164Mask": null,
"dialPlanWizardId": null,
"mwlPolicy": "Use System Policy",
"maxNumCalls": 2,
"busyTrigger": 1,
"callInfoDisplay": {
"callerName": "false",
"callerNumber": "false",
"redirectedNumber": "false",
"dialedNumber": "false"
},
"recordingProfileName": {
"_value_1": null
},
"monitoringCssName": {
"_value_1": null
},
"recordingFlag": null,
"audibleMwi": "Default",
"speedDial": null,
"partitionUsage": "General",
"associatedEndusers": null,
"missedCallLogging": null,
"recordingMediaSource": null,
"ctiid": null
},
"lineIdentifier": null
},
"prefixDn": null,
"presentationBit": "Allowed",
"silenceSuppressionThreshold": "Disable",
"smdiPortNumber": 0,
"startDialProtocol": "Not Set",
"trunk": "POTS",
"trunkDirection": "Bothways",
"trunkLevel": "ONS",
"trunkPadRx": "NoDbPadding",
"trunkPadTx": "NoDbPadding",
"vendorConfig": null,
"timer1": 200,
"timer2": 0,
"timer3": 100,
"timer4": 1000,
"timer5": 0,
"timer6": 0
},
"trunkSelectionOrder": "Top Down",
"transmitUtf8": "false",
"cdpnTransformationCssName": {
"_value_1": null
},
"useDevicePoolCdpnTransformCss": "true",
"callingPartyNumberPrefix": "Default",
"callingPartyStripDigits": null,
"callingPartyUnknownTransformationCssName": {
"_value_1": null
},
"useDevicePoolCgpnTransformCssUnknown": "false",
"hotlineDevice": "false",
"packetCaptureMode": "None",
"packetCaptureDuration": 0,
"pstnAccess": "false",
"imeE164TransformationName": {
"_value_1": null
},
"imeE164DirectoryNumber": "+0",
"confidentialAccess": {
"confidentialAccessMode": null,
"confidentialAccessLevel": -1
},
"elinGroup": {
"_value_1": null
},
"ctiid": 65
}
}

1 Accepted Solution

Accepted Solutions

Thank you for sharing that information. I've managed to get everything working as I'd like it to.

View solution in original post

4 Replies 4

dstaudt
Cisco Employee
Cisco Employee

In general, you can look at the AXL schema/WSDL for the element/children in question:

dstaudt_0-1701366736121.png

In this case, the domainName element is required (minOccurs="1") but must occur only once (maxOccurs="1"), and may be nil (nillable="false").

However, the AXL schema doesn't always make those values explicit, in which case it is good to know the defaults:

dstaudt_1-1701367118462.png

And sometimes - though rarely - the AXL WSDL doesn't line up with the actual implementation on CUCM, and CUCM may require (or not require) elements in contradiction to the WSDL

Enabling detailed AXL logs and peeking into the log files can sometimes give you a hint as to what the problem might be: https://developer.cisco.com/docs/axl/#!enable-and-gather-axl-api-logs
For example, the logs tend to show the actual SQL being sent to the database (often multiple SQL requests per AXL request), and tend to show more error detail.  However, sometimes they don't...

In this particular case, it might be easy to overlook that the line/DN used in a <addGatewayEndpointAnalogAccess> request must already exist - i.e. you will need to perform <addLine> with the port/line's specific DN before you can send <addGatewayEndpointAnalogAccess>.

In general, retrieving an AXL object, modifying it, and then using that modified object directly in a subsequent <addXXX/updateXXX> request is going to be fraught - mainly as the WSDL definitions for those objects may be different for the read vs. the write operation. 

For example, the object you get from <getGatewayEndpointAnalogAccess> is of type RGatewayEndpointAnalogAccess:

 

<xsd:element name="gatewayEndpointAnalogAccess" type="axlapi:RGatewayEndpointAnalogAccess"/>

 

 and the object you send for <addGatewayEndpointAnalogAccess> is of type XGatewayEndpointAnalogAccess:

<xsd:element name="gatewayEndpointAnalogAccess" type="axlapi:XGatewayEndpointAnalogAccess"/>

These may well be different (though in this particular case they don't seem to be.)  The best approach is usually to 'clone' and object by copying values (just the ones you need, and know are required) from the read object into a new write object.

dhoskins
Level 1
Level 1

While I'm a beginner in scripting, I'm finding it incredibly interesting. We're in the process of replacing two VG350 gateways with two VG450 gateways. Currently, each VG350 gateway has two SM-D-72FXS cards, one with around 30 programmed endpoints, and the other with about 40. To avoid the laborious task of manually reprogramming all these endpoints on the new VG450 gateways, I decided to delve into Python scripting and utilize the power of the AXL API. My aim is to create a script that can clone all the settings associated with the endpoints on the VG350 and apply them to the new VG450, making it identical to the current programming on the VG350.

You mentioned that the lines must already exist, and indeed, the lines do exist on the endpoints for the VG350 that I'm attempting to copy over to the VG450.

"In this particular case, it might be easy to overlook that the line/DN used in a <addGatewayEndpointAnalogAccess> request must already exist - i.e. you will need to perform <addLine> with the port/line's specific DN before you can send <addGatewayEndpointAnalogAccess>."

Did some experimentation...indeed what must be sent in for an <addGatewayEndpointAnalaogAccess> request differs in some ways that will cause errors if not modified appropriate.
This is the <gatewayEndpointAnalogAccess> element (from <getGatewayEndpointAnalogAccess>) for the the original VG350 endpoint:

            <gatewayEndpointAnalogAccess uuid="{33AB5CE0-F037-9B87-46EF-78D77AF50436}">
               <domainName>vg350a</domainName>
               <unit>2</unit>
               <subunit>0</subunit>
               <endpoint ctiid="193" uuid="{33AB5CE0-F037-9B87-46EF-78D77AF50436}">
                  <index>0</index>
                  <name>AALN/S2/SU0/0@vg350a</name>
                  <description>AALN/S2/SU0/0@vg350a</description>
                  <product>Cisco MGCP FXS Port</product>
                  <model>MGCP Station</model>
                  <class>Gateway</class>
                  <protocol>Analog Access</protocol>
                  <protocolSide>User</protocolSide>
                  <callingSearchSpaceName/>
                  <devicePoolName uuid="{1B1B9EB6-7803-11D3-BDF0-00108302EAD1}">Default</devicePoolName>
                  <commonDeviceConfigName/>
                  <networkLocale/>
                  <locationName uuid="{29C5C1C4-8871-4D1E-8394-0B9181E8C54D}">Hub_None</locationName>
                  <mediaResourceListName/>
                  <automatedAlternateRoutingCssName/>
                  <aarNeighborhoodName/>
                  <vendorConfig/>
                  <mlppDomainId/>
                  <useTrustedRelayPoint>Default</useTrustedRelayPoint>
                  <retryVideoCallAsAudio>true</retryVideoCallAsAudio>
                  <cgpnTransformationCssName/>
                  <useDevicePoolCgpnTransformCss>true</useDevicePoolCgpnTransformCss>
                  <geoLocationName/>
                  <geoLocationFilterName/>
                  <port>
                     <portNumber>1</portNumber>
                     <attendantDn/>
                     <unattendedPort>false</unattendedPort>
                     <callerIdDn/>
                     <callerIdEnable>false</callerIdEnable>
                     <callingPartySelection>Originator</callingPartySelection>
                     <digitSending>DTMF</digitSending>
                     <expectedDigits>0</expectedDigits>
                     <sigDigits enable="false">0</sigDigits>
                     <lines>
                        <line>
                           <index>1</index>
                           <label/>
                           <display/>
                           <dirn uuid="{9815D049-6CC6-7142-FA93-333BF882A04E}">
                              <pattern>5378</pattern>
                              <routePartitionName uuid="{92C96F9C-7737-4621-970F-52C77EC27313}">Global Learned Enterprise Numbers</routePartitionName>
                           </dirn>
                           <ringSetting>Ring</ringSetting>
                           <consecutiveRingSetting>Use System Default</consecutiveRingSetting>
                           <ringSettingIdlePickupAlert/>
                           <ringSettingActivePickupAlert/>
                           <displayAscii/>
                           <e164Mask/>
                           <dialPlanWizardId/>
                           <mwlPolicy>Use System Policy</mwlPolicy>
                           <maxNumCalls>2</maxNumCalls>
                           <busyTrigger>1</busyTrigger>
                           <callInfoDisplay>
                              <callerName>false</callerName>
                              <callerNumber>false</callerNumber>
                              <redirectedNumber>false</redirectedNumber>
                              <dialedNumber>false</dialedNumber>
                           </callInfoDisplay>
                           <recordingProfileName/>
                           <monitoringCssName/>
                           <audibleMwi>Default</audibleMwi>
                           <speedDial/>
                           <partitionUsage>General</partitionUsage>
                           <associatedEndusers/>
                        </line>
                     </lines>
                     <prefixDn/>
                     <presentationBit>Allowed</presentationBit>
                     <silenceSuppressionThreshold>Disable</silenceSuppressionThreshold>
                     <smdiPortNumber>0</smdiPortNumber>
                     <startDialProtocol>Not Set</startDialProtocol>
                     <trunk>POTS</trunk>
                     <trunkDirection>Bothways</trunkDirection>
                     <trunkLevel>ONS</trunkLevel>
                     <trunkPadRx>NoDbPadding</trunkPadRx>
                     <trunkPadTx>NoDbPadding</trunkPadTx>
                     <vendorConfig/>
                     <timer1>200</timer1>
                     <timer2>0</timer2>
                     <timer3>100</timer3>
                     <timer4>1000</timer4>
                     <timer5>0</timer5>
                     <timer6>0</timer6>
                  </port>
                  <trunkSelectionOrder>Top Down</trunkSelectionOrder>
                  <transmitUtf8>false</transmitUtf8>
                  <cdpnTransformationCssName/>
                  <useDevicePoolCdpnTransformCss>true</useDevicePoolCdpnTransformCss>
                  <callingPartyNumberPrefix>Default</callingPartyNumberPrefix>
                  <callingPartyStripDigits/>
                  <callingPartyUnknownTransformationCssName/>
                  <useDevicePoolCgpnTransformCssUnknown>false</useDevicePoolCgpnTransformCssUnknown>
                  <hotlineDevice>false</hotlineDevice>
                  <packetCaptureMode>None</packetCaptureMode>
                  <packetCaptureDuration>0</packetCaptureDuration>
                  <pstnAccess>false</pstnAccess>
                  <imeE164TransformationName/>
                  <imeE164DirectoryNumber>+0</imeE164DirectoryNumber>
                  <confidentialAccess>
                     <confidentialAccessMode/>
                     <confidentialAccessLevel>-1</confidentialAccessLevel>
                  </confidentialAccess>
                  <elinGroup/>
               </endpoint>
            </gatewayEndpointAnalogAccess>

This is the modified element which worked in <addGatewayEndpointAnalogAccess> for the new VG350:

         <gatewayEndpointAnalogAccess><!-- modify remove uuid -->
            <domainName>vg350b</domainName>
            <unit>2</unit>
            <subunit>0</subunit>
            <endpoint><!-- modify remove ctiid/uuid -->
               <index>0</index>
               <name>AALN/S2/SU0/0@vg350b</name><!-- modify unique for endpoint -->
               <description>AALN/S2/SU0/0@vg350b</description><!-- modify to match name -->
               <product>Cisco MGCP FXS Port</product>
               <!-- <model>MGCP Station</model> --><!-- omitfor write operations -->
               <class>Gateway</class>
               <protocol>Analog Access</protocol>
               <protocolSide>User</protocolSide>
               <callingSearchSpaceName/>
               <devicePoolName uuid="{1B1B9EB6-7803-11D3-BDF0-00108302EAD1}">Default</devicePoolName>
               <commonDeviceConfigName/>
               <networkLocale/>
               <locationName uuid="{29C5C1C4-8871-4D1E-8394-0B9181E8C54D}">Hub_None</locationName>
               <mediaResourceListName/>
               <automatedAlternateRoutingCssName/>
               <aarNeighborhoodName/>
               <vendorConfig/>
               <!-- <mlppDomainId>-1</mlppDomainId> --><!-- remove entirely for nil/default -->
               <useTrustedRelayPoint>Default</useTrustedRelayPoint>
               <retryVideoCallAsAudio>true</retryVideoCallAsAudio>
               <cgpnTransformationCssName/>
               <useDevicePoolCgpnTransformCss>true</useDevicePoolCgpnTransformCss>
               <geoLocationName/>
               <geoLocationFilterName/>
               <port>
                  <portNumber>1</portNumber>
                  <attendantDn/>
                  <unattendedPort>false</unattendedPort>
                  <callerIdDn/>
                  <callerIdEnable>false</callerIdEnable>
                  <callingPartySelection>Originator</callingPartySelection>
                  <digitSending>DTMF</digitSending>
                  <expectedDigits>0</expectedDigits>
                  <sigDigits enable="false">0</sigDigits>
                  <lines>
                     <line>
                        <index>1</index>
                        <label/>
                        <display/>
                        <dirn uuid="{9815D049-6CC6-7142-FA93-333BF882A04E}">
                           <pattern>5378</pattern>
                           <routePartitionName uuid="{92C96F9C-7737-4621-970F-52C77EC27313}">Global Learned Enterprise Numbers</routePartitionName>
                        </dirn>
                        <ringSetting>Ring</ringSetting>
                        <consecutiveRingSetting>Use System Default</consecutiveRingSetting>
                        <ringSettingIdlePickupAlert/>
                        <ringSettingActivePickupAlert/>
                        <displayAscii/>
                        <e164Mask/>
                        <dialPlanWizardId/>
                        <mwlPolicy>Use System Policy</mwlPolicy>
                        <maxNumCalls>2</maxNumCalls>
                        <busyTrigger>1</busyTrigger>
                        <callInfoDisplay>
                           <callerName>false</callerName>
                           <callerNumber>false</callerNumber>
                           <redirectedNumber>false</redirectedNumber>
                           <dialedNumber>false</dialedNumber>
                        </callInfoDisplay>
                        <recordingProfileName/>
                        <monitoringCssName/>
                        <audibleMwi>Default</audibleMwi>
                        <speedDial/>
                        <partitionUsage>General</partitionUsage>
                        <associatedEndusers/>
                     </line>
                  </lines>
                  <prefixDn/>
                  <presentationBit>Allowed</presentationBit>
                  <silenceSuppressionThreshold>Disable</silenceSuppressionThreshold>
                  <smdiPortNumber>0</smdiPortNumber>
                  <startDialProtocol>Not Set</startDialProtocol>
                  <trunk>POTS</trunk>
                  <trunkDirection>Bothways</trunkDirection>
                  <trunkLevel>ONS</trunkLevel>
                  <trunkPadRx>NoDbPadding</trunkPadRx>
                  <trunkPadTx>NoDbPadding</trunkPadTx>
                  <vendorConfig/>
                  <timer1>200</timer1>
                  <timer2>0</timer2>
                  <timer3>100</timer3>
                  <timer4>1000</timer4>
                  <timer5>0</timer5>
                  <timer6>0</timer6>
               </port>
               <trunkSelectionOrder>Top Down</trunkSelectionOrder>
               <transmitUtf8>false</transmitUtf8>
               <cdpnTransformationCssName/>
               <useDevicePoolCdpnTransformCss>true</useDevicePoolCdpnTransformCss>
               <callingPartyNumberPrefix>Default</callingPartyNumberPrefix>
               <callingPartyStripDigits/>
               <callingPartyUnknownTransformationCssName/>
               <useDevicePoolCgpnTransformCssUnknown>false</useDevicePoolCgpnTransformCssUnknown>
               <hotlineDevice>false</hotlineDevice>
               <packetCaptureMode>None</packetCaptureMode>
               <packetCaptureDuration>0</packetCaptureDuration>
               <pstnAccess>false</pstnAccess>
               <imeE164TransformationName/>
               <imeE164DirectoryNumber>+0</imeE164DirectoryNumber>
               <!-- <confidentialAccess>
               <confidentialAccessMode/>
                  <confidentialAccessLevel>-1</confidentialAccessLevel>
               </confidentialAccess> --><!-- remove entirely for nil/default -->
               <elinGroup/>
            </endpoint>
         </gatewayEndpointAnalogAccess>

I used HTML comments inline to indicate the ommissions/modifications I made to the original to get it to work.  It uses the same line instance, so that wasn't the problem.

The modifications shouldn't be too tricky in Python/Zeep...

 

Thank you for sharing that information. I've managed to get everything working as I'd like it to.