asterisk2billing.org
http://forum.asterisk2billing.org/

ip authentication user
http://forum.asterisk2billing.org/viewtopic.php?f=14&t=3684
Page 1 of 2

Author:  s0lid [ Thu May 15, 2008 8:29 am ]
Post subject:  ip authentication user

Hi,

i'm not sure if this is the right category or it should be on miscellaneous anyway i need to know how can i create sip account with ip authentication only? im using a2billing as a billing system only for my wholesale voip provider because they can't provide me instant billing access and reseller login pages. so i also need to make the sip accounts reinvitable so the voice packets will be from my provider connected directly to my client.

Author:  stavros [ Thu May 15, 2008 12:59 pm ]
Post subject: 

Yes, you can authenticate users by IP address. Search the forum and I'm sure you'll find a solution.

Author:  gonzogg [ Tue May 20, 2008 9:38 pm ]
Post subject: 

s0lid,

Did you found any solution. I am searching myself, but I haven't been lucky

Author:  asiby [ Tue May 20, 2008 10:54 pm ]
Post subject: 

Here is what you have to do. First of all, DO NOT create a sip friend manually. It is buggy.

For IP authentication, follow these steps and you will be fine:

Step 1: Edit the SIP friend that you want to use IP authentication with

Step 2: Set the `Type` field to `peer` without the quotes. This is very important as to my knowledge, setting it to friend or user will never work.

Step 3: Set the username field to nothing. Delete its content.

Step 4: Set the secret field to nothing. Delete its content

Step 5: Set the host field to the domain name or the IP address of the client

Step 6: Give a minimal peer setting context to the clients. And start testing. Here is an example assuming that the customer account number is 1234567.

[1234567]
type=peer
accountcode=1234567
host=your.server.ip.address

I believe that you can also simply use 'type' and 'host' on the client side and the other value will default to the sip friend settings. The client can specify a list of codec or other preference and in some cases, asterisk will prioritize the clients settings (e.g. sendrpid, trustrpid, allow, disallow, ...)

Let us know if it works.

Cheers

Author:  gonzogg [ Fri May 23, 2008 5:31 pm ]
Post subject: 

asiby

For some reason is not working for me.

SIP friend settings:


[6503788319]
type=peer
username=
accountcode=6503788319
regexten=6503788319
callerid=973988794778207
amaflags=billing
secret=
nat=yes
dtmfmode=RFC2833
qualify=yes
canreinvite=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
host=192.168.0.105
insecure=port,invite
context=a2billing
regseconds=0
cancallforward=yes


When I try to call from the SIP phone I get a recording saying "The number you have dial is not in service, Please check the number and dial again" If I register the IP phone by user and password then calls go thru with no problems.

This is asterisk log output:


-- Executing [7862536589@from-sip-external:1] NoOp("SIP/192.168.0.20-09e9e5d8", "Received incoming SIP connection from unknown peer to 7862536589") in new stack
-- Executing [7862536589@from-sip-external:2] Set("SIP/192.168.0.20-09e9e5d8", "DID=7862536589") in new stack
-- Executing [7862536589@from-sip-external:3] Goto("SIP/192.168.0.20-09e9e5d8", "s|1") in new stack
-- Goto (from-sip-external,s,1)
-- Executing [s@from-sip-external:1] GotoIf("SIP/192.168.0.20-09e9e5d8", "0?from-trunk|7862536589|1") in new stack
-- Executing [s@from-sip-external:2] Set("SIP/192.168.0.20-09e9e5d8", "TIMEOUT(absolute)=15") in new stack
-- Channel will hangup at 2008-05-23 17:30:58 UTC.
-- Executing [s@from-sip-external:3] Answer("SIP/192.168.0.20-09e9e5d8", "") in new stack
-- Executing [s@from-sip-external:4] Wait("SIP/192.168.0.20-09e9e5d8", "2") in new stack
-- Executing [s@from-sip-external:5] Playback("SIP/192.168.0.20-09e9e5d8", "ss-noservice") in new stack
-- <SIP/192.168.0.20-09e9e5d8> Playing 'ss-noservice' (language 'en')
-- Executing [s@from-sip-external:6] PlayTones("SIP/192.168.0.20-09e9e5d8", "congestion") in new stack
-- Executing [s@from-sip-external:7] Congestion("SIP/192.168.0.20-09e9e5d8", "5") in new stack
== Spawn extension (from-sip-external, s, 7) exited non-zero on 'SIP/192.168.0.20-09e9e5d8'
-- Executing [h@from-sip-external:1] NoOp("SIP/192.168.0.20-09e9e5d8", "Hangup") in new stack
-- Executing [h@from-sip-external:2] Set("SIP/192.168.0.20-09e9e5d8", "DID=s") in new stack
-- Executing [h@from-sip-external:3] Goto("SIP/192.168.0.20-09e9e5d8", "s|1") in new stack
-- Goto (from-sip-external,s,1)
-- Executing [s@from-sip-external:1] GotoIf("SIP/192.168.0.20-09e9e5d8", "0?from-trunk|s|1") in new stack
-- Executing [s@from-sip-external:2] Set("SIP/192.168.0.20-09e9e5d8", "TIMEOUT(absolute)=15") in new stack
-- Channel will hangup at 2008-05-23 17:31:07 UTC.
-- Executing [s@from-sip-external:3] Answer("SIP/192.168.0.20-09e9e5d8", "") in new stack
== Spawn extension (from-sip-external, s, 3) exited non-zero on 'SIP/192.168.0.20-09e9e5d8'

