Ignore GetParameterValues errors during initialization step

This commit is contained in:
Zaid Abdulla committed 2013-02-07 16:01:08 +03:00
1 parent 22ed899657
commit 5ba4dce248
2 files changed
+10 -6

No files matched your search

+1 -1
View File
@@ -106,6 +106,7 @@ runTask = (currentRequest, task, methodResponse) ->
nextTask(currentRequest)
)
when tasks.STATUS_FAULT
util.log("#{currentRequest.deviceId}: Fault response for task #{taskId}")
db.saveTask(task, (err) ->
# Faulty task. No more work to do until task is deleted.
res = tr069.response(null, cwmpResponse)
@@ -261,7 +262,6 @@ else
)
else if cwmpRequest.fault?
taskId = cwmpRequest.id
util.log("#{currentRequest.deviceId}: Fault response for task #{taskId}")
db.getTask(taskId, (task) ->
if not task
+9 -5
View File
@@ -9,14 +9,14 @@ exports.STATUS_FINISHED = STATUS_FINISHED = 4
this.init = (task, methodResponse, cwmpResponse, deviceUpdates) ->
if methodResponse.faultcode?
task.fault = methodResponse
return STATUS_FAULT
if not task.subtask?
task.subtask = {'name' : 'getParameterNames', 'parameterPath' : '', 'nextLevel' : false}
if task.subtask.name == 'getParameterNames'
if methodResponse.faultcode?
task.fault = methodResponse
return STATUS_FAULT
status = this.getParameterNames(task.subtask, methodResponse, cwmpResponse, deviceUpdates)
if status is STATUS_FINISHED
parameterNames = []
@@ -28,10 +28,14 @@ this.init = (task, methodResponse, cwmpResponse, deviceUpdates) ->
throw Error('Unexpected subtask status')
if task.subtask.name == 'getParameterValues'
if methodResponse.faultcode?
# Ignore GetParameterValues errors. A workaround for the crappy Seewon devices.
status = this.getParameterValues(task.subtask, {parameterList : {}}, cwmpResponse, deviceUpdates)
else
status = this.getParameterValues(task.subtask, methodResponse, cwmpResponse, deviceUpdates)
if status is STATUS_FINISHED
return STATUS_FINISHED
else if status is not STATUS_STARTED
else if status isnt STATUS_STARTED
throw Error('Unexpected subtask status')
return STATUS_STARTED