Page 1 of 2

Help for use of cuser

Posted: 07 Apr 2005 05:17
by la_toupie
Hi all,

I try to do a script to permit to a user to change his calling number. I have done trace SQL and here the result :

1112862608 -> (429) sql2 ( SELECT S_Name, F_Name, S_Name_Annu, F_Name_Annu, Call_Enable INTO FROM PHONEB WHERE Mcdu='79167' AND Name_Index = 0; ,... )
1112862608 -> (429) sql2 ( ) status 0
1112862608 -> (429) sql2 ( SELECT crystal, coupler, position, renvoi, typdest IN
TO FROM POSTE WHERE numan = '79167'; ,... )
1112862608 -> (429) sql2 ( ) status 0
1112862608 -> (429) sql2 ( SELECT S_Name, F_Name, S_Name_Annu, F_Name_Annu, Call_Enable INTO FROM PHONEB WHERE Mcdu = '79167' AND Name_Index = 0; ,... )
1112862608 -> (429) sql2 ( ) status 0
1112862608 -> (429) sql2 ( SELECT disp_name INTO FROM POSTE WHERE nulog = 43; ,.
.. )
1112862608 -> (429) sql2 ( ) status 0
1112862609 -> (429) sql2 ( SELECT curid, npi, pn INTO FROM SUBSPN WHERE number = '79167' AND pnid = 1; ,... )
1112862609 -> (429) sql2 ( ) status 0
1112862609 -> (429) sql1 ( |UPDATE SUBSPN SET curid = 1, npi = 0, pn = '3699' WH
ERE number = '79167';| , option 0 )
1112862609 -> (429) sql1 ( ) status 0
1112862609 -> (429) sql1 ( |COMMIT WORK;| , option 0 )
1112862609 -> (429) sql1 ( ) status 0
1112862609 -> (429) sql1 ( |UPDATE SUBSDATE SET updDate = [07042005103000], status = 0, type = 0 WHERE mcdu = '79167';| , option 0 )
1112862609 -> (429) sql1 ( ) status 0
1112862609 -> (429) sql1 ( |COMMIT WORK;| , option 0 )
1112862609 -> (429) sql1 ( ) status 0
1112862610 -> (438) sql2 ( SELECT S_Name, F_Name, S_Name_Annu, F_Name_Annu, Call_Enable INTO FROM PHONEB WHERE Mcdu='79167' AND Name_Index = 0; ,... )
1112862610 -> (438) sql2 ( ) status 0
1112862611 -> (434) sql2 ( SELECT S_Name, F_Name, S_Name_Annu, F_Name_Annu, Call_Enable INTO FROM PHONEB WHERE Mcdu='79167' AND Name_Index = 0; ,... )
1112862611 -> (434) sql2 ( ) status 0
1112862611 -> (438) sql1 ( |CLOSE V_KEYBOARDCUR;| , option 0 )
1112862611 -> (438) sql1 ( ) status -11012

I try to do with cuser : UPDATE SUBSPN SET curid = 1, npi = 0, pn = '3699' WH
ERE number = '79167';| , option 0 but it don't works.

I must copy all for my script ? It's strange; for me , only this update is necessary ???
What is the meaning of 'status 0' ?

Thanks for your help

Posted: 07 Apr 2005 22:49
by vad
Why do you want to change calling number? More simple delete user and create again with anothe number.
If you will change calling number what happen with anothe table (keys, set supervision, hunting group ...)?

Posted: 08 Apr 2005 04:55
by la_toupie
In fact, this user wants to make calls on his pilots to test his agents. As he don't know the voice of all its personnel, he wants then that I identify which agent answered. The problem, it's that he shouldn't call in masked if not I it your steps in taxation and he don't want to always use the same number if not he will be located. From where my idea to make a small application which enables him to change its call number. I don't want to give him access to the PABX :roll:

Posted: 11 Apr 2005 08:02
by goldy
I think the output of the trace in 'mgr' is different from the syntax required by 'cuser'.

The following command will update the value, but only on disk (some work, some don't)

CODE:

cdmao

cuser . m

update subspn set pn='yournumber' where number='yourmcdu'

commit ;

.

or, if in a script;

cd /usr3/mao; echo "update subspn set pn='yournumber' where number='yourmcdu' ; ." |cuser



See if that works :wink:

Posted: 11 Apr 2005 08:51
by la_toupie
The "update" isn't taken in account when i look at "mgr" after... :?


(6)xa000006> cuser .m
->> update subspn set pn='3247' where number='79167';

Number of matching records = 1
temps d'execution = 0.000
->> commit;

temps d'execution = 0.000

Posted: 11 Apr 2005 09:48
by goldy
ok,, it is because it is written to disk, not memory. Not sure how to do it so it writes to mem as well :oops:

Posted: 12 Apr 2005 08:57
by alex
Hi folks

Actually, there is a tool for digging up remanent in memory.
It is promptly called "cuser_mem" :wink:
But as Vad told you better not touch it without proper knowledge of DB structure - tables, indexes and their relations.
For this kind of tricks if you really need this done you can use "mgr" command file execution.
If you want change PIN of sbs 3000 to 123456 then create text file containing

Code: Select all



SET Subscriber   "1": "3000"
{
 Private_Calling_Number = "123456"
}

name it like you want, e.g. chpin
and run command

Code: Select all

(1)xa000000> mgr -nodico -X chpin
Now all you need - to put it in a script, randomize "Private_Calling_Number" get loop for 5 min and every five minutes this guy will have a different pcn!

First, it is safer than "cuser"
Second, it does change DB in memory and on disk!

Posted: 12 Apr 2005 12:12
by la_toupie
Thanks all for your answer; il 'll try that tomorrow but what is the signification of :


SET Subscriber "1": "3000" : why ''1" ?
-nodico ?
-X ?

Thanks again :wink:

Posted: 13 Apr 2005 02:03
by alex
Hi La_Toupie
Try this one

Code: Select all

mgr -h
:wink:

Posted: 13 Apr 2005 07:59
by la_toupie
Excellent :D

It works, I've learnt a lot on this question. But I've always not understatnd the signification of "1" in SET Subscriber "1": "3000" ???

It's less dangerous than the use of cuser, sure :)


Thanks the friends !