[Home]

Summary:ASTERISK-26063: ${PJSIP_HEADER(read,Call-ID)} does not work - documentation needs clarification for when read/write is possible
Reporter:Private Name (falves11)Labels:
Date Opened:2016-05-25 23:50:34Date Closed:2016-06-19 05:03:04
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:13.9.1 Frequency of
Occurrence
Related
Issues:
Environment:Linux 64 bitsAttachments:( 0) asterisk-error.txt
( 1) asterisk-error-1.txt
Description:I run the code below inside a b(handler) parameter in the Dial function.
The code is excuted but it does not return the header Call-ID, which I need to capture for billing purposes. I mean on the outbound channel. In the old SIP channel, there was a variable that held that information. No it is empty, and I guess the code below should read the header in question.
{noformat}
exten => s,n,Set(SIPCALLID=${PJSIP_HEADER(read,Call-ID)}
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2016-05-25 23:50:35.492-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2016-05-26 05:41:32.260-0500

Per the Asterisk versions page [1], the maintenance (bug fix) support for the Asterisk branch you are using has ended. For continued maintenance support please move to a supported branch of Asterisk. After testing with a supported branch, if you find this problem has not been resolved, please open a new issue against the latest version of that Asterisk branch.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions



By: Private Name (falves11) 2016-05-26 07:31:02.820-0500

The issue is present in Asterisk 13 as well.
GIT-13-a42bea3M

By: Asterisk Team (asteriskteam) 2016-05-26 07:31:03.137-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: Joshua C. Colp (jcolp) 2016-05-26 07:34:08.744-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. Please read over the Asterisk Issue Guidelines [1] which discusses the information necessary for your issue to be resolved and the format that information needs to be in. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected and the location of documentation that led you to that expectation.
3. The behavior you actually encountered.

To demonstrate the issue in detail, please include Asterisk log files generated per the instructions on the wiki [2]. If applicable, please ensure that protocol-level trace debugging is enabled, e.g., 'sip set debug on' if the issue involves chan_sip, and configuration information such as dialplan and channel configuration.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

[2] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information



By: Private Name (falves11) 2016-05-26 08:38:51.268-0500

I am unable to understand how should I report this issue. This is a function that does not return anything.
It is not a crash or something like that.
Can somebody provide detailed instructions as to how to report something that does not happen when it should happen?

By: Joshua C. Colp (jcolp) 2016-05-26 08:40:55.714-0500

It's not that hard. Provide the console output, PJSIP logging output, and some configuration.

By: Private Name (falves11) 2016-05-26 09:03:10.439-0500

Adding a file with the trace

By: Private Name (falves11) 2016-05-26 09:07:31.796-0500

The call works fine. The issue is this functions PJSIP_HEADER

By: Rusty Newton (rnewton) 2016-05-26 14:24:07.111-0500

You are trying to read the Call-ID before it exists. There is no Call-ID at the point in execution when you are reading from the channel. You'll have to perform that read after the Dial has been initiated, not in a pre-dial handler.



By: Private Name (falves11) 2016-05-26 15:13:45.603-0500

I am uploading a file.

By: Asterisk Team (asteriskteam) 2016-05-26 15:13:45.863-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: Private Name (falves11) 2016-05-26 15:16:18.899-0500

The issue is exactly the same inside a macro that runs aftr the call connects.
This leaves me with no other places to read this information.

By: Rusty Newton (rnewton) 2016-05-27 08:03:12.979-0500

Can you try reading {{CHANNEL(pjsip,Call-ID)}} in the same spot?


By: Rusty Newton (rnewton) 2016-05-27 11:36:17.785-0500

Turns out PJSIP_HEADER only works generally for reading headers on the inbound channel and for writing headers on the outbound channel. The exception is that you should be able to read headers on the outbound channel that you have explicitly added.

In your case you are trying to read on the outbound channel, so that won't work. You should use the CHANNEL function instead to read the call-id in pre-dial or pre-bridge.

By: Rusty Newton (rnewton) 2016-05-27 11:36:48.436-0500

The documentation for PJSIP_HEADER could be improved, so I'm going to go ahead and do that.

By: Private Name (falves11) 2016-05-27 11:40:06.737-0500

[May 27 14:37:54] WARNING[26446]: pjsip/dialplan_functions.c:656 channel_read_pjsip: Unrecognized argument 'Call-ID' for 'pjsip' information
[May 27 14:37:54] WARNING[27501][C-00000009]: func_channel.c:620 func_channel_read: Unknown or unavailable item requested: 'pjsip,Call-ID'

By: Private Name (falves11) 2016-05-27 11:43:05.294-0500

Please let me know how to read this information in any way. The function CHANNEL(pjsip.. does not work.
The old SIP channels allows Asterisk to see this information, which is the only possible way to match the CDR  with a carriers's bill.



By: Rusty Newton (rnewton) 2016-05-27 11:43:46.730-0500

Sorry, it is {{CHANNEL(pjsip,call-id)}} . I just tested it in pre-dial and pre-bridge and it works.

In the future you can always double check the documentation for the CHANNEL function. It allows access to a ton of information for a channel.

By: Private Name (falves11) 2016-05-27 12:00:44.945-0500

Please close the case.



By: Rusty Newton (rnewton) 2016-05-27 12:35:44.813-0500

"core show function CHANNEL" on the Asterisk CLI.

On the wiki: https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_CHANNEL

{{CHANNEL(pjsip,call-id)}} definitely works in both pre-dial and pre-bridge. You can pursue further assistance from the community at https://community.asterisk.org/. We don't provide technical support via the tracker. Thanks!

By: Private Name (falves11) 2016-06-18 23:33:09.883-0500

The function CHANNEL(PJSIP,call-id) only works in Asterisk 13. It does not appear in the help
core show function CHANNEL in either version 11 or 12, and of course does not work.
I hereby request that this critical property be added to version 11 or 12, or both.
There is another critical property that is missing from Version 11 and 12, pjsip rtp_timeout.
Without this variable, pjsip cannot be used for serious business. I wonder if somebody could add this to version 11 and 12. Thousands, maybe millions of companies cannot use version 13 yet. We do business only with 11 and 12, more 11 than 12.
I would hate to go back and start using the old SIP channel again.



By: Asterisk Team (asteriskteam) 2016-06-18 23:33:10.165-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: Joshua C. Colp (jcolp) 2016-06-19 05:03:04.625-0500

PJSIP does not exist in 11 and can not be used there, so it won't be in the help.
Asterisk 12 is also no longer supported[1] so it receives no fixes.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Versions