Author Topic: Disable CfgDN object gracefully  (Read 4754 times)

Offline oceanblue

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Disable CfgDN object gracefully
« on: May 09, 2020, 09:34:49 PM »
Hey Guys - I need your expert advice here. I'm trying to switch DN state (Disable/Enable) using config API, which works and GA/CME reflects appropriate DN state as well as WDE generates DNOutofService/backinService messages.


Below is what I see in the TServer log when I execute the code :


@16:47:05.4108 [TCONF] DN info changed (dbid 89720) (number 9130017) (switch-dbid 122)
tserv_dn_changed(9130017)
16:47:05.411  -- [b]forced disable[/b]

So, basically I am forcing it :o

If I perform the same task using GA, I see different message in the TServ log. It looks more graceful in nature :

@22:18:19.0471 [TCONF] Changed in
DN array
  9130017 [89720] dn = '9130017' type = Extension xtype = DN cfgtype = 1 sstype = 1 reg-mode = 0x21 = +force <+>
    linked-resources array register-flag = true
@22:18:19.0806 [TCONF] READER: status: [3]->[3]
22:18:19.094: SIPCFG: Event Type: 5, Object type 2, objectptr 320997f0, objectcntr 0
[89720] dn = '9130017' type = Extension xtype = DN cfgtype = 1 hash = 1 contact = '*' record = 'true' authenticate-requests = 'register' password = '***' sip-ring-tone-mode = 1 sip-cti-control = 'talk,hold' dial-plan = 'VoIPSvc_PhoneDN_NoRec' cpn = '' request-uri = ''
22:18:19.094: $*:CTI:PRM:PRIVATE_LINE_CHANGED:3195556
22:18:19.094: DN out of service (not registered): 9130017
22:18:19.094: SetDnInService: DN 9130017 Out of Service


Below is a code snippet from my script that I am using for this purpose :


    CfgDN dn = "some DN";
    dn.setState(CfgObjectState.CFGDisabled);
    dn.save(); 

My question is: what should I be doing differently, so that, I am not forcing a disable rather doing it gracefully like GA?

Thanks in advance.

cheers,

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Disable CfgDN object gracefully
« Reply #1 on: May 10, 2020, 10:55:31 PM »
Guess GA does an unregister first, then set the device as OOS

Enviado de meu SM-N9600 usando o Tapatalk


Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: Disable CfgDN object gracefully
« Reply #2 on: May 11, 2020, 01:00:46 PM »
[quote author=cavagnaro link=topic=11607.msg52895#msg52895 date=1589151331]
Guess GA does an unregister first, then set the device as OOS

Enviado de meu SM-N9600 usando o Tapatalk


[/quote]

I don't think so. GA is not a client of TServer to register or unregister. His code and GA should perform the exact same operation.
Is it the same log file for both the snippets you sent?

Offline oceanblue

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: Disable CfgDN object gracefully
« Reply #3 on: June 15, 2020, 04:30:34 PM »
@hsujdik

My code snippet generates the following logging in the TServer log :

@16:47:05.4108 [TCONF] DN info changed (dbid 89720) (number 9130017) (switch-dbid 122)
tserv_dn_changed(9130017)
16:47:05.411  -- forced disable




Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Disable CfgDN object gracefully
« Reply #4 on: June 15, 2020, 05:58:42 PM »
[quote author=hsujdik link=topic=11607.msg52896#msg52896 date=1589202046]
[quote author=cavagnaro link=topic=11607.msg52895#msg52895 date=1589151331]
Guess GA does an unregister first, then set the device as OOS

Enviado de meu SM-N9600 usando o Tapatalk


[/quote]

I don't think so. GA is not a client of TServer to register or unregister. His code and GA should perform the exact same operation.
Is it the same log file for both the snippets you sent?
[/quote]


Yeah, no TServer client, but a change at CfgServer will be propagated to TServer and maybe the Cfg event is what is different and TServer reacts to that change accordingly


Offline oceanblue

  • Newbie
  • *
  • Posts: 23
  • Karma: 0
Re: Disable CfgDN object gracefully
« Reply #5 on: June 15, 2020, 07:45:46 PM »
Yeah, may be that's the case...the CFGEvent update to TServer might be different in this case for a native client (i.e., GA) than from a PSDK app.

I will look at the CfgServ log and see if I find anything interesting.

cheers,