OBiTALK Community

General Support => Installation and Set-Up (Devices) => Topic started by: DocM on February 27, 2012, 10:47:57 AM

Title: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on February 27, 2012, 10:47:57 AM
Hi all,
Im a relative newb when it comes to Asterisk and OBI110 but I have so far setup an Incredible 3.0 PIAF (PBX in a Flash) box with an OBI110 acting as an extension (ph), GV trunk (SP1), and PSTN trunk (SP2). I used Ad_Hominem's post (http://www.obitalk.com/forum/index.php?topic=57.0) and Michigan Telephone's blog to build the system. So far it works perfectly.

My PSTN line has the tandem transfer function (meaning I can transfer the current individual on the current line to another number and hangup, emptying my current line).

I want my PIAF box to perform a tandem transfer when an individual that calls the box and chooses a certain option on the IVR. There already is a Flash function available on asterisk but, after hours of research, I discovered to my dismay that it only applies to zap configurations.

Now my question is how would I get the PIAF box to perform the Flash option. My current ideas include figuring out if asterisk has some hidden hook flash setting somewhere that I can activate on command or send some sort of pre-configured extension code down the trunk. On the other end, the obi110 needs to recognize the flash sent by asterisk or the extension code and perform the flash on the PSTN line.

Now, I think if the PIAF box dials an extension code, the individual on the PSTN line will hear extension being dialed, which I don't want. Also, I don't know if it may open up a security hole where a random individual can call the PIAF box and then be able to call out to any number they wish using our service and CID (but I highly doubt that it would be possible since the Flash should only let me dial another number).

Finally, my last newb question that I can't figure out is how to generate a debug log (or syslog) through OBI110.

Any help is appreciated.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: QBZappy on February 27, 2012, 11:54:44 AM
GWCS,

Lifted from another site, referring to another ATA type. Reply my be relevant to your situation.

http://forums.grandstream.com/forums/index.php?topic=8110.0

Please set DTMF mode on this extension to Dtmf=2833  (on your server)
And set the 503 to send DTMF via RTP (RFC2833)

When the 503 receives this RTP packet (Event 16) it will perform a flash on the line.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on February 27, 2012, 03:44:25 PM
In OBI110 > ITSP Profile B > General:
DTMFMethod=RFC2833

In Asterisk > Trunk:
username=OBITRUNK2
type=friend
md5secret=blah
disallow=all
allow=ulaw
qualify=yes
defaultip=192.168.1.10
host=dynamic
dtmfmode=rfc2833
canreinvite=no
deny=0.0.0.0/0.0.0.0
permit=192.168.1.10/192.168.1.10

In Asterisk > IVR:
Extension 3 > Custom Destinations > TandemTransfer

In Asterisk > Custom Destinations > TandemTransfer:
Custom Destination: custom-tandem-transfer,3213214321,1

In Asterisk > extensions_custom.conf:
[custom-tandem-transfer]
exten => _X.,1,Playback(followme/pls-hold-while-try)
exten => _X.,n,senddtmf(D)
exten => _X.,n,senddtmf(${EXTEN})
exten => _X.,n,Hangup()

Thats what I have done so far and it still isn't working. I tried replacing D with F (as I found in one post) but that failed as well. What am I doing wrong?
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: QBZappy on February 27, 2012, 04:54:01 PM
If I remember correctly RFC2833 (R)=Flash hook
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: QBZappy on February 27, 2012, 05:36:21 PM
I'm thinking that *98 is blind transfer. Can you use this approach? This should create a hook flash.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on February 28, 2012, 05:26:27 PM
Sry for the delay. For some odd reason, my OBI110 is no longer acting like an extension. I'm in the process of repairing it. Could you tell me how to read the syslog?

Also, for clarification, to test out R and *98, I would replace the ENTERINFO in the context found below, correct?

