September 19, 2020, 11:23:32 am *
Welcome, Guest. Please login or register.
News:
 
   Forum Home   Search Login Register OBiTALK  
Pages: [1]
  Print  
Author Topic: Set speed dial 99 with code *0  (Read 14859 times)
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« on: March 14, 2014, 10:46:34 pm »

I am working on my callback hack for the Obi and Google Voice.  Currently I plan to store the callback number in speed dial slot 99.  It works fine if I dial *7499 and the number.  I would like to be able to dial **0 or *0 plus the number that I want stored in speed dial 99.  For some reason I can't get that part working.  Any of our dial plan/digit map experts have any ideas on this?

You can follow what I'm doing on this thread.  I still have some work to do bur this would be a big help.
http://www.obitalk.com/forum/index.php?topic=6892.0


When I'm finished with this project I expect having a system when you:
Dial a number and hear a tone.
Hang up the phone.
Your phone rings.
Pick up the phone and you are connected to the number you dialed.
« Last Edit: March 14, 2014, 10:55:11 pm by giqcass » Logged

Long live our new ObiLords!
azrobert
Hero Member & Beta Tester
*****
Posts: 4030


« Reply #1 on: March 15, 2014, 08:54:14 am »

Set StarCode#30 to:
*0(<99>), Set Speed Dial, coll($Spd[$Code])

Dial *018005551212
Logged
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« Reply #2 on: March 15, 2014, 10:47:11 am »

Thank I think I was missing the () in my previous attempts.
Logged

Long live our new ObiLords!
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« Reply #3 on: March 19, 2014, 08:51:38 pm »

Set StarCode#30 to:
*0(<99>), Set Speed Dial, coll($Spd[$Code])

Dial *018005551212

Does anyone have any idea why this seems to cut off the first digit?
For example
Dial *018005551212 and I get 8005551212 in the speed dial.
Dial *098005551212 and I get 8005551212 in the speed dial.
Dial *00# and I get # in the speed dial.
Dial *000# and I get 0 in the speed dial.

The # key only shows up in the speed dial if it is the third key in the sequence.
Logged

Long live our new ObiLords!
azrobert
Hero Member & Beta Tester
*****
Posts: 4030


« Reply #4 on: March 19, 2014, 10:33:50 pm »

Try this:
*0(1xxxxxxxxxx|0#|00#), Set Speed Dial, set($Spd[99],$code)
Logged
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« Reply #5 on: March 19, 2014, 10:56:13 pm »

Try this:
*0(1xxxxxxxxxx|0#|00#), Set Speed Dial, set($Spd[99],$code)

I can't see the problem with the first method but this code is working reliably.

Thanks for the help!
Logged

Long live our new ObiLords!
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« Reply #6 on: March 19, 2014, 11:23:16 pm »

Try this:
*0(1xxxxxxxxxx|0#|00#), Set Speed Dial, set($Spd[99],$code)

I only used the # key to end the dialing sequence.  I won't be using *000 so I made these changes to speed up the dialing.  This works very well now.
*0(1xxxxxxxxxx|[2-9]xxxxxxxxx|0), Set Speed Dial, set($Spd[99],$code)

Until I can figure out how to autoreset I'm using *00 to set Speed dial 99 to 0 after I initiate the web callback.

I put this in the ConfigURL.  
IF ( $UDM0 >=3 ) FWU http://obicallback.mysite.com/?key=6dde9fa74f1936a&name=Jim&callback=$UDM0

$UDM0 is the contents of speed dial 99 and it is defined here.  

LOL  the picture will only show up tiny or huge!

« Last Edit: March 19, 2014, 11:27:24 pm by giqcass » Logged

Long live our new ObiLords!
azrobert
Hero Member & Beta Tester
*****
Posts: 4030


« Reply #7 on: March 20, 2014, 08:14:09 am »

Are you using the GV Widget PHP script that you were testing?

I tested this awhile ago and if I remember correctly the called person had to enter "1" to be connected to the caller. Did you find a way to eliminate this?

You can run a PHP script in Asterisk, hard code all the parms in the script and pass the outbound number to it via SIP.
Logged
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« Reply #8 on: March 20, 2014, 02:18:02 pm »

I'm still using the widget code right now.  I plan to get the other method working but right now I'm obsessed with the Obi side of the equation.  Currently I have to
1)Dial *0 and the number
2)Wait a few seconds .
3)Dial *00.
4)Hang up.
5)Pick up the call.

