[asterisk-bugs] [JIRA] (ASTERISK-29663) messaging: AMI MessageSend does not support same parameters as dialplan application
Brian J. Murrell (JIRA)
noreply at issues.asterisk.org
Tue Sep 21 09:56:33 CDT 2021
[ https://issues.asterisk.org/jira/browse/ASTERISK-29663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256374#comment-256374 ]
Brian J. Murrell edited comment on ASTERISK-29663 at 9/21/21 9:55 AM:
----------------------------------------------------------------------
{quote}
Is "my_sip_account" defined as an endpoint in your pjsip.conf? If so then yes this behavior is expected.
{quote}
Yes.
{quote}
So, I think in the case where you have an endpoint defined in your configuration that matches the To: (in this test example "sipp") then the domain is discarded, and an associated AOR contact is used
{quote}
That's not how {{Application_MessageSend()}} is treating the {{to}} argument. It is putting it's value into the {{To:}} header of the outgoing message verbatim, which is what the ticket (and the proposed patches from the community) that the patch is supposed to be addressing was requesting. The ticket and patches were specifically trying to *undo* the behaviour of using the endpoint's IP address (which can vary, of course) as the domain value of the {{To:}} header, to provide consistency in how the endpoint collates received messages.
Maybe it would be useful to get the author of that patch (George Joseph) to chime in here to clarify the questions?
was (Author: brian_j_murrell):
{quote}
Is "my_sip_account" defined as an endpoint in your pjsip.conf? If so then yes this behavior is expected.
{quote}
Yes.
{quote}
So, I think in the case where you have an endpoint defined in your configuration that matches the To: (in this test example "sipp") then the domain is discarded, and an associated AOR contact is used
{quote}
That's not how {{Application_MessageSend()}} is treating the {{to}} argument. It is putting it's value into the {{To:}} header of the outgoing message verbatim, which is what the ticket (and the proposed patches from the community) that the patch is supposed to be addressing was requesting. The ticket and patches were specifically trying to *undo* the behaviour of using the endpoint's IP address (which can vary, of course) as the domain value of the {{To:}} header, to provide consistency in how the endpoint collates received messages.
Maybe it would be useful to get the author of that patch (George Joeseph) to chime in here to clarify the questions?
> messaging: AMI MessageSend does not support same parameters as dialplan application
> -----------------------------------------------------------------------------------
>
> Key: ASTERISK-29663
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-29663
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Resources/res_pjsip_messaging
> Affects Versions: 18.6.0
> Reporter: Brian J. Murrell
> Assignee: Unassigned
>
> The patch in https://gerrit.asterisk.org/c/asterisk/+/15828 seems to achieve the desired behaviour of allowing the {{To:}} header to be specified for the recipient. I have successfully used the new third field of {{MessageSend()}} to override the address in the {{To:}} header.
> When I use AMI {{Action: MessageSend}}, setting the {{To:}} field of the action to the same value as I use for the third field of {{MessageSend()}}, the {{To:}} header is not overwritten with the value of the {{To:}} field from the action fields.
> For example, via AMI I send:
> {noformat}
> Action: MessageSend
> ActionID: 22525
> To: pjsip:my_sip_account at example.com
> From: <sip:asterisk at example.com>
> Base64Body: [redacted]
> {noformat}
> But what gets sent in the SIP {{MESSAGE}} is:
> {noformat}
> MESSAGE sip:my_sip_account@[2001:123:aa:123:0:21db:34e6:9b08:176b]:45016;transport=tcp;pn-tok=[redacted];pn-type=firebase;app-id=[redacted];pn-silent=1;pn-timeout=0 SIP/2.0
> Via: SIP/2.0/TCP [2001:123:aa:123::2]:5060;rport;branch=z9hG4bKPj30ad245f-1b2f-40f6-96b9-58e8d3a182b0;alias
> From: <sip:asterisk at example.com>;tag=5db4ff03-6d42-4b96-ab67-149859ec1073
> To: <sip:my_sip_account@[2001:123:aa:123:0:21db:34e6:9b08:176b];pn-tok=[redacted];pn-type=firebase;app-id=[redacted];pn-silent=1;pn-timeout=0>
> Contact: <sip:my_sip_account@[2001:123:aa:123::2]:5060;transport=TCP>
> ...
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list