[Asterisk-bugs] [Asterisk 0010263]: [patch] Remove requirement of line at device on Dial() syntax with chan_skinny

noreply at bugs.digium.com noreply at bugs.digium.com
Sat Jul 21 05:35:28 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10263 
====================================================================== 
Reported By:                qwell
Assigned To:                qwell
====================================================================== 
Project:                    Asterisk
Issue ID:                   10263
Category:                   Channels/chan_skinny
Reproducibility:            N/A
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-20-2007 18:43 CDT
Last Modified:              07-21-2007 05:35 CDT
====================================================================== 
Summary:                    [patch] Remove requirement of line at device on Dial()
syntax with chan_skinny
Description: 
With this patch, you don't need to do Dial(Skinny/1234 at bob) anymore, now
you can just do Dial(Skinny/1234)

All I need here are testers.  Please test and report back.
====================================================================== 

---------------------------------------------------------------------- 
 fsantulli - 07-21-07 05:35  
---------------------------------------------------------------------- 
Maybe this routine will work better as yours does not compile.

Btw, this way, you should have different line numbers on each device:

you can't have

SKINNY/1234 at bob

and 

SKINNY/1234 at steve

as if you use DIAL(SKINNY/1234) you will take only the line on the first
device in the array.

So, now, we will have a double scenario:

a) same line on multiple devices 
b) one or more unique lines on multiple devices


here is a working patch:

static struct skinny_line *find_line_by_name(const char *dest)
{
	struct skinny_line *l;
	struct skinny_device *d;
	char line[256];
	char *at;
	char *device;

	ast_copy_string(line, dest, sizeof(line));
	at = strchr(line, '@');
	if (!at) {
		ast_log(LOG_NOTICE, "Line '%s' doesn't specify a device. Will search for
it!\n", dest);
	}
	*at++ = '\0';
	device = at;
	ast_mutex_lock(&devicelock);
	for (d = devices; d; d = d->next) {
		if (!strcasecmp(d->name, device) || !at) {
			/* Found the device */
			for (l = d->lines; l; l = l->next) {
				/* Search for the right line */
				if (!strcasecmp(l->name, line)) {
        			if (skinnydebug)
        				ast_verbose("Found line %s on device %s\n", l->name, d->name);
                                        
					ast_mutex_unlock(&devicelock);
					return l;
				}
			}
		}
	}
	/* Device not found */
	if (!at)
		ast_log(LOG_NOTICE, "Cannot find line '%s' on the specified device\n",
dest);
    else
		ast_log(LOG_NOTICE, "Cannot find line '%s' in any device.\n", dest);
	ast_mutex_unlock(&devicelock);
	return NULL;
} 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-21-07 05:35  fsantulli      Note Added: 0067694                          
======================================================================




More information about the asterisk-bugs mailing list