[custom-tandem-transfer]
exten => _X.,1,Playback(followme/pls-hold-while-try)
exten => _X.,n,senddtmf(ENTERINFO)
exten => _X.,n,senddtmf(${EXTEN})
exten => _X.,n,Hangup()


Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: QBZappy on February 28, 2012, 05:59:22 PM
DocM,

Quote from: DocM on February 27, 2012, 10:47:57 AM

On the other end, the obi110 needs to recognize the flash sent by asterisk or the extension code and perform the flash on the PSTN line.

Finally, my last newb question that I can't figure out is how to generate a debug log (or syslog) through OBI110.



1) Replace the "ENTERINFO" with "R". See what gives. I'm not certain it will work as I don't have an Asterisk to test it on.

2) *98 was an idea of incorporating it into the dial plan.

3) Syslog found here:
System Management->Device Admin->Syslog->

Congifure these settings.
Server,Port, Level

I'm assumeing you have a syslog server available. If not OBihai has a DOS based one somewhere on their web site, which is pretty good. It can be used to output a txt file on your hard disk. A little tricky to use since it is not GUI based. Otherwise Google for one. There are several free ones out there.

4) I was reading there is also the possibility of sending hook flash in Asterisk using another method which involves setting up the tones in the exten. I don't remember which site I saw it on. For such questions a web site dedicated to Asterisk is problably the best place to ask. Although I' sure there are some Asterisk experts who frequent this forum.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 02, 2012, 01:47:03 PM
1) R didn't work. It simply exits as soon as it hits the senddtmf(R) line.

2) Will attempt this route but currently unsure how to implement and whether other user will hear dtmf tones

3) Heads up to anyone who wants to utilize syslog: http://www.obitalk.com/forum/index.php?topic=707.0

4) I didn't understand whether the hook flash was to be performed by asterisk or obi110. If it can be performed by both, I'll also inquire from the asterisk forum about my situation.

While I was further experimenting with the obi110 and asterisk setup, I realized that I can't make calls from my obi110 phone line extension. I want my calls to go to the asterisk server and then be routed to whatever location I want. In asterisk, I have extension 703 setup for obi110. I can send calls to obi110 and answer them using my phone port. However, when I call out from obi110 via the phone port, it states the number I have dialed is not in service.

Looking at asterisk's log, obi110 doesn't seem to be telling asterisk what extension it is.
--- SIP read from UDP:192.168.0.10:5061 --->
INVITE sip:13213214321@192.168.0.12:5060 SIP/2.0
Call-ID: d66935c1@192.168.0.10
Content-Length: 312
CSeq: 8002 INVITE
From: <sip:OBITRUNK1@192.168.0.12>;tag=SP231de4161132a0aa5
Max-Forwards: 70
To: <sip:13213214321@192.168.0.12>
Via: SIP/2.0/UDP 192.168.0.10:5061;branch=z9hG4bK-65f3ebcf;rport
Authorization: DIGEST algorithm=MD5,nonce="08712552",realm="asterisk",response="9b2d40930fc95b3d239abc360b8b3772",uri="sip:13213214321@192.168.0.12:5060",username="OBITRUNK1"
User-Agent: OBIHAI/OBi110-1.3.0.2675
Contact: <sip:OBITRUNK1@192.168.0.10:5061>
Expires: 60
Supported: replaces
Allow: ACK,BYE,CANCEL,INFO,INVITE,NOTIFY,OPTIONS,REFER
Remote-Party-ID: <sip:OBITRUNK1@192.168.0.12>;party=calling;privacy=off
Content-Type: application/sdp

v=0
o=- 536806 1 IN IP4 192.168.0.10
s=-
c=IN IP4 192.168.0.10
t=0 0
m=audio 16820 RTP/AVP 0 8 18 104 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:104 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=ptime:20
a=xg726bitorder:big-endian
<------------->

