Barfjelly / google-voice-sipsorcery-dialplans

Automatically exported from code.google.com/p/google-voice-sipsorcery-dialplans
0 stars 1 forks source link

CNAM look up not working properly - only showing number if not in name table #148

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using the Simple Dial Plan with CNAM, I get either the name & number from my 
look up table, or if not in the table, I get the callers number in both the 
name and number line. So I have two lines with their number.
2. I'm using GV>ipKall/SipSorcery/OBI202
3. When I view the call from Sipsorcery call window I see the city, state. 

What is the expected output? What do you see instead?
I'd rather see the City, State if the number isn't in the white pages.

What version of the product are you using? On what operating system?
I have been using Windows 7 Pro or Windows 7 Home edition. Mostly 7 Pro though.

Please provide any additional information below.
The file I attached is obviously not the one I'm using. I've removed my 
personal information. I have my own WP_KEY and have uncommented it with the key 
in it. I can see the City, State show up in SipSorcery, but it does not come 
through on my phone. It will change it to the correct name from my name table, 
but other numbers will not show the city state etc...

Can you help me with the missing or incorrect code? I didn't make any changes 
other than the personalization.

Original issue reported on code.google.com by tye...@gmail.com on 26 Nov 2012 at 9:48

Attachments:

GoogleCodeExporter commented 8 years ago
If the city and state appear in Sipsorcery console then the code properly 
retrieved this information from WP. So, the problem most certainly is that your 
phone can't interpret and display this info properly.

Please try playing with this line:

cname ||= dname; cname ||= "#{city}, #{state}" if city && state

Maybe a comma between city and state is confusing your phone. Try changing it 
to:

cname ||= dname; cname ||= "#{city} #{state}" if city && state

or leave just city and see if it helps.

Original comment by mte...@gmail.com on 27 Nov 2012 at 4:40

GoogleCodeExporter commented 8 years ago

Original comment by easter...@gmail.com on 27 Nov 2012 at 1:40

GoogleCodeExporter commented 8 years ago
Thanks for the suggestions. I tried removing "," then removing "{state}"
then returned it back to the original and all three outputs are the same.
Please see the attached jpg. This shows that it comes in with city and
state, but then the output shows the number (for the city & state). My
phone displays exactly what is shown at the beginning of the string on the
top line. Then it shows the phone number behind sip: on the second line.

For example, the bottom call comes in from Anoka and looks at my CNAM phone
list and changes it to Blaine High School. The next 3 calls come in from
Minneapolis, MN, but are changed to the number only.

Why does it revert to the number and strip off the City & State?

Original comment by tye...@gmail.com on 27 Nov 2012 at 5:07

GoogleCodeExporter commented 8 years ago
Unfortunately, I couldn't find attached JPG. Could you please attach Sipsorcery 
console log for a "good" and a "bad" call? Once we know what can be safely 
passed to your phone we'll try to adjust CNAM output the exactly the same 
format.

Original comment by mte...@gmail.com on 27 Nov 2012 at 7:03

GoogleCodeExporter commented 8 years ago
I'm sorry, but I don't understand what you need. I've never used the
console before. What command do I use to get this log? I can copy and paste
what shows up in the log into this comment field. I assume that I can make
a call and capture that info in the log.

I attached the jpg again, I hope you can see that now.

Original comment by tye...@gmail.com on 27 Nov 2012 at 8:42

GoogleCodeExporter commented 8 years ago
Unfortunately, the JPG do not show up. Console log:

1. Go to www.sipsorcery.com, do Silverlight login.
2. Click on "Console" and then "Connect".
3. Receive a call, select whatever appears in the console, press Ctrl-C to copy.
4. Paste into your message (remove private info, if any).

Again, I need to see 2 calls (good and bad).

Original comment by mte...@gmail.com on 28 Nov 2012 at 3:42

