# NMS_GR303ModifyChannelLocation

Moves a provisioned HDLC channel to a new location or adds a new HDLC channel to a specified interface without re-provisioning the entire interface.

#### Prototype

NMS_GR303_RESULT_T NMS_GR303ModifyChannelLocation ( NMS_GR303_INTERFACE_ID_T interfaceId, NMS_GR303_CHANNEL_LOCATION_T *old_channel_loc, NMS_GR303_CHANNEL_LOCATION_T new_channel_loc)

Argument | Description
interfaceId | Interface ID of a provisioned interface.
old_channel_loc | Pointer to an HDLC channel location structure for the channel to remove: typedef union _NMS_GR303_CHANNEL_LOCATION_T { struct { DWORD boardNb; DWORD trunkNb; DWORD timeslotNb; } CG; } NMS_GR303_CHANNEL_LOCATION_T See the Details section for field descriptions. Set old_channel_loc to NULL if adding an HDLC channel.
new_channel_loc | HDLC channel location structure for the new channel location (see the old_channel_loc structure).

#### Return values

Return value | Description
NMSGR303_SUCCESS |
NMSGR303_INTERNAL_FAILURE | Internal failure. Refer to the trace log for more information.
NMSGR303_INVALID_CHANNEL | Invalid channel location specified in old_channel_loc or new_channel_loc.
NMSGR303_INVALID_INTERFACE_ID | Specified interface is not provisioned.
NMSGR303_NOT_INITIALIZED | NMS GR303 library was not initialized with NMS_GR303Initialize.
NMSGR303_OUTOFRESOURCE | Maximum number of channels per GR303 interface (4 per interface) was reached.

#### Details

NMS_GR303ModifyChannelLocation modifies a channel location within an existing interface. If the application passes the old_channel_loc structure rather than NULL, NMS_GR303ModifyChannelLocation stops the specified HDLC instance (if the entire interface is started), re-configures the timeslots occupied by the HDLC channel back to CAS mode, and destroys the old HDLC channel.

If the application passes a NULL value for old_channel_loc value, the NMS GR303 library does not destroy any HDLC channels, but configures a new HDLC channel according to the information specified in the NMS_GR303_CHANNEL_LOCATION_T structure.

The NMS_GR303_CHANNEL_LOCATION_T structure includes the following information:

Field | Description
boardNb | Logical board number where an HDLC instance is located (as defined by NMS OAM).
trunkNb | Logical trunk number associated with the HDLC instance (as defined by NMS OAM).
timeslotNb | Physical timeslot number associated with the HDLC instance.

NMS_GR303ModifyChannelLocation creates, initializes, and resets the specified HDLC instance. If the specified interface has not been started, the channel is disabled by default. If the specified interface has been started, the channel is enabled by default.

The signaling mode of the timeslot occupied by the HDLC instance is set to RAW (or non-CAS). The maximum number of HDLC channels provisioned on an interface should not exceed four.

#### See also

NMS_GR303ProvisionInterface

#### Example

void ModifyChannelLocation( void )
{
NMS_GR303_RESULT_T NmsResult;
NMS_GR303_CHANNEL_LOCATION_T NewChannelLoc, OldChannelLoc,
*pOldChannelLoc;
DWORD InterfaceId;
char Selection;
printf("NMS_GR303ModifyChannelLocation:\n");
/* Get parameters */
promptdw_nodft("Enter interfaceId", &InterfaceId);
pOldChannelLoc = NULL;
Selection = 'y';
promptchar("Move provisioned channel ? (y/n)", &Selection );
if(Selection == 'y')
{
printf("Enter 'Old' channel location:\n");
GetChannelLocationNMS( &OldChannelLoc );
pOldChannelLoc = &OldChannelLoc;
}
printf("Enter 'New' channel location:\n");
NmsResult = NMS_GR303ModifyChannelLocation(InterfaceId,
pOldChannelLoc,
NewChannelLoc);
printf ("NMS_GR303ModifyChannelLocation:
Result=%s\n",PRINT_RESULT(NmsResult));
}