Author:  asiby [ Fri May 23, 2008 5:45 pm ]
Post subject: 

I am not sure why you have a username and a secret field. These field should not be simply empty in the peer setting. It should not be present at all.

The following variables should be deleted from the peer entry.

username=
secret=

Try manually modifying the additional_a2billing_sip.conf and reloading the server and test again. Of course, this is only a temporary solution cause if you generate the sip friends, the error will come back.

You can also double check to see if there isn't a white space left in these fields.

Cheers

Author:  gonzogg [ Fri May 23, 2008 5:55 pm ]
Post subject: 

Thanks asiby; I tried deleting those variables, but getting same results

Author:  asiby [ Fri May 23, 2008 6:27 pm ]
Post subject: 

I am looking at your CLI log, and it does not seem to be relevant to this situation.

Can you also show the context that you are using as trunk setting on the client side?

Author:  stavros [ Fri May 23, 2008 6:28 pm ]
Post subject: 

This is a long shot, but it's not the 'qualify = yes' interfering is it?

Author:  gonzogg [ Fri May 23, 2008 6:40 pm ]
Post subject: 

I tried qulify=no and also deleting this row, but no change.
Quote:

Quote:
Can you also show the context that you are using as trunk setting on the client side?


asiby, what context are you refering to? I am making test calls from an IP phone and from a softphone; The only trunk setup is a ZAP trunk

Author:  asiby [ Fri May 23, 2008 6:54 pm ]
Post subject: 

There is your problem. A SIP phone is not a peer from asterisk point of view. It is natively a client. Thus, is will always be seen and a User or a friend (friend = user +peer). So even as a friend, it will really only use the user part of the friend.

You can only do IP authentication with a real peer. That can be another asterisk box, callweaver, openser, ... but not an end user SIP phone.

I should rather say that "I do not know how to do that, and I have never been able to do it"

Cheers

Author:  gonzogg [ Fri May 23, 2008 7:14 pm ]
Post subject: 

This is a very good point; I will built another asterisk server and try again, or ask somebody to test with me.

Thank you very much for your help

Author:  asiby [ Fri May 23, 2008 7:36 pm ]
Post subject: 

You are very welcome.

Good luck.

Author:  gonzogg [ Sat May 24, 2008 4:39 pm ]
Post subject: 

I got it working with IP phones.

I create a SIP Trunk on trixbox and put the settings of the SIP friend on the trunk (Probably this was required, but oh well I am learning). Now ip authentication work. The curious thing is that the settings at additional_a2billing.conf gets ignore; I can even delete the sip friend from here and it will work.

Author:  gineta [ Sun Aug 10, 2008 12:29 am ]
Post subject: 

HI

I try this is post here but i get

Aug 10 02:26:58 WARNING[2967]: chan_sip.c:1229 retrans_pkt: Maximum retries exceeded on
transmission [email protected] for seqno 101 (Critical Response)

any idea???

Page 1 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/