GoogleCodeExporter commented 8 years ago
Here is a good call.
Monitor 03:56:59:021: basetype=console, ipaddress=*, user=XXXXXX, event=*,
request=*, serveripaddress=*, server=*, regex=.*.
DialPlan 03:57:15:740 sip1(19192): Using dialplan Working Simple Dial Plan
11-16-12 for In call to sip:tyeske@sipsorcery.com.
NewCall 03:57:15:740 sip1(19192): Executing script dial plan for call to
tyeske.
DialPlan 03:57:15:802 sip1(19192): ** Call from "GOLDEN VLY MN" <
sip:763222XXXX@66.54.140.46>;tag=as2a24af34 to tyeske **
DialPlan 03:57:15:802 sip1(19192): Caller's number: '1763222XXXX'
DialPlan 03:57:15:802 sip1(19192): Caller's name: 'Dads cell'
DialPlan 03:57:15:802 sip1(19192): Commencing Dial with: tyeske@local
[fu=1763222XXXX].
DialPlan 03:57:15:818 sip1(19192): Call leg is for local domain looking up
bindings for tyeske@sipsorcery.com for call leg tyeske@local.
DialPlan 03:57:15:818 sip1(19192): 1 found for tyeske@sipsorcery.com.
DialPlan 03:57:15:818 sip1(19192): ForkCall commencing call leg to
sip:tyeske@67.4.171.209:20003.
DialPlan 03:57:15:818 sip1(19192): SIPClientUserAgent Call using alternate
outbound proxy of udp:67.222.131.147:5060.
DialPlan 03:57:15:818 sip1(19192): Switching to
sip:tyeske@67.4.171.209:20003 via udp:67.222.131.147:5060.
DialPlan 03:57:15:818 sip1(19192): SDP on UAC call had public IP not
mangled, RTP socket 66.54.140.46:22342.
DialPlan 03:57:15:881 sip1(19192): Information response 100 Trying for
sip:tyeske@67.4.171.209:20003.
DialPlan 03:57:15:896 sip1(19192): Information response 180 Ringing for
sip:tyeske@67.4.171.209:20003.
DialPlan 03:57:15:896 sip1(19192): UAS call progressing with Ringing.
DialPlan 03:57:24:787 sip1(19192): Response 200 OK for
sip:tyeske@67.4.171.209:20003.
DialPlan 03:57:24:787 sip1(19192): SDP on UAC response had public IP not
mangled, RTP socket 67.4.171.209:16892.
DialPlan 03:57:24:787 sip1(19192): Cancelling all call legs for ForkCall
app.
DialPlan 03:57:24:787 sip1(19192): Answering client call with a response
status of 200.
DialPlan 03:57:24:787 sip1(19192): Dial command was successfully answered
in 8.97s.
DialPlan 03:57:24:787 sip1(19192): Dialplan cleanup for tyeske.
DialPlan 03:57:24:990 sip1(19192): Dial plan execution completed with
normal clearing.
DialPlan 03:57:29:662 sip1(19192): Matching dialogue found for BYE to sip:
67.222.131.147:5060 from udp:67.222.131.147:5060.

Here is one that shows just the number.

