News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

Google Call Back Clarification

Started by Hortoristic, February 13, 2014, 01:23:20 PM

Previous topic - Next topic

azrobert

I guess I don't know as much about Ruby than I thought.

Anyway, I went back to the original WebGet and put the "Unknown" after the WebGet if the variable is null.

azrobert

Made another mistake.
I moved the syslog after the "Unknown"

tyeske

#22
I updated my script using your latest version. I also switched to an IPComms DID. Got that verified with Google and pointed it to SS.

Now IPComms seems to reliably send the correct number. When I call my number from my mobile or my wife called it from work, I get the proper number to display, but it still displays unknown name. I just received a call from Chicago and it displayed the number and Chicago, IL. We're making progress. But the TNAME doesn't work. I'm curious why my cell and her work number came up unknown?

Here is my log from SS when I call from my cell phone.

DialPlan 22:24:23:617 sip1(20128): Using dialplan Working Simple Dial Plan 3-2-14 for In call to sip:XXXXX@sipsorcery.com.
NewCall 22:24:23:648 sip1(20128): Executing script dial plan for call to XXXXX.
DialPlan 22:24:23:679 sip1(20128): ** Call from "GOLDEN VLY MN" <sip:7632223441@66.54.140.46>;tag=as60d33d64 to XXXXX **
DialPlan 22:24:23:679 sip1(20128): CallerID:   7630000000
DialPlan 22:24:23:695 sip1(20128): WebGet attempting to read from https://api.opencnam.com/v2/phone/7630000000?format=text.
DialPlan 22:24:23:976 sip1(20128): Error in WebGet for https://api.opencnam.com/v2/phone/7630000000?format=text.
DialPlan 22:24:23:976 sip1(20128): CallerName: Unknown
DialPlan 22:24:23:976 sip1(20128): CName: Unknown
DialPlan 22:24:23:976 sip1(20128): CallerName: Unknown
DialPlan 22:24:23:976 sip1(20128): Commencing Dial with: tyeske@local[fu=7630000000,fd=Unknown].
DialPlan 22:24:23:992 sip1(20128): Call leg is for local domain looking up bindings for XXXXX@sipsorcery.com for call leg XXXXX@local.
DialPlan 22:24:23:992 sip1(20128): 1 found for XXXXX@sipsorcery.com.
DialPlan 22:24:23:992 sip1(20128): ForkCall commencing call leg to sip:XXXXX@97.116.165.126:5061.
DialPlan 22:24:23:992 sip1(20128): SIPClientUserAgent Call using alternate outbound proxy of udp:67.222.131.147:5060.
DialPlan 22:24:23:992 sip1(20128): Switching to sip:XXXXX@97.116.165.126:5061 via udp:67.222.131.147:5060.
DialPlan 22:24:23:992 sip1(20128): SDP on UAC call had public IP not mangled, RTP socket 66.54.140.46:16096.
DialPlan 22:24:24:085 sip1(20128): Information response 100 Trying for sip:XXXXX@97.116.165.126:5061.
DialPlan 22:24:24:101 sip1(20128): Information response 180 Ringing for sip:XXXXX@97.116.165.126:5061.
DialPlan 22:24:24:101 sip1(20128): UAS call progressing with Ringing.
DialPlan 22:24:28:773 sip1(20128): Client call cancelled halting dial plan.
DialPlan 22:24:28:773 sip1(20128): Dialplan call was terminated by client side due to ClientCancelled.
DialPlan 22:24:28:773 sip1(20128): Cancelling all call legs for ForkCall app.
DialPlan 22:24:28:773 sip1(20128): Cancelling forwarded call leg, sending CANCEL to sip:XXXXX@97.116.165.126:5061.
DialPlan 22:24:28:804 sip1(20128): Dial command was halted by cancellation of client call after 4.81s.
DialPlan 22:24:28:804 sip1(20128): Dialplan cleanup for XXXXX.
DialPlan 22:24:28:867 sip1(20128): Response 487 Request Terminated for sip:XXXXX@97.116.165.126:5061.
DialPlan 22:24:29:226 sip1(20128): Dial plan execution completed with normal clearing.

azrobert

The WebGet fails with your caller's CID.
See your trace:
DialPlan 22:24:23:976 sip1(20128): Error in WebGet for https://api.opencnam.com/v2/phone/7630000000?format=text.

I'm still using GV, so I'm not using Opencnam daily. I'm planning to switch to it when GV XMPP dies. I did a fair amount of testing and I never saw this error.

I went to Opencnam's Web site to see if anything changed, here:
https://www.opencnam.com/

The example they have uses a prefix  "+1". I tried it with the failing CID and it still fails. It works with my CID. I updated the script to include the "+1".

The original dialplan example I gave you had problems because of the WebGet failure. When the WebGet failed the result was a nil value. This caused the Split command to fail and then the dialplan aborted. This is why the calls weren't coming through.

