suggestion or fix for extensions with dashes in it

Discussions about development of VICIDIAL and astGUIclient

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

suggestion or fix for extensions with dashes in it

Postby bobbymc » Wed Jun 29, 2011 8:51 pm

the dialer will not populate the live_sip_channel table if the exntesion in the phones table has a - in it..

here is a code suggestions update for AST_update.pl

#old code
#$extension =~ s/^SIP\/|-\S+$//gi;

#new code
$extension =~ s/^SIP\/|-[^-]*$//gi;


#old code
if ($SIP_client_count)
{
$channel_match=$channel;
$channel_match =~ s/-\S+$//gi;
$channel_match =~ s/^SIP\///gi;
$channel_match =~ s/\*/\\\*/gi;
# print "checking for SIP client: |$channel_match|\n";
if ($SIP_client_list =~ /\|$channel_match\|/i) {$line_type = 'CLIENT';}
}

#new code


if ($SIP_client_count)
{
$channel_match=$channel;
#$channel_match =~ s/-\S+$//gi;
$channel_match =~ s/-[^-]*$//gi;
$channel_match =~ s/^SIP\///gi;
$channel_match =~ s/\*/\\\*/gi;
# print "checking for SIP client: |$channel_match|\n";
if ($SIP_client_list =~ /\|$channel_match\|/i) {$line_type = 'CLIENT';}
}
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Postby mflorell » Wed Jun 29, 2011 9:17 pm

That is generally not recommended for several reasons, but please post this to the Issue Tracker in case anyone else would like this.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Wed Jun 29, 2011 10:02 pm

Maybe it would be better to change the code to disallow dashes in the phones table 8)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20019
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby mflorell » Thu Jun 30, 2011 7:27 am

Are you offering to write a patch? :)

Honestly we've never had a problem with this, and this is the first I've heard of it being a potential problem.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Thu Jun 30, 2011 11:57 am

if at least ONE of my clients had ever experienced the issue ... i'd have written the patch and posted it already. but we have a policy about looking for problems without a client ... LOL 8)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20019
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby bobbymc » Mon Jan 23, 2012 7:56 pm

matt what are the reasons that this is not recommended?
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Postby mflorell » Mon Jan 23, 2012 10:45 pm

That's an easy one, because Asterisk SIP channel names will have the extension with a dash then a unique id, so it's already used as a delimiter, and if you include it as a part of the extension it will cause problems.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: suggestion or fix for extensions with dashes in it

Postby bobbymc » Tue Jul 10, 2012 6:08 am

the reason for this is to have a multi tenant system where the extension can be used over and over but the sip lines register username will include the context in it. This way you can setup separate systems where one group cant access the other groups context and still have the ability to reuse extension 100 for example.

Just a though =)
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am


Return to Development

Who is online

Users browsing this forum: No registered users and 12 guests