Monitor 04:03:09:746: basetype=console, ipaddress=*, user=XXXX, event=*,
request=*, serveripaddress=*, server=*, regex=.*.
DialPlan 04:03:44:262 sip1(19192): Using dialplan Working Simple Dial Plan
11-16-12 for In call to sip:tyeske@sipsorcery.com.
NewCall 04:03:44:277 sip1(19192): Executing script dial plan for call to
tyeske.
DialPlan 04:03:44:324 sip1(19192): ** Call from "TWINCITIES MN" <
sip:763843XXXX@66.54.140.46>;tag=as1cd62cab to tyeske **
DialPlan 04:03:44:324 sip1(19192): WebGet attempting to read from
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url
%3D'http%3A%2F%2Fapi.whitepages.com%2Freverse_phone%2F1.0%2F%3Fphone%3D763843963
5%3Bapi_key%3D325b90212e407257f8b960aba59e0baa'%20and%20itemPath%3D'wp.listings.
listing'&format=json
.
DialPlan 04:03:44:699 sip1(19192): Caller's number: '1763843XXXX'
DialPlan 04:03:44:699 sip1(19192): Commencing Dial with: tyeske@local
[fu=1763843XXXX].
DialPlan 04:03:44:746 sip1(19192): Call leg is for local domain looking up
bindings for tyeske@sipsorcery.com for call leg tyeske@local.
DialPlan 04:03:44:777 sip1(19192): 1 found for tyeske@sipsorcery.com.
DialPlan 04:03:44:777 sip1(19192): ForkCall commencing call leg to
sip:tyeske@67.4.171.209:20003.
DialPlan 04:03:44:777 sip1(19192): SIPClientUserAgent Call using alternate
outbound proxy of udp:67.222.131.147:5060.
DialPlan 04:03:44:777 sip1(19192): Switching to
sip:tyeske@67.4.171.209:20003 via udp:67.222.131.147:5060.
DialPlan 04:03:44:777 sip1(19192): SDP on UAC call had public IP not
mangled, RTP socket 66.54.140.46:18832.
DialPlan 04:03:44:855 sip1(19192): Information response 100 Trying for
sip:tyeske@67.4.171.209:20003.
DialPlan 04:03:44:855 sip1(19192): Information response 180 Ringing for
sip:tyeske@67.4.171.209:20003.
DialPlan 04:03:44:855 sip1(19192): UAS call progressing with Ringing.
Registrar 04:03:47:137 sip1(2396): Authentication required for
tyeske@sipsorcery.com from udp:67.4.171.209:20003.
Registrar 04:03:47:230 sip1(2396): Binding update request for
tyeske@sipsorcery.com from udp:67.4.171.209:20003, expiry requested 120s
granted 120s.
RegisterSuccess 04:03:47:230 sip1(2396): Registration successful for
tyeske@sipsorcery.com from udp:67.4.171.209:20003, binding
sip:tyeske@67.4.171.209:20003;expiry=120.
DialPlan 04:03:49:355 sip1(19192): Response 200 OK for
sip:tyeske@67.4.171.209:20003.
DialPlan 04:03:49:355 sip1(19192): SDP on UAC response had public IP not
mangled, RTP socket 67.4.171.209:16896.
DialPlan 04:03:49:355 sip1(19192): Cancelling all call legs for ForkCall
app.
DialPlan 04:03:49:355 sip1(19192): Answering client call with a response
status of 200.
DialPlan 04:03:49:371 sip1(19192): Dial command was successfully answered
in 4.59s.
DialPlan 04:03:49:371 sip1(19192): Dialplan cleanup for tyeske.
DialPlan 04:03:49:762 sip1(19192): Dial plan execution completed with
normal clearing.
DialPlan 04:03:52:965 sip1(19192): Matching dialogue found for BYE to sip:
67.222.131.147:5060 from udp:67.222.131.147:5060.

Thanks for all the help.

On Tue, Nov 27, 2012 at 9:42 PM, <
google-voice-sipsorcery-dialplans@googlecode.com> wrote:

Original comment by tye...@gmail.com on 28 Nov 2012 at 4:06

GoogleCodeExporter commented 8 years ago
Try changing:

sys.SetFromHeader((cname || name), nil, 'sipsorcery.com') # Set FromName & 
FromHost for sys.Dial

to 

sys.SetFromHeader((cname || req.Header.From), nil, 'sipsorcery.com') # Set 
FromName & FromHost for sys.Dial

Original comment by mte...@gmail.com on 28 Nov 2012 at 4:15

GoogleCodeExporter commented 8 years ago
I just tried that, but now the home phone only rings once at home. When I
call my home phone, it still rings 5 times before VM picks up. I suppose it
would help to get the output from a call right?

On Tue, Nov 27, 2012 at 10:15 PM, <
google-voice-sipsorcery-dialplans@googlecode.com> wrote:

Original comment by tye...@gmail.com on 28 Nov 2012 at 2:05

GoogleCodeExporter commented 8 years ago
If you mean the console output then yes, it'd help to see it.

Original comment by mte...@gmail.com on 28 Nov 2012 at 2:10

GoogleCodeExporter commented 8 years ago
Here is the output.

