Summary:ASTERISK-12572: [patch] Dynamic realtime capability for FindMe/FollowMe
Reporter:Tilghman Lesher (tilghman)Labels:
Date Opened:2008-08-13 00:21:30Date Closed:2008-08-25 10:54:00
Versions:Frequency of
Environment:Attachments:( 0) 20080813__followme_realtime_enabled.diff.txt
( 1) 20080820-SVN-branch-1.4-followme_realtime.patch.txt
Description:As requested on -dev list
Comments:By: Sergey Tamkovich (sergee) 2008-08-13 07:29:06

+ else if (!strcasecmp(param, "followme-status-prompt") || !strcasecmp(param, "status_prompt"))

What is the purpose of double names? why did you add synonyms?

By: Tilghman Lesher (tilghman) 2008-08-13 09:15:20

Because '-' is not a character accepted in many SQL databases within field names, and because there is not a single standard within SQL for quoting field names.

By: Matt Riddell (zx81) 2008-08-13 20:13:10

Why the loss of followme though?

By: Tilghman Lesher (tilghman) 2008-08-13 21:22:42

ZX81:  I don't understand the question.

By: Daniel Ferrer (dferrer) 2008-08-19 21:44:26

Good job Corydon76!
I've tested your patch, I backported it to 1.4 branch to test&use. I had to change ast_str_make_space for ast_malloc because there is no ast_str_make_space in 1.4 branch, and was a bit difficult to port.

There is a bug in your patch if extconfig.conf is not complete, for example if I only define followme table, and not define followme_numbers:
followme => mysql,ipcontact14,followme
;followme_numbers => mysql,ipcontact14,followme_numbers

- followme table (name,musicclass,context,takecall,...):
- followme_numbers table (name,ordinal,phonenumber,timeout)

This makes asterisk crash with segmentation fault when you call app Followme in dialplan, f is NULL in that case.
+ if (f->realtime) {
+   /* Not in list */
+   free_numbers(f);
+   ast_free(f);
+ }

I only changed first line for something like this:
+ if (f && f->realtime) {

By: Tilghman Lesher (tilghman) 2008-08-25 10:48:07

dferrer:  I see, but it is your backport which introduced the problem which you had to fix.  If you look at the trunk version, you'll see that in the check for (!f) just after calling find_realtime, the trunk version immediately returns 0, instead of setting res=0.  This means that the fix you detailed was only necessary in your 1.4 backport.

By: Digium Subversion (svnbot) 2008-08-25 10:53:57

Repository: asterisk
Revision: 139775

U   trunk/apps/app_followme.c
A   trunk/doc/followme.txt

r139775 | tilghman | 2008-08-25 10:53:57 -0500 (Mon, 25 Aug 2008) | 7 lines

Realtime capabilities for the Find-Me-Follow-Me application.
(closes issue ASTERISK-12572)
Reported by: Corydon76
      20080813__followme_realtime_enabled.diff.txt uploaded by Corydon76 (license 14)
Tested by: dferrer