If I can eliminate step 3 without a reboot I would be happy with it.  The only way I have found to auto reset Speed dial 99 causes the Obi to reboot.  For the cheapo that doesn't care steps 1-3 can be saved as a contact on most phones.
Logged

Long live our new ObiLords!
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« Reply #9 on: March 20, 2014, 11:53:15 pm »

Ok I have decided to move on temporarily to getting the new php script working.  I am starting with this library.
https://github.com/aaronpk/Google-Voice-PHP-API/blob/master/GoogleVoice.php

It throws an warning and a fatal error on the web server I am testing.  It's probably the result of limitations of the web server itself. I get this warning and an error.

Code:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /public_html/GoogleVoice.php on line 27

Code:
Fatal error: Uncaught exception 'Exception' with message 'Could not log in to Google Voice with username: xxxxxxxx@xxxxxxxx.com' in /public_html/GoogleVoice.php:67 Stack trace: #0 /public_html/GoogleVoice.php(89): GoogleVoice->_logIn() #1 /public_html/simple.php(9): GoogleVoice->callNumber('4195551212', '4195555555', 'home') #2 {main} thrown in /public_html/GoogleVoice.php on line 67

I think it can be fixed with a little tinkering using something like this.
http://stackoverflow.com/questions/8078711/curlopt-followlocation-emulation
Or this
http://stackoverflow.com/questions/10138289/curl-setopt-curlopt-followlocation-issue-with-tcpdf

« Last Edit: March 20, 2014, 11:58:49 pm by giqcass » Logged

Long live our new ObiLords!
azrobert
Hero Member & Beta Tester
*****
Posts: 4030


« Reply #10 on: March 21, 2014, 09:50:20 pm »

The following works.

ITSP Provisioning:
Method: System Start
ConfigURL:
SET TPRM1 = $UDM0; @loop IF ( $TPRM1 != $UDM0 ) SYNC http://192.168.1.100:5090/gvcall.PHP?cancel=no&dialnum=$UDM0; SET TPRM1 = $UDM0; WAIT 5; GOTO loop;

Dial *01623594100
You don't have to reset Speed Dial 99.

The dialed number must be different than the last number dialed.
If you want to redial, dial the number with/without country code so it will be different than the last number dialed.
« Last Edit: March 21, 2014, 09:55:22 pm by azrobert » Logged
giqcass
Hero Member & Beta Tester
*****
Posts: 1438


« Reply #11 on: March 21, 2014, 10:21:06 pm »

A regularsmiley doesn't cover this one.   Good work!
« Last Edit: March 21, 2014, 10:47:16 pm by giqcass » Logged

Long live our new ObiLords!
azrobert
Hero Member & Beta Tester
*****
Posts: 4030


« Reply #12 on: March 22, 2014, 08:59:58 am »

I made some changes.
I didn't like *0, so I changed it to just *
I added 7 digit dialing. Change 480 in the StarCode30 to your local area code.
I added a redial feature (*00). It can only be used once after dialing a number.

StarCode30:
*(1xxxxxxxxxx|xxxxxxxxxx|<1480>xxxxxxx|00), Set Speed Dial, set($Spd[99],$code)

ITSP Provisioning:
Method: System Start
ConfigURL:
SET TPRM1 = $UDM0; @loop IF ( $UDM0 == 00 ) GOTO redial; SET TPRM2 = $UDM0; GOTO checkit; @redial SET TPRM2 = $TPRM1; @checkit IF ( $TPRM1 != $UDM0 ) SYNC http://192.168.1.100:5090/gvcall.PHP?cancel=no&dialnum=$TPRM2; SET TPRM1 = $UDM0; WAIT 5; GOTO loop;

