Author Topic: Possible to use Yate to add Caller ID name to Obihai devices/incoming GV calls?  (Read 22201 times)

Cam

  • Newbie
  • *
  • Posts: 2
    • View Profile
I should state up front that I have very little direct experience with Yate.  The extent of my experience is installing Yate in a Flash on one system (also using information found here), and it has worked so well that I've barely needed to touch it since installation, so I don't know if that counts as any significant level of experience, and that doesn't have that much to do with this.  Except, that first article mentions Bill Simon's Google Voice gateway which is using Yate.  The significance of that is that his gateway somehow adds Caller ID name information to incoming calls, which Google Voice does not provide.  But, he does not disclose how he does it, so as far as I know you can't do that with "Yate in a Flash".

What I am thinking about here, though, is the case where a user has an Obihai device (OBi100, OBi110, OBi202, etc.) that is being used to connect to one or more Google Voice accounts.  In this case the calls come in with a Caller Id number only, and no Caller ID name, because Google doesn't supply that.  There are third-party Caller ID name lookup sources out there, and at least one of them (OpenCNAM) is free for low usage (under 60 lookups per hour).

The Obihai devices will not do Caller ID name lookups on their own.  However, it is possible to "loop" incoming calls through another PBX server to add Caller ID information — see, for example, How to divert incoming Google Voice calls from an Obihai VoIP device to an Asterisk server for additional processing (such as Caller ID lookup).  The trouble with the technique shown there is that it pretty much requires a separate server running PBX in a Flash (or at least Asterisk, FreePBX, and the third-party Caller ID Superfecta module) which seems like serious overkill if all you want to do is Caller ID name lookups.  So I started wondering if you could use a similar technique and loop Obihai calls through a Yate server and do the Caller ID lookups from within that, rather than having to run a Linux server and then Asterisk/FreePBX/CallerID Superfecta on top of that.

I have only found a few pages that touch on the subject of adding Caller ID name lookups to Yate - this mailing list post (looks like this might be a slightly expanded version of the code), and this forum thread (which in turn links to this Wiki page).  I have to admit that those instructions lack sufficient information for me to really make use of them.  Suffice it to say that given my relative lack of hands-on experience with Yate, I am wondering if anyone else has ever attempted something like this, and could maybe give me a push in the right direction.

My ultimate goal would be to have a minimal Yate installation that could run on any supported platform, that could work as the "backend" for one or more Obihai devices and add available Caller ID name information before looping the call back to the originating Obihai device.  I'd primarily like to see this as a local server (maybe something that would run in the background on a filesever, or even on a standalone device such as a Raspberry Pi).  Direct connectivity to Google Voice (as is possible with Yate in a Flash) would also be nice, but optional, since the primary goal would be to add Caller ID name to Google Voice calls that come in on the Obihai device itself.

Is this a project that would be suitable for Yate?  If so, how would one set up something like that?
« Last Edit: April 26, 2013, 12:24:21 PM by Cam »

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
First you need the CNAM service provider.
1. You can use OpenCNAM, in which case you'll need the script you mentioned or write another one doing it
2. You can find a CNAM service you can query using SIP

You can handle calls on sip (from Obihai devices or any other source), make the CNAM query and return the calls back.

A minimal set of modules would be:
ysipchan.yate
regexroute.yate

If you are going to use an external script to do CNAM you'll also need
extmodule.yate

For sip CNAM you'll need:
sip_cnam_lnp.yate
cache.yate

You'll need extra modules if you want support for Google Voice

When you'll decide what to use I can assist you with the configuration.

rsriram22

  • Newbie
  • *
  • Posts: 6
    • View Profile
This is my exact requirement as well. How do I go about achieving this.. I do have Yate succesfully on a windows 7 box. All I want is to be able to do a CNAM lookup when calls come in (to obi or directly to any other SIP client).

Thanks.

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Hi, here is a configuration you need.
In regexroute and sip you should forward the SDP if are going to return the call to caller.
You might want to do it if the call is going to be sent to another destination also.
If you forward media yate won't handle it, it will be exchanged directly between call parties.

regexroute.conf:

[general]
prerouteall=yes

[contexts]
.*=;rtp_forward=yes

[default]
; Route sip call back to the source
${module}^sip$=sip/sip:${caller}@${ip_host}:${ip_port}


cache.conf:

[cnam]
enable=yes
ttl=84600


ysipchan.conf:

[general]
forward_sdp=yes

Case 1: You have a SIP CNAM service provider.
You need sip_cnam_lnp module.
It must be explicitly loaded in yate.conf:

[postload]
${modulepath}/sip/sip_cnam_lnp${modsuffix}=yes

You must configure it:
sip_cnam_lnp.conf:

[cnam]
callto=sip/sip:${caller}@SIP_CNAM_PROVIDER_IP


Case 2: Use OpenCNAM
You need an script to make HTTP requests and handle the response.
It must implement a call.preroute message handler, make the request and put the calling party name in 'callername' parameter of the message.
I don't think you can use PHP scripts: it won't work on Windows.
You may use Python.