[Home]

Summary:ASTERISK-25689: pjsip show contacts not working in Asterisk 13.7rc2
Reporter:Marcelo Terres (mhterres)Labels:
Date Opened:2016-01-12 06:38:43.000-0600Date Closed:
Priority:MajorRegression?
Status:Open/NewComponents:Resources/res_pjsip
Versions:13.6.0 Frequency of
Occurrence
Related
Issues:
Environment:Asterisk 13.7rc2, Ubuntu 14.04.3 LTS, Linux rtc 4.1.5-x86_64-linode61 #7 SMP Mon Aug 24 13:46:31 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux Attachments:
Description:When I was testing Asterisk 13.7rc2 I noticed that pjsip show contacts can't show realtime contacts.

Contacts 10 and 99 are realtime. Contact mos is configured in pjsip.conf.

In Asterisk 13.6.0:

Connected to Asterisk 13.6.0 currently running on rtc (pid = 321)
Core debug is still 3.
rtc*CLI> pjsip show contacts

 Contact:  <Aor/ContactUri...................................>  <Status....>  <RTT(ms)..>
=========================================================================================

 Contact:  10/sip:10@XXX.XX.XX.XXX:34440;ob                     Avail             681.245
 Contact:  99/sip:99@XXX.XX.X.XXX:62091;transport=UDP;rinstanc  Avail             187.123
 Contact:  mos/sip:voip.XXXXXX.com.br:5060                Avail             152.910

Now in Asterisk 13.7.0 rc2

Connected to Asterisk 13.7.0-rc2 currently running on rtc (pid = 1392)
Core debug is still 3.
   -- Added contact 'sip:99@XXX.XX.X.XXX:62091;transport=UDP;rinstance=c1f5348bf94c822d' to AOR '99' with expiration of 60 seconds
Contact 99/sip:99@XXX.XX.X.XXX:62091;transport=UDP;rinstance=c1f5348bf94c822d has been created
Contact 99/sip:99@XXX.XX.X.XXX:62091;transport=UDP;rinstance=c1f5348bf94c822d is now Reachable.  RTT: 160.179 msec
   -- Added contact 'sip:10@XXX.XX.XX.XXX:34440;ob' to AOR '10' with expiration of 900 seconds
Contact 10/sip:10@XXX.XX.XX.XXX:34440;ob has been created
Endpoint 10 is now Reachable
Contact 10/sip:10@XXX.XX.XX.XXX:34440;ob is now Reachable.  RTT: 717.956 msec
[Jan 12 10:27:16] NOTICE[1422]: res_pjsip_mwi.c:719 mwi_new_subscribe: AOR 10 has no configured mailboxes. MWI subscription failed.
rtc*CLI> pjsip show contacts

 Contact:  <Aor/ContactUri..............................> <Hash....> <Status> <RTT(ms)..>
=========================================================================================

 Contact:  mos/sip:voip.XXXXXX.com.br:5060          d5d93e25df Avail       153.807

As you can see, contacts are registered, but not listed.

But if 10 try to call 99 it works.

Comments:By: Asterisk Team (asteriskteam) 2016-01-12 06:38:45.694-0600

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: Mark Michelson (mmichelson) 2016-01-12 10:44:25.991-0600

It appears that the commit that added "like" support to PJSIP CLI commands is what caused this existing problem to appear. I have a review up at https://gerrit.asterisk.org/#/c/1991 that fixes the problem.

By: Alexei Gradinari (alexei gradinari) 2016-01-29 15:28:26.907-0600

Incorrect patch.
If the regex starts with '^' the SQL request is LIKE '%^something%'.
Need to remove '^'.
The correct code is

  if (regex[0] == '^') {
          snprintf(value, sizeof(value), "%s%%", regex + 1);
  } else {
          snprintf(value, sizeof(value), "%%%s%%", regex);
  }


By: Marcelo Terres (mhterres) 2016-01-30 05:18:12.785-0600

I noticed that the problem persists in Asterisk 13.7.0 version.

By: Asterisk Team (asteriskteam) 2016-01-30 05:18:13.718-0600

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