OBiTALK Community

General Support => Day-to-Day Use => Topic started by: Hortoristic on February 13, 2014, 01:23:20 PM

Title: Google Call Back Clarification
Post by: Hortoristic on February 13, 2014, 01:23:20 PM
I've seen some posts about how we can make use of our Google number, and it will call back and connect both parties.

Can someone elaborate on how this works, or if I'm even on the right track?

Example:

Even if we are using that new small bucket of minutes that Anveo is offering, it uses the smallest increment to initiate the call, but then Google completes connecting both sides, but not using the Anveo outgoing minutes.

Is this really how GV call back can work and if so - is there a good article you can point me to; to set it up?
Title: Re: Google Call Back Clarification
Post by: drgeoff on February 13, 2014, 01:42:01 PM
AIUI the only GV "callback" method is when the call is initiated by inputting call details on a webpage at google.com/voice.  GV then calls you on the phone you have specified on that webpage.  When you answer GV rings the callee's number.  When that answers the two legs are bridged.

Normally the details are entered on the web page by a human (you).  However Sipsorcery can initiate GV calls from a phone.  It does that by accessing by its "machine" accessing the same web page and automatically inputting the required info.  (All the info except the callee number is prestored in a dialplan on the Sipsorcery server.)

When you use any phone service (SIP or POTS) to call your own GV number you then have the option to onward dial a call (at no cost in N. America).  There is no callback and you incur normal phone service charges to your GV number for the entire duration of the call (to GV and the onward call). 
Title: Re: Google Call Back Clarification
Post by: Hortoristic on February 13, 2014, 01:55:14 PM
To use SIPSorcery for this, do they make you sign up for the pricey plan?
Title: Re: Google Call Back Clarification
Post by: lhm. on February 13, 2014, 02:04:16 PM
The $69.00 plan will work fine with GV.
Title: Re: Google Call Back Clarification
Post by: Rick on February 14, 2014, 08:05:05 AM
If you have cell service which allows "Friends and Family", and you list your Google Voice number in that list, then whether you call it and it calls you back - or you call it and make a call - everything is then at no cost to you. 
Title: Re: Google Call Back Clarification
Post by: tyeske on February 26, 2014, 12:40:37 PM
I'm currently using Ipkall & Sipsorcery. Lately my CNAM isn't working, but I see I'm not the only one. I have a whitepages key, but it may have died.

I originally tried to set up my SS dialplan so that my OBI would ring SS then route the outbound call to GV.

Currently my calls are routed directly from my OBI202 to GV, but I can't seem to fix my SS dialplan to route the calls to SS first.

Can anyone help me?
Title: Re: Google Call Back Clarification
Post by: Hortoristic on February 26, 2014, 01:55:06 PM
Just curious, with SS being so expensive, why are you solutioning with them? Maybe it was free at one time?
Title: Re: Google Call Back Clarification
Post by: gderf on February 26, 2014, 02:09:31 PM
SS was free. But they now charge for it.
Title: Re: Google Call Back Clarification
Post by: azrobert on February 26, 2014, 02:32:14 PM
Quote from: tyeske on February 26, 2014, 12:40:37 PM
I'm currently using Ipkall & Sipsorcery. Lately my CNAM isn't working, but I see I'm not the only one. I have a whitepages key, but it may have died.

I originally tried to set up my SS dialplan so that my OBI would ring SS then route the outbound call to GV.

Currently my calls are routed directly from my OBI202 to GV, but I can't seem to fix my SS dialplan to route the calls to SS first.

Can anyone help me?

I'm confused at what you want to do.
Do you want to route outbound calls from the OBi phone port to SS?
If yes, assuming GV is on SP1 and SS on SP2 you can try changing the Phone Port Primary Line from SP1 Service to SP2 service.

I switched CNAME over to OpenCnam
Here is the code:

 cid = req.Header.From.FromURI.User
  cid = "#{$1}" if cid =~ /^1(\d{10})$/    
 @OpenCName ||= sys.WebGet("https://api.opencnam.com/v2/phone/#{cid}?format=text",4)
  sys.log("OpenCName: #{@OpenCName}")
  prs = @OpenCName.split(' ')
  State = prs[-1]
  if City = prs[-2]
     @cname = "#{City} #{State}"
   else
     @cname = "#{@OpenCName}"
   end
  @cname = @cname.tr(',',' ')
  sys.log("CName: #{@cname}")