Monitor 14:17:12:287: basetype=console, ipaddress=*, user=tyeske, event=*,
request=*, serveripaddress=*, server=*, regex=.*.
DialPlan 14:17:28:897 sip1(18744): Using dialplan Working Simple Dial Plan
11-16-12 for In call to sip:tyeske@sipsorcery.com.
NewCall 14:17:28:912 sip1(18744): Executing script dial plan for call to
tyeske.
DialPlan 14:17:28:944 sip1(18744): ** Call from "MINNEAPOLS MN" <
sip:6127821320@66.54.140.46>;tag=as4cdba880 to tyeske **
DialPlan 14:17:28:944 sip1(18744): WebGet attempting to read from
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url
%3D'http%3A%2F%2Fapi.whitepages.com%2Freverse_phone%2F1.0%2F%3Fphone%3D612782132
0%3Bapi_key%3D325b90212e407257f8b960aba59e0baa'%20and%20itemPath%3D'wp.listings.
listing'&format=json
.
DialPlan 14:17:29:287 sip1(18744): Caller's number: '16127821320'
DialPlan 14:17:29:287 sip1(18744): ** Error: can't convert
SIPSorcery::SIP::SIPFromHeader into Symbol
DialPlan 14:17:29:287 sip1(18744): Dialplan cleanup for tyeske.
DialPlan 14:17:29:475 sip1(18744): Dial plan execution completed without
answering and with no last failure status.
DialPlan 14:17:29:475 sip1(18744): UAS call failed with a response status
of 480.
Registrar 14:17:54:491 sip1(2396): Binding update request for
tyeske@sipsorcery.com from udp:67.4.171.209:20003, expiry requested 120s
granted 120s.
RegisterSuccess 14:17:54:507 sip1(2396): Registration successful for
tyeske@sipsorcery.com from udp:67.4.171.209:20003, binding
sip:tyeske@67.4.171.209:20003;expiry=120.

On Wed, Nov 28, 2012 at 8:10 AM, <
google-voice-sipsorcery-dialplans@googlecode.com> wrote:

Original comment by tye...@gmail.com on 28 Nov 2012 at 2:18

GoogleCodeExporter commented 8 years ago
You need to add .to_s:

sys.SetFromHeader((cname || req.Header.From.to_s), nil, 'sipsorcery.com') # Set 
FromName & FromHost for sys.Dial

Original comment by mte...@gmail.com on 28 Nov 2012 at 2:37

GoogleCodeExporter commented 8 years ago
I think it is working now. Here is the output after making that change. I
now see the call in and out, so I assume it is ringing through. With the
previous change, it only rang once at home. There isn't anyone home at the
moment to verify the call is ringing through, but you may be able to see it
from the log.

Thanks for all the help. I really like the script and adding the CNAM and
white pages lookup is awesome.

Monitor 14:42:58:401: basetype=console, ipaddress=*, user=tyeske, event=*,
request=*, serveripaddress=*, server=*, regex=.*.
DialPlan 14:43:16:995 sip1(21900): Using dialplan Working Simple Dial Plan
11-16-12 for In call to sip:tyeske@sipsorcery.com.
NewCall 14:43:16:995 sip1(21900): Executing script dial plan for call to
tyeske.
DialPlan 14:43:17:042 sip1(21900): ** Call from "MINNEAPOLS MN" <
sip:6127821320@66.54.140.46>;tag=as6a8dfadf to tyeske **
DialPlan 14:43:17:042 sip1(21900): WebGet attempting to read from
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url
%3D'http%3A%2F%2Fapi.whitepages.com%2Freverse_phone%2F1.0%2F%3Fphone%3D612782132
0%3Bapi_key%3D325b90212e407257f8b960aba59e0baa'%20and%20itemPath%3D'wp.listings.
listing'&format=json
.
DialPlan 14:43:17:417 sip1(21900): Caller's number: '16127821320'
DialPlan 14:43:17:417 sip1(21900): Commencing Dial with:
tyeske@local[fu=16127821320].
DialPlan 14:43:17:417 sip1(21900): Call leg is for local domain looking up
bindings for tyeske@sipsorcery.com for call leg tyeske@local.
DialPlan 14:43:17:432 sip1(21900): 1 found for tyeske@sipsorcery.com.
DialPlan 14:43:17:432 sip1(21900): ForkCall commencing call leg to
sip:tyeske@67.4.171.209:20003.
DialPlan 14:43:17:432 sip1(21900): SIPClientUserAgent Call using alternate
outbound proxy of udp:67.222.131.147:5060.
DialPlan 14:43:17:432 sip1(21900): Switching to
sip:tyeske@67.4.171.209:20003 via udp:67.222.131.147:5060.
DialPlan 14:43:17:432 sip1(21900): SDP on UAC call had public IP not
mangled, RTP socket 66.54.140.46:21484.
DialPlan 14:43:17:495 sip1(21900): Information response 100 Trying for
sip:tyeske@67.4.171.209:20003.
DialPlan 14:43:17:510 sip1(21900): Information response 180 Ringing for
sip:tyeske@67.4.171.209:20003.
DialPlan 14:43:17:510 sip1(21900): UAS call progressing with Ringing.
DialPlan 14:43:40:636 sip1(21900): Client call cancelled halting dial plan.
DialPlan 14:43:40:636 sip1(21900): Dialplan call was terminated by client
side due to ClientCancelled.
DialPlan 14:43:40:636 sip1(21900): Cancelling all call legs for ForkCall
app.
DialPlan 14:43:40:636 sip1(21900): Cancelling forwarded call leg, sending
CANCEL to sip:tyeske@67.4.171.209:20003.
DialPlan 14:43:40:651 sip1(21900): Dial command was halted by cancellation
of client call after 23.20s.
DialPlan 14:43:40:651 sip1(21900): Dialplan cleanup for tyeske.
DialPlan 14:43:40:698 sip1(21900): Response 487 Request Terminated for
sip:tyeske@67.4.171.209:20003.
DialPlan 14:43:41:042 sip1(21900): Dial plan execution completed with
normal clearing.
Registrar 14:43:56:855 sip1(2396): Binding update request for
tyeske@sipsorcery.com from udp:67.4.171.209:20003, expiry requested 120s
granted 120s.
RegisterSuccess 14:43:56:855 sip1(2396): Registration successful for
tyeske@sipsorcery.com from udp:67.4.171.209:20003, binding
sip:tyeske@67.4.171.209:20003;expiry=120.