To fix the problem I set the result to "Unknown' when the WebGet fails. 

The trace shows that IPComms is providing the City and State for cname. Again from your trace:
DialPlan 22:24:23:679 sip1(20128): ** Call from "GOLDEN VLY MN"

I changed the dialplan to use IPComms' cname instead of "Unknown" when the WebGet fails.
This is the best I can do.

You say the TNAME table is not working. I checked the code and it's the same as my working dialplan. My table works.

Make sure the last entry in the table does NOT have a comma after the name and it ends with a bracket.

One more thing about Opencnam. I tested them a long time ago and they were terrible. I didn't get any CID matches. My current testing was very good. I tried several friends and family CIDs and I got a match on all. I believe they are constantly updating their database, but don't expect them to be as good as Whitepages.


lhm.

And whitepages cnam is not as good as CallCentric, at least for me. YMMV

Koby

Don't know if anyone has mentioned it yet but this article, "How it used to be done: How to use Google Voice for free outgoing calls on an Asterisk/FreePBX system (the no-XMPP way)" showed how to implement the callback method in Asterisk.  Since it's pretty easy nowadays to set up a functional Asterisk PBX on a miniscule computer (see "Asterisk for Raspberry Pi", "Asterisk for BeagleBone Black"), that might be an option if you don't want to pay for SipSorcery or would like to have some of the features offered in a real PBX.

tyeske

#26
azrobert:

I tried your latest version and now I get the number instead of "unknown" where the name/city state should be. Is this an easy correction? I rang my phone, but I didn't answer.

I checked and now I can't make any outgoing calls.

Here is my log from the console.

Monitor 00:59:34:539: basetype=console, ipaddress=*, user=XXXXX, event=*, request=*, serveripaddress=*, server=*, regex=.*.
Registrar 00:59:51:633 sip1(5520): Binding update request for tXXXXX@sipsorcery.com from udp:97.116.165.126:5061, expiry requested 120s granted 120s.
RegisterSuccess 00:59:51:665 sip1(5520): Registration successful for XXXXX@sipsorcery.com from udp:97.116.165.126:5061, binding sip:XXXXX@97.116.165.126:5061;expiry=120.
DialPlan 01:00:00:977 sip1(18384): Using dialplan Working Simple Dial Plan 3-3-14 for In call to sip:XXXXX@sipsorcery.com.
NewCall 01:00:01:009 sip1(18384): Executing script dial plan for call to XXXXX.
DialPlan 01:00:01:055 sip1(18384): CallerID:   7630000000
DialPlan 01:00:01:055 sip1(18384): WebGet attempting to read from https://api.opencnam.com/v2/phone/7630000000?format=text.
DialPlan 01:00:01:556 sip1(18384): Error in WebGet for https://api.opencnam.com/v2/phone/7630000000?format=text.
DialPlan 01:00:01:556 sip1(18384): CallerName:
DialPlan 01:00:01:556 sip1(18384): There was a missing method exception in your dial plan: undefined method `split' for nil:NilClass.
DialPlan 01:00:01:556 sip1(18384): Dialplan cleanup for tyeske.
DialPlan 01:00:02:040 sip1(18384): Dial plan execution completed without answering and had an execution error message of Dial plan missing method.
DialPlan 01:00:02:040 sip1(18384): UAS call failed with a response status of 500 and Dial plan missing method.

Since we couldn't get this to work, I tried a couple of other dial plans out there. It was more important to see the name and number and I already had a pretty big table. I tried this one and it worked for me.

http://code.google.com/p/google-voice-sipsorcery-dialplans/source/browse/trunk/SIP%20Sorcery%20Dial%20Plans/Contrib/Simple%20Dial%20Plan%20with%20CNAM%20and%20VM/SDP_with_CNAM_and_VM

It still shows the number instead of city state, but the CNAM works for everyone on my table.

kccasey

How do I edit my Dial plan since I have GV setup as my SP to include OpenCNAM API script?

azrobert

This script is for the SipSorcery service and not for an OBi. You route the call to SipSorcery and it adds the CNAM.

http://www.sipsorcery.com/mainsite/Home/Pricing

SteveInWA

Quote from: kccasey on September 10, 2015, 08:29:07 AM
How do I edit my Dial plan since I have GV setup as my SP to include OpenCNAM API script?

You've been posting similar questions in multiple unrelated threads.  Please read the replies before peanut-buttering the forum with the same issue.

OBi 1xx, 2xx and 3xx ATA devices do not directly support querying a LIBD for CNAM, nor do they have an internal phone book as do the OBi 1000 series IP phones.

irosenman has already described a solution that involves piping the calls through a local PBX running on a Raspberry Pi, if you must have CNAM, or you can forward your GV calls to a SIP VoIP service provider like Callcentric that does include CNAM, as azrobert pointed out.