[Home]

Summary:ASTERISK-28057: chan_sip: SipNotify via AMI behaves differently to CLI
Reporter:Peter Katzmann (pk16208)Labels:
Date Opened:2018-09-17 03:14:18Date Closed:2018-09-26 09:34:03
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/Messaging Channels/chan_sip/TCP-TLS
Versions:13.22.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:ubuntu xenialAttachments:
Description:During test with secure connections with Mitel deskphones we examined a problem with notify action via ami.
Asterisk generates a message like :
*chan_sip.c: peer '3001' HAS NOT USED (OR SWITCHED TO) TLS in favor of 'UDP' (but this was allowed in sip.conf)!*
and the Mitel phones does not react to the message.
On the other side when i initiate the notify message vi cli command *sip notify* the phones reacts and the message does not appear.

Now we compared the notify code via ami and cli and saw that there is plenty of duplicated code in the network setup with one small difference:

creat_addr differs, cli uses "create_addr(p, channame, NULL, 1)" and ami uses "create_addr(p, channame, NULL, 0)" instead.

After we made a small patch
{color:blue}
--- a/channels/chan_sip.c       2018-09-05 19:12:27.000000000 +0200
+++ b/channels/chan_sip.c       2018-09-14 16:13:33.903984495 +0200
@@ -15572,7 +15572,7 @@
                       return 0;
               }

-               if (create_addr(p, channame, NULL, 0)) {
+               if (create_addr(p, channame, NULL, 1)) {
                       /* Maybe they're not registered, etc. */
                       dialog_unlink_all(p);
                       dialog_unref(p, "unref dialog inside for loop" );
{color}

against asterisk 13.23 the message vanished and the notify via ami worked.
Due the lack of documentation of the parameter we are not sure if this is a valid fix for the problem or a cause of new problems.
Comments:By: Asterisk Team (asteriskteam) 2018-09-17 03:14:20.891-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) 2018-09-18 05:15:36.459-0500

Is this a change you plan on putting up for review and discussion?

By: Peter Katzmann (pk16208) 2018-09-18 05:41:31.334-0500

Probably i could add the patch to gerrit and send it in, but currently i'm not sure what this flag is really doing and what side effects it could produce.
The called function has no usable description about this parameter at all

By: Joshua C. Colp (jcolp) 2018-09-18 05:48:06.864-0500

If you put it up for review then others will likely look at it and help to determine if it is. Otherwise I'll leave this issue open, but chan_sip itself is community supported so it will be up to someone to look at this issue in the future.

By: Friendly Automation (friendly-automation) 2018-09-26 09:34:06.413-0500

Change 10273 merged by George Joseph:
chan_sip: SipNotify on Chan_Sip vi AMI behave different to CLI

[https://gerrit.asterisk.org/10273|https://gerrit.asterisk.org/10273]

By: Friendly Automation (friendly-automation) 2018-09-26 09:34:33.832-0500

Change 10176 merged by George Joseph:
chan_sip: SipNotify on Chan_Sip vi AMI behave different to CLI

[https://gerrit.asterisk.org/10176|https://gerrit.asterisk.org/10176]

By: Friendly Automation (friendly-automation) 2018-09-26 09:34:55.236-0500

Change 10274 merged by George Joseph:
chan_sip: SipNotify on Chan_Sip vi AMI behave different to CLI

[https://gerrit.asterisk.org/10274|https://gerrit.asterisk.org/10274]

By: Friendly Automation (friendly-automation) 2018-09-26 09:35:26.930-0500

Change 10272 merged by George Joseph:
chan_sip: SipNotify on Chan_Sip vi AMI behave different to CLI

[https://gerrit.asterisk.org/10272|https://gerrit.asterisk.org/10272]