Page 1 of 1

inbound leads when saved in DB include 1 which causes issues

PostPosted: Fri Jun 11, 2010 6:56 pm
by bobbymc
when it gets the caller id to insert a new lead for the inbound call it also includes the 1 with he number which causes issues because when calling the lead with the dialer back it calls the number with a 1 and also adds the phone_code which is the 1.. any number in the system has 10 digits but when the number has 11 digits the additional 1 at the beginning causes a issue so example the caller id is 18881234567 it inserts the lead with phone_code 1 and the number 18881234567 and when calling the number back it trys to call 118881234567

vicidial 2.0.5rc5

PostPosted: Sat Jun 12, 2010 4:09 pm
by williamconley
matt has listed the answer to this several times. in addition, if i recall, it's noted in the extensions.conf file. you can strip the first digit off inbound calls from your provider, thus sending the 10 digit actual phone to vicidial instead of the 11 digit phone_code+phone_number.

you can also request your provider send only 10 digits for the inbound caller id, but that can sometimes lead to a six month discussion as the technical support at some providers is ... not as good as it could be. generally easier to just remove the leading 1 yourself.

also, please note that 2.0.5 is no longer officially supported (and upgrading to 2.2.X via SVN is only a few lines of code ... :))

PostPosted: Mon Jun 14, 2010 4:46 pm
by bobbymc
ok. can someone tell me how i can remove the 1 myself?

PostPosted: Mon Jun 14, 2010 6:39 pm
by mflorell
I made some changes a few weeks ago to the ALL_inbound AGI(in SVN/trunk) to do some intelligent filtering when the phone_code is set to '1' to remove a leading '1' from the phone_number field.

PostPosted: Mon Jun 14, 2010 8:21 pm
by williamconley
actually, i think matt left instructions inside the agi script for inbound.

look in the trunkinbound context in extensions.conf, and you will find the agi script being executed for your inbound. inside that script are some notes for its usage.

matt and the vicidial group have left A LOT of notes in these files to help people along.

PostPosted: Wed Jun 16, 2010 5:14 pm
by bobbymc
how about something like this matt?



if($callerid =~ m/^1[2-9]{1}[0-9]{2}[2-9]{1}[0-9]{6}$/){
$callerid = substr($callerid, 1);
}

checks to see if its a us number and removed the 1?

PostPosted: Wed Jun 16, 2010 5:32 pm
by williamconley
have you tested it to remove the 1 on 11 digit numbers that have the pattern 1NXXNXXXXXX?

(um ... successfully?)

PostPosted: Wed Jun 16, 2010 11:10 pm
by mflorell
The AGI in the current SVN/trunk now does this automatically on North America(phone_code == 1) calls now, so the dialplan filtering is not necessary anymore.

PostPosted: Mon Jun 21, 2010 5:16 pm
by bobbymc
i tested the svn trunk version for this and it works like a charm. i before this addition used the code i posted above. so i thought it might be helpful to share it =)