I refined this method, but this was giqcass' idea. I would have never thought of this hack.
This is a better method than the one I was using with the Wamp Server.
Anyway, thank you giqcass.

Logged
azrobert
Hero Member & Beta Tester
*****
Posts: 4030


« Reply #13 on: March 25, 2014, 08:11:38 pm »

The GV callback can work as follows. If you have an active call on the phone the GV callback is directed to, you will hear the Call Waiting tone. If you hit Flash you will be connected to the GV callback. The phone must be on an active call for the Call Waiting to work. If the phone is just Off Hook, GV callback will get a Busy and fail.

Using another service I set it up to automatically go into session with another call after it initiated the GV callback. After hearing the Call Waiting tone from the GV callback, I hit Flash to connect to GV. No need to hang up.

I had a couple challenges to overcome to incorporate the above scenario with giqcass' technique, but I think I have it working consistently. It doesn't work quite as seamlessly as above.

Auto Provisioning gets suspended when you are on an active call. The phone must be On Hook or Off Hook with Dial tone for Auto Provisioning to work. I had to devise a method to automatically update SpeedDial99, get Dial Tone (so auto Provisioning can initiate the callback) and then go into session with another call (so Call Waiting will work).

Here is my solution:

StarCode30:
*(1xxxxxxxxxx|xxxxxxxxxx|<1480>xxxxxxx|00S0), Set Speed Dial, set($Spd[99],$code)

ITSP Provisioning:
Method: System Start
ConfigURL:
SET TPRM1 = $UDM0; @loop IF ( $UDM0 == 00 ) GOTO redial; SET TPRM2 = $UDM0; GOTO checkit; @redial SET TPRM2 = $TPRM1; @checkit IF ( $TPRM1 != $UDM0 ) SYNC http://192.168.1.100:5090/gvcall.PHP?cancel=no&dialnum=$TPRM2; SET TPRM1 = $UDM0; WAIT 2; GOTO loop;

Add to Phone Port DigitMap:
*{t=od}|

Add to Phone Port OutboundCallRoute:
{*:pp(222222222)},

Star Code 30 is unchanged.

In ConfigURL I changed the WAIT from 5 seconds to 2 to correct a timing issue. 5 seconds worked sometimes. 2 seconds works consistently. I did not try any other wait interval.

When you dial * you will get a second Dial tone, then go into session with the OBi Echo test.

Dialing *8005551212* will update the Star Code. The extra * will be sent to the DigitMap and OutboundCallRoute putting you into session with Obi Echo Test. When you hear the Call Waiting Tone, press Flash. You must get an exact match with the Star Code DigitMaP on the dialed number for this to work, so it doesn't work with 7 digit numbers. I wasn't getting an exact match with *00, so I changed the DigitMap to |00S0.

You could dial *.... and pause until you hear the Star Code update tone, then dial *
Doing it this way everything works.

Dialing the old way without the extra * and hanging up will also work.

Here is some info about what happens when you hit flash. The call you were connected to is put on hold. When you hang up on the GV call, the call stays on hold. It has to hang up by itself or you have to go back to it and then hang up to terminate it. The OBi Echo test will end by itself in approx 1 minute. The problem with the music sites is they never end. I use an app I wrote that answers the call, waits 30 seconds and hangs up.

This is probably another one of my stupid ideas. I just wanted to see if I could get this to work.

« Last Edit: March 27, 2014, 09:10:37 am by azrobert » Logged
ipse
Full Member
***
Posts: 105



« Reply #14 on: April 02, 2014, 01:45:08 pm »

I am in awe reading this...you guys are so inventive and I bet this has to do with the challenge now in front of Obi users rather than getting free calls...let the community know how this progresses.
Logged

Of all the things I lost, I miss my mind the most. - Mark Twain
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Advertisement
Advertisement