Total Noob question: Forward all calls to a sip account

_! matches s, t, e, h, etc. It’s not a pattern you want to use. Normally you want at least “_X.”

Yes actually I think I can narrow it down to “username2”, right?

Ok here’s what happening. SIP phone initiates call to username2@sip.voipdiscount.com.
Asterisk gets the request, and uses its GSM phone (1) to call GSM phone (2).

GSMphone2 rings.
Sometimes SIPPhone shows “unreachable” and hangs up but GSMphone2 keeps ringing.
Sometimes after GSMphone2 answers the call, it gets a second call from GSMphone1.
Sometimes the call is established but no voice is transfered either way.

EDIT: The other way, GSMphone2 ->…->SIPPhone also works, but no voice either way. It rings/answers very reliably though.

Configs at the moment:
sip.conf:

[code][general]
port = 13000
bindaddr = 0.0.0.0
context = others
externip=...
fromdomain=*(dynamic dns address)
localnet=192.168.1.0/255.255.255.0

; Register account at voipdiscount:
register => username2:****@sip.voipdiscount.com/username2

[voipdiscount]
type=peer
context=from-voip-provider
username=username2
fromuser=username2
secret=****
host=sip.voipdiscount.com
qualify=yes
allowguest=no
;nat=yes
insecure=invite
;bindport=13000
fromdomain=stun.voipdiscount.com
[/code]
tried commenting/uncommenting fromdomain, insecure, nat but no change…

extensions:

[code][others]

[from-trollphone]
exten => s,1,Dial(SIP/username1@voipdiscount,30,rm)
exten => s,2,Hangup

[from-voip-provider]
exten => username2,1,Dial(Mobile/Trollphone/*********)
exten => username2,n,Hangup[/code]

EDIT: In Asterisk’s debugging info I keep seeing packets with this:
Contact: sip:username1@1.1.1.1:5060
where 1.1.1.1 is my public IP. This is plain wrong! 5060 is not accessible! It should be 13000. Maybe that’s a clue…

[quote]udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)[/quote]

[quote]; a. “externip = hostname[:port]” specifies a static address[:port] to
; be used in SIP and SDP messages.
; The hostname is looked up only once, when [re]loading sip.conf .
; If a port number is not present, use the “bindport” value (which is
; not guaranteed to work correctly, because a NAT box might remap the
; port number as well as the address).
; This approach can be useful if you have a NAT device where you can
; configure the mapping statically. Examples:
;
; externip = 12.34.56.78 ; use this address.
; externip = 12.34.56.78:9900 ; use this address and port.
; externip = mynat.my.org:12600 ; Public address of my nat box.
;
; b. “externhost = hostname[:port]” is similar to “externip” except[/quote]

bindport is not documented but is probably an alternative to using :port in the bind address.

ty but these don’t help either…
Now I can see in the debug info myIP:49158 and myIP:13000 and the SIPPhone reports “unreachable”…
Switching back to my previous (kinda working - no voice) settings results in even less functionality; SIPPhone gets “BUSY” signal.

WTF? this is a mess :frowning: :frowning: :frowning:

I think my setup is overcomplicated and this causes problems.

Could you please advise me as if we were in square one?
Forget voipdiscount etc. I have a SIPPhone, an asterisk server with GSMphone1 and GSMphone2 somewhere else. My use case is one and only: SIPphone needs to call GSMphone2.

How would I do that ideally? Have SIPPhone register directly to asterisk?
(The asterisk->GSMphone2 part is configured)

So here’s my new, simplified config. No voipdiscount is used. Layout:

SIP Phone <-----Internet-----> asterisk <------bluetooth--------> GSMphone1 <-----GSM-----> GSMphone2

sip.conf:

[code][general]
context=others
allowguest=no
allowoverlap=no
bindport=13000
bindaddr=0.0.0.0
srvlookup=no
disallow=all
allow=ulaw
alwaysauthreject=yes
canreinvite=no
nat=yes
session-timers=refuse
localnet=192.168.1.0/255.255.255.0
externip=1.1.1.1
fromdomain=my.dyndns.com

[test_***]
type=friend
host=dynamic
remotesecret=

context=SIPPhone-in
[/code]

extensions:

[code][others]
exten => _.,1,Hangup

[SIPPhone-in]
exten => 2600,1,Dial(Mobile/Trollphone/********)
same => n,Hangup()

[from-trollphone]
exten => s,1,Dial(SIP/test_******,60)
exten => s,2,Hangup
[/code]
Since it’s so easy, I included the GSM-> SIPPhone configuration and tried how it works.
Connection is established every time, and sip side can hear perfectly. GSM side has lots of noise, can hear some things through it. Sometimes there is no noise but huge delay as if packets go to the moon and back… SIP side can hear crystal clear with minimal delay all the time.

Edit: just tried SIPphone->GSM. Same result. Call established but GSM side has tons of noise and can hardly hear SIPPhone