Use variable @cname to display CallerID name on your phone.
If the result is a city and state it will look something like "Scottsdale        AZ".
I then remove some of the blanks and move it to variable @cname like "Scottsdale AZ"
I also remove any commas.
SS has trouble using a comma in cname.

Edit:
cid must be 10 digits.
I added code to above to remove the country code.
Title: Re: Google Call Back Clarification
Post by: tyeske on March 01, 2014, 02:13:13 PM
Azrobert thanks for the suggestions, but when I make SS my Phone Port Primary, I can initiate the call, but I can't get the call to go through. I get the call was rejected by service provider 480 error.

Here is what the SS console shows:
DialPlan 22:04:14:533 sip1(7784): Calling 1763XXXXXXX via Google Voice
DialPlan 22:04:14:533 sip1(7784): SDP on GoogleVoiceCall call had public IP not mangled, RTP socket 97.116.165.126:16804.
DialPlan 22:04:14:533 sip1(7784): UAS call progressing with Ringing.
DialPlan 22:04:14:549 sip1(7784): Logging into google.com for XXXXX@gmail.com.
DialPlan 22:04:14:580 sip1(7784): Google Voice pre-login page loaded successfully.
DialPlan 22:04:14:580 sip1(7784): GALX key XXXXXXXXXX successfully retrieved.
DialPlan 22:04:15:549 sip1(7784): Google Voice home page loaded successfully.
DialPlan 22:04:15:565 sip1(7784): Call key GWOkPogBcpVy/y81hHNjcQNB/tU= successfully retrieved for XXXXX@gmail.com, proceeding with callback.
DialPlan 22:04:15:565 sip1(22492): SIP Proxy setting application server for next call to user XXXXX as udp:67.222.131.147:5070.
DialPlan 22:04:15:627 sip1(7784): Google Voice Call to 1763XXXXXXX initiated, callback #1763XXXXXXX, phone type 1, timeout 15s.
DialPlan 22:04:30:627 sip1(7784): Google Voice Call timed out waiting for callback.
DialPlan 22:04:30:721 sip1(7784): Google Voice Call to 1763XXXXXXX was successfully cancelled.
DialPlan 22:04:30:721 sip1(7784): Dialplan cleanup for XXXXX.
DialPlan 22:04:30:752 sip1(7784): Dial plan execution completed without answering and with no last failure status.
DialPlan 22:04:30:752 sip1(7784): UAS call failed with a response status of 480.

Can you tell me what is going wrong?

Also, I tried your OpenCnam script. I inserted it right below my white pages script. I put a # in front of my white pages script. After adding your script, I couldn't receive any calls.

Do I need to make edits to my dialplan somewhere else in order to use your OpenCnam? I'm not very technical, so please use layman terms.

Thanks!

I went back in and changed my dialplan to the Simple_Dialplan and only made the necessary 4 edits. There must have been an error in my old dialplan. Now I can call out using SS. Every incoming call still has the number 206.682.0185. I used to have a name table, but that doesn't work anymore either. If I could get OpenCnam to work and or get my name table working again, that would be great.
Title: Re: Google Call Back Clarification
Post by: azrobert on March 01, 2014, 08:39:57 PM
I copied the code I supplied and put it at the beginning of the inbound portion of my dialplan.
It works.

Below is code closer to my real dialplan. It includes code for a table lookup. The OpenCnam code is a sub-routine. The dialplan has a Begin statement which requires an additional End statement. I remove a lot of code, so I hope I didn't make any mistakes.

If you can't get it working, post your code and I'll see if I can spot the problem.

#Ruby # DialPlan1

TNAME = {
 '4808370001' => 'Home',
 '4808370002' => 'Work',
 '4808370003' => 'Wife',
 '4808370004' => 'Mother',
 '4808370005' => 'Father',
 '4808370006' => 'Girl Friend'  }

def getcname cid
  @OpenCName ||= sys.WebGet("https://api.opencnam.com/v2/phone/#{cid}?format=text",4)
  sys.log("CallerName: #{@OpenCName}")
  prs = @OpenCName.split(' ')
  State = prs[-1]
  if City = prs[-2]
     @cname = "#{City} #{State}"
   else
     @cname = "#{@OpenCName}"
   end
  @cname = @cname.tr(',',' ')
  sys.log("CName: #{@cname}")
  return @cname
end

begin