On Wed, Nov 28, 2012 at 8:37 AM, <
google-voice-sipsorcery-dialplans@googlecode.com> wrote:

Original comment by tye...@gmail.com on 28 Nov 2012 at 2:49

GoogleCodeExporter commented 8 years ago
You're welcome! I think I need to comment: the city and state do not come from 
White Pages... for some reason you're not getting ANY response from their 
server.

City and state are detected and added by IPKall, so I just relayed this info to 
your phone. I have no idea what's wrong with WP (it maybe your WP API key, or 
you exceeded the limit, or their db doesn't have any info on your callers) but 
anyway, should it ever come back to life the script will automatically switch 
onto it.

Original comment by mte...@gmail.com on 28 Nov 2012 at 3:26

GoogleCodeExporter commented 8 years ago
I really appreciate the help. I didn't know that the city, state were
coming from IPKall. I just recently signed up for the WP API key. I'm sure
I haven't exceeded the limit as I generally only get a few calls per day.
This is my home line and it's not even used for craigslist or anything like
that.

Is there a change that should be made to the simple dial plan? Or is my
situation just different?

Thanks again,
Troy

On Wed, Nov 28, 2012 at 9:26 AM, <
google-voice-sipsorcery-dialplans@googlecode.com> wrote:

Original comment by tye...@gmail.com on 28 Nov 2012 at 3:53

GoogleCodeExporter commented 8 years ago
I haven't changed the code in a long time and I doubt it's incorrect since it 
works for many people around the globe. Most certainly the problem is in your 
WP key, I'd suggest that you double-check it.

Original comment by mte...@gmail.com on 28 Nov 2012 at 4:53

GoogleCodeExporter commented 8 years ago
Great catch. I copied it directly from the email and pasted it into my
dialplan to compare. It was one digit off. I had a 6 and it should have
been a b.

Thanks again!

On Wed, Nov 28, 2012 at 10:53 AM, <
google-voice-sipsorcery-dialplans@googlecode.com> wrote:

Original comment by tye...@gmail.com on 28 Nov 2012 at 4:59

GoogleCodeExporter commented 8 years ago
You can close this now. Everything is working great! The display for known
or unknown calls show up as expected.

Original comment by tye...@gmail.com on 5 Dec 2012 at 5:10

GoogleCodeExporter commented 8 years ago

Original comment by mte...@gmail.com on 5 Dec 2012 at 5:17