QUEUESTATUS variable not available in hangup extension

Hi,

There’s a similar issue: QUEUESTATUS for Abandoned Call but I start a new topic with a more detailed approach.

The QUEUESTATUS variable is not available in the extension h when the caller hangup (abandoned call). This happens with asterisk 18 with PJSIP channel driver, in asterisk 1.8 with chan_sip the variable is propagated without no problem.

If the queue times out, the variable QUEUESTATUS is available in the next priority when continue extension dialplan execution.

I think the problem is caused by the PJSIP variable handling isolating them in several channels.

Other variables link PLAYBACKSTATUS are propagated from the Playback application and also other variables from the Queue: QUEUEPOSITION, QEORIGINALPOS, QEHOLDTIME

I also tried to get the QUEUESTATUS variable with IMPORT function without success.

Any idea to retrieve QUEUESTATUS in the hangup extension?

Best Regards.

---- Tech info ----

Asterisk version: 18.0.1
PJPROJECT version: 2.10 (bundled with asterisk)

extensions.conf

exten => 401,1,Answer()
   same => n,Playback(custom/bienvenidav3)
   same => n,Set(__callerChannel=${CHANNEL})
   same => n,Queue(Entrada,tkC)
   same => n,Hangup()

exten => h,1,DumpChan()
   same => n,NoOp(queuestatus imported: ${IMPORT(${callerChannel},QUEUESTATUS)})

DumpChan on hangup:

Dumping Info For Channel: PJSIP/201-0000002c:
================================================================================
Info:
Name=               PJSIP/201-0000002c
Type=               PJSIP
UniqueID=           1606301064.314
LinkedID=           1606301064.314
CallerIDNum=        201
CallerIDName=       Juan
ConnectedLineIDNum= 200
ConnectedLineIDName=Pedro
DNIDDigits=         401
RDNIS=              (N/A)
Parkinglot=         
Language=           es
State=              Up (6)
Rings=              1
NativeFormat=       (alaw)
WriteFormat=        alaw
ReadFormat=         alaw
RawWriteFormat=     alaw
RawReadFormat=      alaw
WriteTranscode=     No 
ReadTranscode=      No 
1stFileDescriptor=  -1
Framesin=           307 
Framesout=          292 
TimetoHangup=       0
ElapsedTime=        0h0m6s
BridgeID=           (Not bridged)
Context=            colas
Extension=          h
Priority=           1
CallGroup=          1
PickupGroup=        1
Application=        DumpChan
Data=               (Empty)
Blocking_in=        (Not Blocking)

Variables:
QUEUEPOSITION=1
QEORIGINALPOS=1
QEHOLDTIME=1
callerChannel=PJSIP/201-0000002c
PLAYBACKSTATUS=SUCCESS
================================================================================
    -- Executing [h@testing:2] NoOp("PJSIP/201-0000002c", "queuestatus imported: ") in new stack


I can’t comment on app_queue, but there is no behavior difference for dialplan variables between chan_pjsip and other channel drivers. They behave exactly the same.

I disagree, at least in app_queue. Other problem that come up is when you call a gosub in the queue when agent answers. Variables set or modified in the answered channel are only available in this channel and when returning to dialplan execution (timeout) or hangup (abandoned) this variables are not available (new) or with the old value (modified).

I played with inheritance defining them prior to the queue call but it didn’t worked, answered channel is isolated in some way.

In my old asterisk version 1.8 with chan_sip, all the variables set or modified in the gosub are available with the final value in dialplan return or hangup.

The channel technology drivers can only set specific variables. They don’t get involved with the general handling of variables. They have absolutely no knowledge of the Queue application. The mechanism for reporting hangup to the Asterisk core is the same for all channel drivers.

Whereas I could believe that a change between 1.8 and 18 affected this variable, I cannot imagine any way in which a change between chan_sip and chan_pjsip could do so.

Ok, I agree with you both. It has no sense to have a separate variable handling from the core for several channel drivers.

I take this idea because I used a gosub function in the queue call for update the CDR(userfield) when a agent answers the call, this CDR(userfield) variable is not updated in hangup extension but the update is replected on cdr_custom file.

I read the upgrade notes for every version between 1.8 and 18 for adapting the configuration but I’m sure that hundreds of thousands code lines has changed between them. I’m figuring out to make the same behaviour using shared variables.

Reading the documentation, it’s possible that now QUEUESTATUS should only exist if dialplan continues.

Thanks for your help.

PD: I removed the mention to PJSIP from the title.

CDR support was completely rewritten between 1.8 and 18, so it is entirely possible that there is different behavior in regards to it.

I read about that in the UPGRADE files, I’m adapting my config to use with asterisk 18 and after some changes it’s working more or less like with the old version making the same things in a different way.

Sorry for the inconvenience.

Best Regards!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.