if sys.In

  CID = req.Header.From.FromURI.User
  CID = "#{$1}" if CID =~ /^1(\d{10})$/                         #   Remove leading "1"

  sys.log("CallerID:   #{CID}")

  if !(@cname = TNAME[CID]) && CID =~ /^([2-9]\d\d[2-9]\d{6})$/
     @cname = getcname CID
   end

  sys.log("CallerName: #{@cname}")
  sys.Dial("user1@local[fu=#{CID},fd=#{@cname}]",30)

else                                                                #   OUT DIALPLAN STARTS

 end
end



Edit:

I re-read your last post and you are always getting number 206.682.0185. 206 is a Washington state number, so you are using IPKall for your callback number. I know in the past IPKall had problems delivering CID on some of their numbers. Maybe this is your problem and not your dialplan. You can get another IPKall number or an IPComms number. If you get another IPKall number choose a different exchange.

To test OpenCnam put the following statement after I strip the country code to set a dummy CID:

CID = "4808370001"
or
cid = "4808370001"

I used lower case cid in my first example and upper case CID in the second. It makes a difference.
Title: Re: Google Call Back Clarification
Post by: azrobert on March 02, 2014, 09:58:50 AM
I see a fair number of people are reading this thread.
I thought some might want an explanation of the following code:
 
if !(@cname = TNAME[CID]) && CID =~ /^([2-9]\d\d[2-9]\d{6})$/
     @cname = getcname CID
   end

TNAME[CID]          Does a table lookup on CID

@cname = TNAME[CID]
                   The result is placed in @cname
                   If no match the result is null

!(@cname = TNAME[CID])
                   ! is NOT, so this is checking for a null result

&&                  is AND

CID =~ /^([2-9]\d\d[2-9]\d{6})$/
                   Checking CID for proper format

If                  if no result from table lookup and
                   CID is proper format
                   The next command is executed

getcname CID
                   Sub-routine getcname is called
                   CID is passed to the sub-routine

@cname = getcname CID
                   The result from the sub-routine is place in @cname
Title: Re: Google Call Back Clarification
Post by: tyeske on March 02, 2014, 02:14:44 PM
I have tried to put your code into my dial plan, but I must not be putting it in the correct place. Here is my working dial plan. I can dial out and I can receive calls. I'd really like to get the TNAME and OpenCnam working.

Currently with this dial plan, I get the correct incoming phone number sometimes, but other times I get the 206.682.0185 Washington number. I checked and Ipkall doesn't currently have any numbers available. Do you think I should switch to the Ipcomms number?

Thanks for all your help!

# Copyright(c) 2010 Mike Telis

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

# Click "View raw file" in the lower right for the best copy/paste view

AREA_CODE = '763'                  # my area code
GV_USER   = 'XXXXX@gmail.com'     # my GV e-mail address (user@gmail.com)
GV_PASS   = 'XXXXXXX'             # my GV password
CB_NUMBER = '14250000000'          # my 11-digit SIP number (only one) Ipkall

SPEED_DIAL = {         # my speed dial numbers

'411' => '8003733411', # Free411
'266' => '4153767253@podlinez.com',     # CNN Headlines
}


begin
   sys.Log "** Call from #{req.Header.From} to #{req.URI.User} **"

  if sys.Out    # if outbound call
   num = req.URI.User.to_s        # Get a string copy of the number to dial

   num = SPEED_DIAL[num] || num   # Substitute with speed dial entry, if any

   case num
     when /@/ then sys.Dial num   # URI dialing
     when /^[2-9]\d{6}$/          # Local call, 7-digit number
       num = '1'+ AREA_CODE + num # prefix it with country and area code
     when /^[01]?([2-9]\d{9})/    # US number with or without country code
       num = '1' + $1             # add country code and truncate number to 10-digit
     when /^(011|00|\+)(\d{9,})/  # international number
       num = '+' + $2             # GoogleVoiceCall works with '+' prefix only


     else sys.Respond 603, 'Wrong number, check & dial again'
   end

   sys.Log "Calling #{num} via Google Voice"
   sys.GoogleVoiceCall GV_USER, GV_PASS, CB_NUMBER, num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30

else          # sys.Out
   sys.Dial "#{sys.Username}@local"
end

rescue
sys.Log("** Error: " + $!) unless $!.to_s =~ /Thread was being aborted./
end