Currently, the only change I made in Physical Interface>PHONE Port is setting PrimarilyLine:SP2 Service. My SP2 Service acts like the trunk for Google Voice and Line. I think I need to alter OutboundCallRoute to state that extension 703 is sending invite to asterisk server, not OBITRUNK1. However, I have no idea what I should change it to.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 02, 2012, 02:35:00 PM
It seems that by altering the OutboundCallRoute, I can make it go, pretty much, where ever I want in my PBX (i.e. to other extensions, IVR). However, I don't know how to make it follow the Outbound Route on the PBX.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: QBZappy on March 02, 2012, 03:27:40 PM
DocM,

Several OBi installation instructions with Asterisk can be found on this forum. This first link by Ad_Hominem is quite detailed.

http://www.obitalk.com/forum/index.php?topic=1157.msg7261#msg7261

http://www.obitalk.com/forum/index.php?topic=140.msg461#msg461

http://michigantelephone.wordpress.com/2011/02/06/how-to-use-the-obihai-obi100-or-obi110-voip-device-as-a-gateway-between-asteriskfreepbx-and-google-voice-andor-the-obitalk-network/

http://www.obitalk.com/forum/index.php?topic=68.msg125#msg125

http://www.obitalk.com/forum/index.php?topic=57.msg3964#msg3964
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 02, 2012, 10:18:01 PM
Lol, I had already read every article you posted. However, I did figure out what was wrong with my setup. It seems my context line in my trunk disappeared  :-\ . I'm sooo happy that it works again, for now...  ::) Now back to figuring hook flash.

Thanks a lot QBZappy for all your help.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 05, 2012, 11:33:31 AM
Link on asterisk concerning flash question: http://forums.asterisk.org/viewtopic.php?f=13&t=81908

Im also researching if a flash command can be sent via rtp to obi110.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: QBZappy on March 05, 2012, 01:40:05 PM
DocM

The admin guide says that that star codes only work using while using the phone. It seems that *98 might not be possible after all. However it seems that the admin guide is out of date, as other users are finding abilities which where not previously not enabled (see CID spoofing over sip). It would be timely if OBihai could confirm if this is possible with the current firmware, as some of the features are currently not documented.

http://www.obihai.com/OBiAdminGuide.htm#_Toc304466468

Star Code Profile Features of the OBi Device:

At present the OBi device allows user to issue star code from the PHONE port only.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 05, 2012, 03:54:30 PM
Its unusual that there are two Star Code Profiles when there is only one port that utilizes them. I automatically assumed that both SPx were using them (not the Phone port). QBZappy, thank you for correcting my oversight. You saved me several hours of testing.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: QBZappy on March 05, 2012, 04:50:47 PM
I used to have my Grandstream PBX peering with an Asterisk PBX. I was able to perform all sorts of call operations in this peered mode with the proper configuration. If the units are peered instead of the OBi being setup as a Trunk, I'm thinking perhaps the OBi will not need to receive a hook flash, since at this point I think you can set up the OBi inbound call route to recognize the Asterisk and then send it to the Auto Attendant in order to select option 1 or 2 (Ring the Phone port or make another call).

Are you trying to setup the OBi as a DISA line, or wanting the phone attached to the OBi to ring?
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 05, 2012, 05:33:33 PM
My goal:
All Incoming calls via PSTN > Line Port > SP2 > Asterisk > IVR > Caller chooses option x >
>> If my current obi110 phone ext not busy, call directed to Phone Port
>> If my current obi110 phone ext busy, call flashed and redirect to a gv mail where all calls are only collected
All Outgoing calls calls via Phone > Phone Port > SP2 > SP1 (Google Voice) > destination

Due to circumstances where both lines could be used simultaneously, I wanted to utilize the call transfer option.
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 06, 2012, 04:09:45 PM
Can the OBi110 accept hook flash event 16 sent via sp2 to the line port?
Title: Re: PIAF - Asterisk, Google Voice, and a PSTN line - Tandem transfer function
Post by: DocM on March 09, 2012, 10:03:33 AM
It seems Ad_Hominem asked my question on the freepbx forum but got no reply :(
http://www.freepbx.org/forum/freepbx/users/can-anyone-tell-me-how-to-send-a-flash-hook-to-a-pstn-gateway