PSip - Puppy SIP

Browsers, email, chat, etc.
Message
Author
User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#226 Post by smokey01 »

Try Skype

mama21mama

#227 Post by mama21mama »

fix

Code: Select all

psip32: ../src/pjsua-lib/pjsua_pres.c:557: pjsua_buddy_update_pres: La declaración `pjsua_buddy_is_valid(buddy_id)' no se cumple.
Abortado
PSIP v1.3

raname ~/.psip.conf ~/psip.conf

work :shock:

edit: work

before

Code: Select all

{
			"category":	"puppy",
			"buddies":	[{
					"nick":	"nilsonmorales",
					"address":	"nilsonmorales@iptel.org"
				}]
now

Code: Select all

{
			"category":	"puppy",
			"buddies":	[{
					"nick":	"nilsonmorales",
					"address":	"sip:nilsonmorales@iptel.org"
				}]

chapchap70
Posts: 210
Joined: Thu 18 Nov 2010, 05:39
Location: The Island Of Long (NY, USA)

3 little letters

#228 Post by chapchap70 »

Yep those 3 little letters make a bit of difference.

Another note: I had to redo my sip:iptel.org account that I registered on July 6th. I tried to see if this was working and found iptel had no record of my account. I have made videocalls with it using linphone in early September. I still have the email from my account setup so I know I was putting in the right username and password. I reregistered with the same handle and password.

I never made a call with PSIP but I got it to show that I was Logged In.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#229 Post by smokey01 »

Yes, you must always precede your address with sip: just like it's explained in the help document.

http://www.smokey01.com/help/psip/psip-help.html

Cheers

zandarian
Posts: 117
Joined: Wed 14 Oct 2009, 21:10

#230 Post by zandarian »

Newer thread about this: http://www.murga-linux.com/puppy/viewtopic.php?t=70867

NB: With some routers Puppy Phone (and Ekiga) seems not to be usable, at least without doing special things. (http://www.murga-linux.com/puppy/viewto ... 418#796418)

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#231 Post by smokey01 »

I don't believe you need to do any port forwarding in your router to make psip work however, if your router has ALG, try disabling it.

Also, psip like most voip apps use port 5060 so make sure the port is open if using a firewall.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#232 Post by technosaurus »

I wanted to post this google voice perl script somewhere before it gets lost in the interwebs. ... I don't know why all of them are in perl or php

Code: Select all

#!/usr/bin/perl -w


###########################################################################
##                 Google Voice Command Line Script
##
##  This script will let you utilize features of your google voice 
##  account from the command line, or triggered by some external 
##  application.  
##
##  You can send a sms, place a call or cancel a call placed
##
##  Copyright Bret McDanel 2009
##
##  LICENSE:
##  1. You may not make this GPL ever.  I want my code to be freely 
##     available to everyone forever.  The GPL restricts freedom.
##  2. Copyright notices must remain intact and distributed with
##     the program.  This includes the contributors list.
##  3. No warantee is present, whether express or implied.  Use at
##     your own risk.
##  4. This license must be included with all distributions of this
##     program and no modifications to this license are allowed.
##     This implicitly makes this program GPL incompatible but
##     compatible with virtually every other OSI approved license.
##  5. You are otherwise free to distribute this program, modify it
##     and distribute those modified works.
##
## Contributors:
##     Bret McDanel trixter AT 0xdecafbad.com
##     Pablo <undisclosed>
##     Peter pietia7 AT tlen.pl
##     Jeffrey Honig jch AT honig.net
##
###########################################################################


use strict;
use WWW::Mechanize;
use WWW::Mechanize::Plugin::FollowMetaRedirect;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use HTTP::Cookies;
use URI::Escape;
use HTML::Entities;
use JSON -support_by_pp;
use Getopt::Std;

## EDIT ME!!!
## You have two options, you only need to do one and not both
# OPTION 1
# If Net::Netrc is installed, you may use a ~/.netrc file
# add the following line to your ~/.netrc file, make sure its mode 600
# machine voice.google.com login EMAIL password PASSWORD account 1234567890
# replace EMAIL with your email address, PASSWORD with your pass 
# and 1234567890 with the default "ring to" number
#
# OPTION 2
# Edit the variables below to have your information
my $username = undef; # dont forget to escape @ symbols
my $password = undef;
my $default_number = undef;





## nothing under here *should* need to be edited
my $cookiejar;
my $rnr_se = undef;


sub getContact {
    my ($contact_name, $contact_type) = @_;
    my $ret=undef;
    $contact_type = "MOBILE" if ! defined $contact_type;
    $cookiejar = HTTP::Cookies->new();
    
    $rnr_se = auth($cookiejar);
    
    if (!defined $rnr_se) {
	return;
    } else {
	my ($url, $client, $request, $response, $postdata);
	my $browser = WWW::Mechanize->new();
	$browser->cookie_jar($cookiejar);
	eval{
	    $browser->get( 'https://www.google.com/voice/c/ui/ContactManager');
	    my $content = $browser->content();
	    
	    $content =~ /initContactData = (.*?)\}\;/;
	    my $json_content = $1."}";
	    my $json = new JSON;
	    
	    my $json_text = $json->allow_nonref->utf8->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($json_content);
	    
	    foreach my $episode(@{$json_text->{Body}{Contacts}}){
		if(lc($episode->{Name}) eq lc($contact_name)) {
		    foreach my $types($episode->{Phones}) {
			foreach my $type(@$types) {
			    if(lc($type->{Type}->{'Id'}) eq lc($contact_type)) {
				$ret = $type->{Number};
				return;
			    }
			}
		    }
		}
	    }
	};
	# catch crashes:
	if($@){
	    print "[[JSON ERROR]] JSON parser crashed! $@\n";
	}
    }
    return $ret;
}



sub usage {
    my $progname = $0;
    print "$progname -c <command>  [-p phone] [-t type] [-f from] [args]\n";
    print "Commands:\n";
    print "\tsms -p <phonenumber|name> <message>\n";
    print "\tcall -p <phonenumber|name>\n";
    print "\tcancel\n";
    print "-t is only used if you specify a contact name for -p and not a number\n";
}




sub auth {
    my $url = "https://www.google.com/accounts/ServiceLogin?passive=true&service=grandcentral&ltmpl=bluebar&continue=https%3A%2F%2Fwww.google.com%2Fvoice%2Faccount%2Fsignin%2F%3Fprev%3D%252F";
    my $mech = WWW::Mechanize->new();
    
    $mech->cookie_jar($cookiejar);
    $mech->agent('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11');
    $mech->get($url);
    $mech->follow_meta_redirect( ignore_wait => 1 );
    if(!$mech->success) {
	print "ERROR: unable to get login page\n";
	return undef;
    }
    
    if (! defined $mech->form_number(1)) {
	print "ERROR: unable to locate login form!\n";
	return undef;
    }
    $mech->field(Email => $username);
    $mech->field(Passwd => $password);
    my $resp = $mech->click();
    
    if(!$resp->is_success) {
	print "ERROR: unable to get login page\n";
	return undef;
    }
    
    my $output_page = $mech->content();
    if ($output_page =~ m/\<meta/) {
	$mech->follow_link(tag => 'meta');
	$output_page = $mech->content();
    }
    
    if ($output_page =~ m/The username or password you entered is incorrect/) {
	print "ERROR: Username or password is incorrect\n";
	return undef;
    }
    
    if ($output_page =~ m/rnr_se.*value=\"(.*?)\"/) {
	$rnr_se = uri_escape($1);
    } else {
	print "ERROR: Unable to get the rnr_se value\n";
	return undef;
    }
    
    
    return $rnr_se;
}



###
# Send SMS
###
sub sendsms {
    my ($number, $message) = @_;
    $cookiejar = HTTP::Cookies->new();
    
    $rnr_se = auth($cookiejar);
    
    if (!defined $rnr_se) {
	return;
    } else {
	my ($url, $client, $request, $response, $postdata);
	
	$client = LWP::UserAgent->new();
	$client->agent('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11');
	$client->timeout(30);
	$client->cookie_jar($cookiejar);
	
	$url = 'https://www.google.com/voice/sms/send/';
	$postdata = "id=&phoneNumber=".$number."&text=".uri_escape($message)."&_rnr_se=".$rnr_se;
	
	$request = HTTP::Request->new(POST => $url);
	$request->content_type('application/x-www-form-urlencoded');
	$request->content($postdata);
	$response = $client->request($request);
	
	if ($response->is_success) {
	    print "SMS sent\n";
	} else {
	    print "Could not send the SMS message ".$response->status_line."\n";
	}
    }
    return;
}


###
# Place a phone call
###
sub placecall {
    my ($dst_number, $from_number) = @_;
    $cookiejar = HTTP::Cookies->new();
    
    $rnr_se = auth($cookiejar);
    
    if (!defined $rnr_se) {
	return;
    } else {
	my ($url, $client, $request, $response, $postdata);
	
	$client = LWP::UserAgent->new();
	$client->agent('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11');
	$client->timeout(30);
	$client->cookie_jar($cookiejar);
	
	$url = 'https://www.google.com/voice/call/connect/';
	$postdata = "outgoingNumber=$dst_number&forwardingNumber=$from_number&subscriberNumber=undefined&remember=0&_rnr_se=$rnr_se";
	
	$request = HTTP::Request->new(POST => $url);
	$request->content_type('application/x-www-form-urlencoded');
	$request->content($postdata);
	$response = $client->request($request);
	
	if ($response->is_success) {
	    print "Call sent\n";
	} else {
	    print "Could not place the call ".$response->status_line."\n";
	}
    }
    return;
}


###
# Cancel a call
###
sub cancelcall {
    $cookiejar = HTTP::Cookies->new();
    
    $rnr_se = auth($cookiejar);
    
    if (!defined $rnr_se) {
	return;
    } else {
	my ($url, $client, $request, $response, $postdata);
	
	$client = LWP::UserAgent->new();
	$client->agent('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11');
	$client->timeout(30);
	$client->cookie_jar($cookiejar);
	
	$url = 'https://www.google.com/voice/call/cancel/';
	$postdata = "outgoingNumber=undefined&forwardingNumber=undefined&cancelType=C2C&_rnr_se=$rnr_se";
	
	$request = HTTP::Request->new(POST => $url);
	$request->content_type('application/x-www-form-urlencoded');
	$request->content($postdata);
	$response = $client->request($request);
	
	if ($response->is_success) {
	    print "Call cancelled\n";
	} else {
	    print "Could not cancel the call ".$response->status_line."\n";
	}
    }
    return;
}







eval "use Net::Netrc";
if (! $@) {
    my $mach = Net::Netrc->lookup('voice.google.com');
    
    if($mach) {
	($username, $password, $default_number) = $mach->lpa;
    }
    if(! defined $username || ! defined $password || ! defined $default_number) {
	print "You must either create a ~/.netrc file or define the variables in this script\n";
	exit;
    }
}

if(! defined $username || ! defined $password || ! defined $default_number) {
    print "You dont have Net::Netrc installed so you must define the variables in this script\n";
    exit;
}




if (!defined $username || !defined $password) {
    print "You need to set the username and password\n";
    exit;
}


my %opts;

getopt ('c:t:f:p:',\%opts);

usage($0) unless ($opts{c});
$opts{t}=undef unless ($opts{t});
$opts{f}=$default_number unless $opts{f};


if (!defined $opts{c}) {
    usage($0);
    exit;
} elsif ($opts{c} eq "sms") {
    if ($opts{p} !~ /^(\+|\d)\d+$/) { 
	my $num=getContact($opts{p},$opts{t});
	if(defined $num) {
	    $opts{p}=$num;
	} else {
	    print "Unable to locate contact $opts{p}\n";
	    exit;
	}
    }
    
    if ($#ARGV ge 0) {
	my $message = join(' ', @ARGV);
	sendsms($opts{p},$message);
    } else {
	usage($0);
	exit;
    }
} elsif ($opts{c} eq "call") {
    if ($opts{p} !~ /^(\+|\d)\d+$/) { 
	my $num=getContact($opts{p},$opts{t});
	if(defined $num) {
	    $opts{p}=$num;
	} else {
	    print "Unable to locate contact $opts{p}\n";
	    exit;
	}
    }
    
    if(!defined $opts{f}) {
	print "Either specify a number or edit this script to set the default\n";
	exit;
    }
    
    placecall($opts{p},$opts{f});
} elsif ($opts{c} eq "cancel") {
    cancelcall();
} else {
    usage($0);
    exit;
}
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

peterw
Posts: 430
Joined: Wed 19 Jul 2006, 12:12
Location: UK

Video conferencing

#233 Post by peterw »

Hi

I am not sure if this is the right place to post this but if anyone wants a simple facility to video call people then this is a good alternative - no sign up, etc. The first web site is the actual site to start the call and the second site is the web site describing it. I can't remember where I found it. I have tried it once and it worked well.

https://appear.in/
http://www.makeuseof.com/tag/move-googl ... ally-good/

peterw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Video conferencing

#234 Post by mcewanw »

peterw wrote:Hi

I am not sure if this is the right place to post this but if anyone wants a simple facility to video call people then this is a good alternative - no sign up, etc. The first web site is the actual site to start the call and the second site is the web site describing it. I can't remember where I found it. I have tried it once and it worked well.

https://appear.in/
http://www.makeuseof.com/tag/move-googl ... ally-good/

peterw
Not sure there is an appropriate thread as yet. appear.in uses WebRTC as does the similar app linked here:

http://www.murga-linux.com/puppy/viewto ... 282#796282

William
github mcewanw

peterw
Posts: 430
Joined: Wed 19 Jul 2006, 12:12
Location: UK

An alternative to skype and hangouts

#235 Post by peterw »

Hi

You are right, perhaps I should have posted it elsewhere or started my own topic. I was not particularly concerned about the technicalities of how it worked but the functions that it had. If someone was able, it should be possible to put a front end onto it so that when a button is pressed under internet a brief description come up stating how to use it and then giving the reference to the appear.in site. It would be a very lightweight video call system useful for Puppy. It does not need any programmes installed and can be used by any operating system, I think. It does not need people to install skype or google hangouts which is a one of its big strengths.

peterw

zandarian
Posts: 117
Joined: Wed 14 Oct 2009, 21:10

#236 Post by zandarian »

Thanks. I can connect to my VoIP account unbinding the SIP ALG and the UDP 5060 port. But I listen no sound at all. Details in http://www.murga-linux.com/puppy/viewto ... 672#797672

User avatar
Sky Aisling
Posts: 1368
Joined: Sat 27 Jun 2009, 23:02
Location: Port Townsend, WA. USA

PSip - Puppy SIP

#237 Post by Sky Aisling »

Hi Kennel Mates,

I have a nooby question about Psip. Bare with me please.
Can I call a regular land line telephone or a cell phone number using Puppy Phone?
I'm reading http://puppylinux.org/wikka/PuppySip.
Grant writes:
Functionality
Ok, let's take it for a spin, what can it do?
* Make free voice calls from PC to PC
* Make voice calls from PC to landlines or mobiles (You need an account at a SIP provider such as proxy01.sipphone.com)
* Instant messaging
* Leave and retrieve free voice mail messages (using proxy01.sipphone.com)
* Conference calls
* Listen to news and sports services
What is 'an account at a SIP provider'. What's a SIP provider?
It doesn't look like I can call a friend who has just a regular ole land line and have her phone ring and pick up a call like she normally would for any incoming call from another 'regular' phone.
Am I correct?

Thank you in advance for your kind response.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#238 Post by Sylvander »

Example:
Here's my SIP Service Provider:
http://www.iptel.org/service
At the moment I use an electronic box [Linksys Internet Phone Adapter] that connects to my router, and then I can connect any ordinary phone to the box.
This can accept or send phone calls via the internet.
I don't pay any money to the account, so it only ACCEPTS calls, and I've used it for this.
If I charge the account with funds I can make calls to landline phones and mobile phones anywhere in the world, but haven't done so yet.
Last edited by Sylvander on Sat 14 Mar 2015, 02:13, edited 1 time in total.

User avatar
Sky Aisling
Posts: 1368
Joined: Sat 27 Jun 2009, 23:02
Location: Port Townsend, WA. USA

PSip - Puppy SIP

#239 Post by Sky Aisling »

Thank you, Sylvander.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#240 Post by Sylvander »

Oops, I wonder if this is my SIP provider?
Saved both of these in my password vault and I've forgotten which I used to set up the service.
Probably this rather than the other.

Here's the tour.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#241 Post by Sylvander »

The reason I decided to use an "Internet Phone Adapter" and a standard phone [for everyday phone calls] rather than PSIP run within Puppy on a [Desktop] PC:
a. With this arrangement, there's no need to have the PC powered on and the Puppy OS booted; when a call comes in, the phone rings just ling a normal phone on a landline, and I only need lift the handset to take the calls.
There IS a necessity to have powered-on [for the period during which I'm prepared to accept calls]:
Phone, phone adapter, router, modem.
This supplements my landline telephone.

b. I can choose which regional code to use for my phone line.
This could be really useful.
e.g. I saw a guy who lived in Canada explain that he had a Glasgow->Scotland area code, so all of his relatives in Glasgow [who have no PC] could make calls to his internet phone at local Glasgow call rates.
I chose to use my local area code, but could change to using the area code of the region where most of my relatives live.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#242 Post by smokey01 »

To make voice calls to normal desk phones try psip with voipbuster.com.

Read my tutorial here towards the bottom.
http://smokey01.com/help/psip/psip-help.html
Last edited by smokey01 on Wed 06 May 2015, 10:25, edited 1 time in total.

User avatar
Sky Aisling
Posts: 1368
Joined: Sat 27 Jun 2009, 23:02
Location: Port Townsend, WA. USA

PSip - Puppy SIP

#243 Post by Sky Aisling »

Sylvander

Excellent! I'm in the process of researching it now.
Attachments
puppyphone2.png
(10.52 KiB) Downloaded 494 times

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#244 Post by smokey01 »

Over the last week I have noticed some issues with Psip not working in peer 2 peer mode. This means NOT going through a sip server, in other words from my external IP to the other persons IP.

It seems to have been caused by the stun server/s I was using. Psip was also noticeably slower to start which was also a bit unusual.

If you login via a sip server such as ideasip, iptel or voipbuster then you probably haven't noticed any issues because stun is not required.

Typically a ping to stun.iptel.org was taking about 350+ms which I don't believe is any slower than it was previously. Speed will vary because of distance from your location to the stun server. Other stun servers I have used in the past are stun.ideasip.com and stun.voipbuster.org which haven't caused problems.

Anyway long story short, I searched for a stun server that was closer to my location (South Australia). A comprehensive list of stun servers can be found here: http://emc.cc.st/public-stun.txt

Try the stun servers that have your country code in the name. I have chosen stun.alltel.com.au:3478 as it give me a ping of 35ms which of course is much better than 350ms.

Since changing stun servers everything is working fine again.

User avatar
Sky Aisling
Posts: 1368
Joined: Sat 27 Jun 2009, 23:02
Location: Port Townsend, WA. USA

PSip - Puppy SIP

#245 Post by Sky Aisling »

Anyway long story short, I searched for a stun server that was closer to my location (South Australia). A comprehensive list of stun servers can be found here: http://emc.cc.st/public-stun.txt
Thank you, smokey01

Post Reply