[asterisk-users] Is it possible to perform PJSIP Add Header prior to calling Queue and have it part of the INVITE packet?

Dan Cropp dan at amtelco.com
Fri Aug 28 13:16:05 CDT 2015


I'm running into a new problem because of the Local channels.

I add Local/Agent1 using QueueAdd.
When the PJSIP Agent dials a feature code, it adds/removes/pauses/unpauses the appropriate EmergencyAgent for the queue.

When the code executes the Queue, I was planning to have that Local section dial plan Dial the appropriate PJSIP EmergencyAgent endpoint (using the pre-dial).

However, the Queue never sees the local channels because they have no device state.
[Aug 28 18:05:06] DEBUG[17868][C-00000004] app_queue.c: TestApp_EmergencyAgent5 is unavailable because his device state is 'invalid'
[Aug 28 18:05:06] DEBUG[17868][C-00000004] app_queue.c: TestApp_EmergencyAgent3 is unavailable because his device state is 'invalid'
[Aug 28 18:05:06] DEBUG[17868][C-00000004] app_queue.c: TestApp_EmergencyAgent2 is unavailable because his device state is 'invalid'
[Aug 28 18:05:06] DEBUG[17868][C-00000004] app_queue.c: TestApp_EmergencyAgent1 is unavailable because his device state is 'invalid'

It seems I may be stuck using chan_sip since it's Queue behavior does add any SIPADDHEADERs when it executes the INVITE.

From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Dan Cropp
Sent: Friday, August 28, 2015 8:20 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Is it possible to perform PJSIP Add Header prior to calling Queue and have it part of the INVITE packet?

Thank you Niklas

That solved my problem.

From: asterisk-users-bounces at lists.digium.com<mailto:asterisk-users-bounces at lists.digium.com> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Niklas Larsson
Sent: Friday, August 28, 2015 1:55 AM
To: asterisk-users at lists.digium.com<mailto:asterisk-users at lists.digium.com>
Subject: Re: [asterisk-users] Is it possible to perform PJSIP Add Header prior to calling Queue and have it part of the INVITE packet?

Den 2015-08-28 kl. 00:07, skrev Dan Cropp:
I have both the PJSIP add and the chan_sip way of adding SIP headers in there.  The Verbose is showing the variable value is there.
The INVITE to PJSIP/Agent1 does not include either X-My-DNID or X-My-DNID2 headers.

You have to use an pre-dial handler option in the Dial command:

same => n,Dial(PJSIP/Agent1,,b(set_header^s^1))

[set_header]
exten => s,1,Set(PJSIP_HEADER(add,X-My-DNID2)=${MY_DNID})
 same => n,Return

/niklas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150828/3a52ad9d/attachment.html>


More information about the asterisk-users mailing list