Help for use of cuser

la_toupie

Help for use of cuser

Post 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
vad
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 3852
Joined: 23 Sep 2004 06:47

Post 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 ...)?
la_toupie

Post 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:
goldy
Member
Posts: 150
Joined: 30 Aug 2004 02:16
Location: Australia

Post 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:
la_toupie

Post 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
goldy
Member
Posts: 150
Joined: 30 Aug 2004 02:16
Location: Australia

Post 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:
User avatar
alex
Senior Member
Posts: 1498
Joined: 06 Jul 2004 07:27
Contact:

Post 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!
la_toupie

Post 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:
User avatar
alex
Senior Member
Posts: 1498
Joined: 06 Jul 2004 07:27
Contact:

Post by alex »

Hi La_Toupie
Try this one

Code: Select all

mgr -h
:wink:
la_toupie

Post 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 !
Post Reply

Return to “GENERAL”