DevicesandUser Login&Logout not working correctly

Hi,

since I updated from 2.3.1 to 2.4.0beta2, my devicesanduserlogin isn’t working correctly. I’m using Asterisk 1.4.17.

When trying to logout with *12 it says everything is ok. The extension is removed from dialplan hints.
When trying to login again with *11100 log says “User already logged in” and Plays Goodbye.

Before using 2.4.0beta2 everything went quite nice, but 1.4 support wasn’t that good and Call Waiting - Deactivate didn’t work, which seems to be fixed now.

Greetz
acid

is the user the same as the default user? One thing that was fixed is when there is a default user, they get logged back in automatically - in the past, they were logged-in at initial creation but once someone else logged in, they were never logged back in unless they explicitly logged in.

Thx for fast answer, there are no fixed users, every device is set as “adhoc” and default user is set to none.

well we probably need more information then - a trace of what the CLI is showing or something like that. Also - a 'database show DEVICE/ as well as a 'database show AMPUSER/<logged_in_user_num>" may be helpful to see what is going on.

Database show device:
/DEVICE/1200/dial : SIP/1200
/DEVICE/1200/type : adhoc
/DEVICE/1200/user : none
/DEVICE/1201/dial : SIP/1201
/DEVICE/1201/type : adhoc
/DEVICE/1201/user : 101
/DEVICE/1202/dial : SIP/1202
/DEVICE/1202/type : adhoc
/DEVICE/1202/user : 117
/DEVICE/1203/dial : SIP/1203
/DEVICE/1203/type : adhoc
/DEVICE/1203/user : none
/DEVICE/1204/dial : SIP/1204
/DEVICE/1204/type : adhoc
/DEVICE/1204/user : none
/DEVICE/1205/dial : SIP/1205
/DEVICE/1205/type : adhoc
/DEVICE/1205/user : 113
/DEVICE/1206/dial : SIP/1206
/DEVICE/1206/type : adhoc
/DEVICE/1206/user : none
/DEVICE/1207/dial : SIP/1207
/DEVICE/1207/type : adhoc
/DEVICE/1207/user : 126
/DEVICE/1208/dial : SIP/1208
/DEVICE/1208/type : adhoc
/DEVICE/1208/user : none
/DEVICE/1209/dial : SIP/1209
/DEVICE/1209/type : adhoc
/DEVICE/1209/user : none
/DEVICE/1210/dial : SIP/1210
/DEVICE/1210/type : adhoc
/DEVICE/1210/user : 122
/DEVICE/1211/dial : SIP/1211
/DEVICE/1211/type : adhoc
/DEVICE/1211/user : 100

database show AMPUSER:

/AMPUSER//device :
/AMPUSER/100/cidname : Jens
/AMPUSER/100/cidnum : 100
/AMPUSER/100/device :
/AMPUSER/100/noanswer :
/AMPUSER/100/outboundcid :
/AMPUSER/100/password : 1111
/AMPUSER/100/recording : out=Adhoc|in=Adhoc
/AMPUSER/100/ringtimer : 0
/AMPUSER/100/voicemail : novm
/AMPUSER/101/cidname :Klaus
/AMPUSER/101/cidnum : 101
/AMPUSER/101/device : &1201
/AMPUSER/101/noanswer :
/AMPUSER/101/outboundcid :
/AMPUSER/101/password : 1111
/AMPUSER/101/recording : out=Always|in=Always
/AMPUSER/101/ringtimer : 0
/AMPUSER/101/voicemail : novm

ampuser 100 isn’t logged in. if I do so:
– Executing [*[email protected]:1] Macro(“SIP/1211-c80106c0”, “user-logon|100|”) in new stack
– Executing [[email protected]:1] Set(“SIP/1211-c80106c0”, “DEVICETYPE=adhoc”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/1211-c80106c0”, “0?s-FIXED|1”) in new stack
– Executing [[email protected]:3] Set(“SIP/1211-c80106c0”, “AMPUSER=100”) in new stack
– Executing [[email protected]:4] GotoIf(“SIP/1211-c80106c0”, “1?gotpass”) in new stack
– Goto (macro-user-logon,s,7)
– Executing [[email protected]:7] Set(“SIP/1211-c80106c0”, “AMPUSERPASS=1111”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/1211-c80106c0”, “0?s-NOPASSWORD|1”) in new stack
– Executing [[email protected]:9] Set(“SIP/1211-c80106c0”, “DEVICEUSER=100”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/1211-c80106c0”, “1?s-ALREADYLOGGEDON|1”) in new stack
– Goto (macro-user-logon,s-ALREADYLOGGEDON,1)
– Executing [[email protected]:1] NoOp(“SIP/1211-c80106c0”, “This device has already been logged into by this user”) in new stack
– Executing [[email protected]:2] Playback(“SIP/1211-c80106c0”, “vm-goodbye”) in new stack
– <SIP/1211-c80106c0> Playing ‘vm-goodbye’ (language ‘en’)
– Executing [[email protected]:3] Hangup(“SIP/1211-c80106c0”, “”) in new stack
== Spawn extension (macro-user-logon, s-ALREADYLOGGEDON, 3) exited non-zero on ‘SIP/1211-c80106c0’