Title: Re: Google Call Back Clarification
Post by: azrobert on March 02, 2014, 03:11:34 PM
I have an IPkall and an IPComms DID. I'm happy with both. If you are having CID problems with IPKall and IPComms is the only free DID available, then go for it.

Try this
AREA_CODE = '763'                  # my area code
GV_USER   = 'XXXXX@gmail.com'     # my GV e-mail address (user@gmail.com)
GV_PASS   = 'XXXXXXX'             # my GV password
CB_NUMBER = '14250000000'          # my 11-digit SIP number (only one) Ipkall

SPEED_DIAL = {         # my speed dial numbers

'411' => '8003733411', # Free411
'266' => '4153767253@podlinez.com',     # CNN Headlines
}

TNAME = {
 '2066820185' => 'IPKall',
 '4808370002' => 'Work',
 '4808370003' => 'Wife',
 '4808370004' => 'Mother',
 '4808370005' => 'Father',
 '4808370006' => 'Girl Friend'  }

def getcname cid
  @OpenCName ||= sys.WebGet("https://api.opencnam.com/v2/phone/#{cid}?format=text",4)
  @OpenCName = "#{req.Header.From.FromName}" if !@OpenCName
   if !@OpenCName
       @OpenCName = "#{CID}"
       @OpenCName.insert(6,"-")
       @OpenCName.insert(3,"-")
    end
  sys.log("CallerName: #{@OpenCName}")
  prs = @OpenCName.split(' ')
  State = prs[-1]
  if City = prs[-2]
     @cname = "#{City} #{State}"
   else
     @cname = "#{@OpenCName}"
   end
  @cname = @cname.tr(',',' ')
  sys.log("CName: #{@cname}")
  return @cname
end

begin
  sys.Log "** Call from #{req.Header.From} to #{req.URI.User} **"

 if sys.Out    # if outbound call
  num = req.URI.User.to_s        # Get a string copy of the number to dial

  num = SPEED_DIAL[num] || num   # Substitute with speed dial entry, if any

  case num
    when /@/ then sys.Dial num   # URI dialing
    when /^[2-9]\d{6}$/          # Local call, 7-digit number
      num = '1'+ AREA_CODE + num # prefix it with country and area code
    when /^[01]?([2-9]\d{9})/    # US number with or without country code
      num = '1' + $1             # add country code and truncate number to 10-digit
    when /^(011|00|\+)(\d{9,})/  # international number
      num = '+' + $2             # GoogleVoiceCall works with '+' prefix only


    else sys.Respond 603, 'Wrong number, check & dial again'
  end

  sys.Log "Calling #{num} via Google Voice"
  sys.GoogleVoiceCall GV_USER, GV_PASS, CB_NUMBER, num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30

else          # sys.Out

  CID = req.Header.From.FromURI.User
  CID = "#{$1}" if CID =~ /^1(\d{10})$/                         #   Remove leading "1"

#  CID = "xxxxxxxxxx"
  sys.log("CallerID:   #{CID}")

  if !(@cname = TNAME[CID]) && CID =~ /^([2-9]\d\d[2-9]\d{6})$/
     @cname = getcname CID
   end

  sys.log("CallerName: #{@cname}")

  sys.Dial("#{sys.Username}@local[fu=#{CID},fd=#{@cname}]",60)

end

rescue
sys.Log("** Error: " + $!) unless $!.to_s =~ /Thread was being aborted./
end
Title: Re: Google Call Back Clarification
Post by: tyeske on March 02, 2014, 05:04:04 PM
I tried your script and edited my info. I can make outgoing calls, but can't receive and incoming calls. I call from my cell phone and it rings 5 times and goes to VM. Here is the output from the SS console. Can you fix the script?

