Adding headers on outbound queue calls

Hello,

What I am trying to do is I wish to make an outbound call on the PSTN if the agent status is UNAVAILABLE. This works like a charm however there are some requirements that demand me to add a P-Asserted-Identity header to the outbound call would the agent not be available.

Where should I add this header? We’re using PJSIP so we cannot do it in the QueueConnector since it is not a PJSIP channel. We tried using the b Queue options and tried to add it there as well with the same error “This function requires a PJSIP channel.”

Here’s my dialplan

[QueueConnector]
exten => _[A-Za-z0-9].,1,Verbose(Something fun)
   same => n,Set(QueueMember=${FILTER(A-Za-z0-9\-.#,${EXTEN})})
   same => n,Set(Technology=${CUT(QueueMember,#,1)})
   same => n,Set(AgentEndpoint=${CUT(QueueMember,#,2)})
   same => n,Set(AgentState=${DEVICE_STATE(${Technology}/${AgentEndpoint})})
   same => n,Set(DefaultDialTarget=${AgentEndpoint})
   same => n,Set(TwinningDestination=${CUT(QueueMember,#,3)})
   same => n,Set(TwinningTrunk=${CUT(QueueMember,#,4)})
   same => n,ExecIf($["${AgentState}" = "UNAVAILABLE"]?Set(DefaultDialTarget=${TwinningDestination}@${TwinningTrunk}))
   same => n,Dial(${Technology}/${DefaultDialTarget})
   same => n,Hangup()

[from-voip-provider]
exten => 4880000000,1,noop("Incoming call from route 1 ${CALLERID(num)}")
 same => n,Verbose("Test Twinning")
 same => n,Answer()
 same => n,Queue(TwinningTest)
 same => n,hangup(16)

In queues.conf

[TwinningTest]
...
member => Local/PJSIP#jane.doe#+489000000#trunk-1@QueueConnector

I think the whole queue part of this is irrelevant. You use the normal method of adding headers on a chan_pjsp dial; you use a pre-Dial subroutine on your Dial application call to run the code on the, newly created, chan_pjsip channel.

Are you saying I should use the b option for the Dial(), inside my QueueConnector?

Update: Yes, it appears to work.

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