Trying to logoff

– Executing [*[email protected]:1] Macro(“SIP/1211-c8027c70”, “user-logoff|”) in new stack
– Executing [[email protected]:1] Set(“SIP/1211-c8027c70”, “DEVICETYPE=adhoc”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/1211-c8027c70”, “0?s-FIXED|1”) in new stack
– Executing [[email protected]:3] DeadAGI(“SIP/1211-c8027c70”, “user_login_out.agi|logout|1211”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/user_login_out.agi
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
– user_login_out.agi|logout|1211: Logging out current user from device 1211
user_login_out.agi|logout|1211: user_logout: this_device: 1211
user_login_out.agi|logout|1211: get_logged_in_user: device: 1211
user_login_out.agi|logout|1211: get_defualt_user: device: 1211
user_login_out.agi|logout|1211: remove_user: device: 1211
user_login_out.agi|logout|1211: get_user: device: 1211
user_login_out.agi|logout|1211: get_devices: user: 100
user_login_out.agi|logout|1211: remove_device: devices: , remove_device: 1211
user_login_out.agi|logout|1211: Setting user 100 to devices
user_login_out.agi|logout|1211: set_user_devices: user: 100, devices:
user_login_out.agi|logout|1211: set_hint: user: 100, devices:
user_login_out.agi|logout|1211: Removing hint for user 100
== Manager ‘admin’ logged off from 127.0.0.1
– AGI Script user_login_out.agi completed, returning 0
– Executing [[email protected]:4] Playback(“SIP/1211-c8027c70”, “vm-goodbye”) in new stack
– <SIP/1211-c8027c70> Playing ‘vm-goodbye’ (language ‘en’)
Really destroying SIP dialog ‘[email protected]’ Method: NOTIFY
– Executing [*[email protected]:2] Hangup(“SIP/1211-c8027c70”, “”) in new stack
== Spawn extension (from-internal, *12, 2) exited non-zero on ‘SIP/1211-c8027c70’
– Executing [[email protected]:1] Macro(“SIP/1211-c8027c70”, “hangupcall”) in new stack
– Executing [[email protected]:1] ResetCDR(“SIP/1211-c8027c70”, “w”) in new stack
– Executing [[email protected]:2] NoCDR(“SIP/1211-c8027c70”, “”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/1211-c8027c70”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [[email protected]:6] GotoIf(“SIP/1211-c8027c70”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/1211-c8027c70”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [[email protected]:11] Hangup(“SIP/1211-c8027c70”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/1211-c8027c70’

after that trying to login again:

Really destroying SIP dialog ‘[email protected]’ Method: NOTIFY
– Executing [*[email protected]:1] Macro(“SIP/1211-c802c820”, “user-logon|100|”) in new stack
– Executing [[email protected]:1] Set(“SIP/1211-c802c820”, “DEVICETYPE=adhoc”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/1211-c802c820”, “0?s-FIXED|1”) in new stack
– Executing [[email protected]:3] Set(“SIP/1211-c802c820”, “AMPUSER=100”) in new stack
– Executing [[email protected]:4] GotoIf(“SIP/1211-c802c820”, “1?gotpass”) in new stack
– Goto (macro-user-logon,s,7)
– Executing [[email protected]:7] Set(“SIP/1211-c802c820”, “AMPUSERPASS=1111”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/1211-c802c820”, “0?s-NOPASSWORD|1”) in new stack
– Executing [[email protected]:9] Set(“SIP/1211-c802c820”, “DEVICEUSER=100”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/1211-c802c820”, “1?s-ALREADYLOGGEDON|1”) in new stack
– Goto (macro-user-logon,s-ALREADYLOGGEDON,1)
– Executing [[email protected]:1] NoOp(“SIP/1211-c802c820”, “This device has already been logged into by this user”) in new stack
– Executing [[email protected]:2] Playback(“SIP/1211-c802c820”, “vm-goodbye”) in new stack
– <SIP/1211-c802c820> Playing ‘vm-goodbye’ (language ‘en’)
– Executing [[email protected]:3] Hangup(“SIP/1211-c802c820”, “”) in new stack
== Spawn extension (macro-user-logon, s-ALREADYLOGGEDON, 3) exited non-zero on ‘SIP/1211-c802c820’

do two things:

  1. set verbosity level to 10 and do a logout again
  2. after that, go into freepbx and modify the device you are testing so you can get it resubmitted (change the name or something). Then check if the device entry got a default_user attribute set to it. If not, assign a default user, submit it and then remove the default user. The goal is to set it to ‘none’. Then try again at verbose level 8 and provide the output.

thanks

did it as u said:

/DEVICE/1211/default_user : none
/DEVICE/1211/dial : SIP/1211
/DEVICE/1211/type : adhoc
/DEVICE/1211/user : 100

*12 gives me :

-- Executing [*[email protected]:1] Macro("SIP/1211-ac0bf2f0", "user-logoff|") in new stack
-- Executing [[email protected]:1] Set("SIP/1211-ac0bf2f0", "DEVICETYPE=adhoc") in new stack
-- Executing [[email protected]:2] GotoIf("SIP/1211-ac0bf2f0", "0?s-FIXED|1") in new stack
-- Executing [[email protected]:3] DeadAGI("SIP/1211-ac0bf2f0", "user_login_out.agi|logout|1211") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/user_login_out.agi

== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
– user_login_out.agi|logout|1211: Logging out current user from device 1211
user_login_out.agi|logout|1211: user_logout: this_device: 1211
user_login_out.agi|logout|1211: get_logged_in_user: device: 1211
user_login_out.agi|logout|1211: get_defualt_user: device: 1211
user_login_out.agi|logout|1211: remove_user: device: 1211
user_login_out.agi|logout|1211: get_user: device: 1211
user_login_out.agi|logout|1211: get_devices: user: 100
user_login_out.agi|logout|1211: remove_device: devices: , remove_device: 1211
user_login_out.agi|logout|1211: Setting user 100 to devices
user_login_out.agi|logout|1211: set_user_devices: user: 100, devices:
user_login_out.agi|logout|1211: set_hint: user: 100, devices:
user_login_out.agi|logout|1211: Removing hint for user 100
== Manager ‘admin’ logged off from 127.0.0.1
– AGI Script user_login_out.agi completed, returning 0
– Executing [[email protected]:4] Playback(“SIP/1211-ac0bf2f0”, “vm-goodbye”) in new stack
– <SIP/1211-ac0bf2f0> Playing ‘vm-goodbye’ (language ‘en’)
– Executing [*[email protected]:2] Hangup(“SIP/1211-ac0bf2f0”, “”) in new stack
== Spawn extension (from-internal, *12, 2) exited non-zero on ‘SIP/1211-ac0bf2f0’
– Executing [[email protected]:1] Macro(“SIP/1211-ac0bf2f0”, “hangupcall”) in new stack
– Executing [[email protected]:1] ResetCDR(“SIP/1211-ac0bf2f0”, “w”) in new stack
– Executing [[email protected]:2] NoCDR(“SIP/1211-ac0bf2f0”, “”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/1211-ac0bf2f0”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [[email protected]:6] GotoIf(“SIP/1211-ac0bf2f0”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/1211-ac0bf2f0”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [[email protected]:11] Hangup(“SIP/1211-ac0bf2f0”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/1211-ac0bf2f0’

after that *11100 on Sip 1211 gives me:

– Executing [*[email protected]:1] Macro(“SIP/1211-ac0bf2f0”, “user-logon|100|”) in new stack
– Executing [[email protected]:1] Set(“SIP/1211-ac0bf2f0”, “DEVICETYPE=adhoc”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/1211-ac0bf2f0”, “0?s-FIXED|1”) in new stack
– Executing [[email protected]:3] Set(“SIP/1211-ac0bf2f0”, “AMPUSER=100”) in new stack
– Executing [[email protected]:4] GotoIf(“SIP/1211-ac0bf2f0”, “1?gotpass”) in new stack
– Goto (macro-user-logon,s,7)
– Executing [[email protected]:7] Set(“SIP/1211-ac0bf2f0”, “AMPUSERPASS=1111”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/1211-ac0bf2f0”, “0?s-NOPASSWORD|1”) in new stack
– Executing [[email protected]:9] Set(“SIP/1211-ac0bf2f0”, “DEVICEUSER=100”) in new stack
– Executing [[email protected]:10] GotoIf(“SIP/1211-ac0bf2f0”, “1?s-ALREADYLOGGEDON|1”) in new stack
– Goto (macro-user-logon,s-ALREADYLOGGEDON,1)
– Executing [[email protected]:1] NoOp(“SIP/1211-ac0bf2f0”, “This device has already been logged into by this user”) in new stack
– Executing [[email protected]:2] Playback(“SIP/1211-ac0bf2f0”, “vm-goodbye”) in new stack
– <SIP/1211-ac0bf2f0> Playing ‘vm-goodbye’ (language ‘en’)
– Executing [[email protected]:3] Hangup(“SIP/1211-ac0bf2f0”, “”) in new stack
== Spawn extension (macro-user-logon, s-ALREADYLOGGEDON, 3) exited non-zero on 'SIP/1211-ac0bf2f0’
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
Really destroying SIP dialog ‘NWM3ZjVlMTkxNjQ3MTdlMjMxZmExYjYwODhjOGYyYWY.’ Method: ACK

can’t get it logged off

what I notice is, when turning on default user with any other, there is no problem with login and logout. It does it always the right way and puts in the default user. When there is no default user, it doesn’t work at all.

Yup it’s a bug - file a ticket and we’ll get it fixed today. I must have done all my testing with a default user assigned.

#2626

r5592, r5593 - just published