Monitor 00:58:23:655: basetype=console, ipaddress=*, user=XXXXX, event=*, request=*, serveripaddress=*, server=*, regex=.*.
DialPlan 00:58:40:029 sip1(3216): Using dialplan Working Simple Dial Plan 3-1-14 for In call to sip:XXXXX@sipsorcery.com.
NewCall 00:58:40:045 sip1(3216): Executing script dial plan for call to XXXXX.
DialPlan 00:58:40:092 sip1(3216): ** Call from "unknown" <sip:2066820185@66.54.140.46>;tag=as0a23d929 to XXXXX **
DialPlan 00:58:40:108 sip1(3216): CallerID:   2066820185
DialPlan 00:58:40:108 sip1(3216): WebGet attempting to read from https://api.opencnam.com/v2/phone/2066820185?format=text.
DialPlan 00:58:41:623 sip1(3216): Error in WebGet for https://api.opencnam.com/v2/phone/2066820185?format=text.
DialPlan 00:58:41:639 sip1(3216): CallerName:
DialPlan 00:58:41:639 sip1(3216): ** Error: undefined method `split' for nil:NilClass
DialPlan 00:58:41:639 sip1(3216): Dialplan cleanup for XXXXX.
DialPlan 00:58:41:904 sip1(3216): Dial plan execution completed without answering and with no last failure status.
DialPlan 00:58:41:904 sip1(3216): UAS call failed with a response status of 480.
Registrar 00:59:17:295 sip1(5520): Binding update request for XXXXX@sipsorcery.com from udp:97.116.165.126:5061, expiry requested 120s granted 120s.
RegisterSuccess 00:59:17:310 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.
Title: Re: Google Call Back Clarification
Post by: azrobert on March 02, 2014, 06:22:18 PM
This is a strange one.
It looks like opencnam fails when it tries to process CID 2066820185.
Because of this failure variable @OpenCName was set to null.
Then the Split command failed because of the null value.

I put CID 2066820185 in table TNAME, bypassing opencnam.

I set variable @OpenCName to "Unknown" before the WebGet.
This will prevent the Split command from failing if opencnam can't process another CID.
Find comment #  CID = "xxxxxxxxxx"
To test opencname un-comment it and change the x's to a real number.

Edit:
I also changed the WeGet from:
@OpenCName ||= sys.WebGet("https://api.opencnam.com/v2/phone/#{cid}?format=text",4)

To:
@OpenCName = sys.WebGet("https://api.opencnam.com/v2/phone/#{cid}?format=text",4)

The former will only work if @OpenCName is null.
Title: Re: Google Call Back Clarification
Post by: azrobert on March 02, 2014, 07:00:44 PM
Check the WebGet I made another change.
Title: Re: Google Call Back Clarification
Post by: tyeske on March 02, 2014, 07:27:19 PM
We're making some progress. I used your updated dial plan. Now I can make and receive calls. The incoming calls are still unknown unless I put them in TNAME. If I uncomment the CID = , I get whatever number I put in the "XXXXXXX". If that happens to be in TNAME, I get the name too.

I then tried your updated Webget and it broke again. I could no longer receive calls.

Still getting the 206 number though. It seems that Ipkall doesn't always send the correct number. It seems to be very intermittent. Does that make sense?
Title: Re: Google Call Back Clarification
Post by: azrobert on March 02, 2014, 07:45:51 PM
Which version of WebGet works and
which version doesn't?
Title: Re: Google Call Back Clarification
Post by: tyeske on March 02, 2014, 07:57:26 PM
This one works. I saved it from your code before you changed it. It at least allows me to receive calls. The other one won't allow me to receive calls.

@OpenCName =~ sys.WebGet("https://api.opencnam.com/v2/phone/#{cid}?format=text",4)
Title: Re: Google Call Back Clarification
Post by: azrobert on March 02, 2014, 08:19:26 PM
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.
Title: Re: Google Call Back Clarification
Post by: azrobert on March 02, 2014, 08:22:03 PM
Made another mistake.
I moved the syslog after the "Unknown"
Title: Re: Google Call Back Clarification
Post by: tyeske on March 03, 2014, 02:32:27 PM
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.
Title: Re: Google Call Back Clarification
Post by: azrobert on March 03, 2014, 08:48:23 PM
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.

Title: Re: Google Call Back Clarification
Post by: lhm. on March 04, 2014, 11:23:29 AM
And whitepages cnam is not as good as CallCentric, at least for me. YMMV
Title: Re: Google Call Back Clarification
Post by: Koby on March 04, 2014, 01:38:53 PM
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) (http://tech.iprock.com/?p=9784)" 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 (http://www.raspberry-asterisk.org/)", "Asterisk for BeagleBone Black (http://www.beaglebone-asterisk.org/)"), 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.
Title: Re: Google Call Back Clarification
Post by: tyeske on March 04, 2014, 05:06:17 PM
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.
Title: Re: Google Call Back Clarification
Post by: 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?
Title: Re: Google Call Back Clarification
Post by: azrobert on September 10, 2015, 09:46:21 AM
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
Title: Re: Google Call Back Clarification
Post by: SteveInWA on September 10, 2015, 03:06:08 PM
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.