No ringtone on outbound call with softphone

Hi,

When I try to make an outbound call with a softphone (csipsimple on android or linphone on a computer) through asterisk to my SIP provider, the call is issued (the called phone rings and the communication is established when answered), but I don’t get any ringtone on the softphone. The ‘r’ option of the dial application does provide a ringtone, but I find it somehow artificial as it just rings whatever happens: I’d like to hear the ringtone from my SIP provider.

Note that if I register the softphone directly to my SIP provider, I do hear the ringtone.

Asterisk is on a public IP, the softphones are behind a NAT. As my SIP provider is in Switzerland, I set country=ch in indications.conf

The call logs do indicate that the progress of the call is passed to the softphone:
##############################################
== Using SIP RTP CoS mark 5
– Executing [+XXXXX@LocalSets:1] Progress(“SIP/lenovo-00000013”, “”) in new stack
– Executing [+XXXXX@LocalSets:2] Dial(“SIP/lenovo-00000013”, “SIP/sip_proxy-out/00XXXXX”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/sip_proxy-out/00XXXXX
– SIP/sip_proxy-out-00000014 is making progress passing it to SIP/lenovo-00000013
– SIP/sip_proxy-out-00000014 answered SIP/lenovo-00000013
– Remotely bridging SIP/lenovo-00000013 and SIP/sip_proxy-out-00000014
== Spawn extension (LocalSets, +XXXXX, 2) exited non-zero on ‘SIP/lenovo-00000013’
###############################################

My config files:
################# sip.conf ###############################
[general]
context=unauthenticated
allowguest=yes
srvlookup=yes
udpbindaddr=0.0.0.0
tcpenable=no
useragent=mydomain
register => user:pwd@sip.youroute.net/julien
preferred_codec_only=yes
disallow=all
allow=alaw
allow=ulaw
allow=speex
jbenable=yes

[sip_proxy]
type=peer
host=sip.youroute.net
context=from-switzernet

[sip_proxy-out]
type = peer
host = sip.youroute.net
defaultuser = user
qualify=no
fromuser=user
remotesecret = pwd
transport=udp
callbackextension=julien

soft-phone
type=friend
context=LocalSets
host=dynamic
secret=pwd
dtmfmode=rfc2833
vmexten=voicemail
mailbox=julien

htc-magic

lenovo
#######################################################################

########################## extensions.conf ###############################
[from-switzernet]
exten => s,1,Goto(LocalSets,julien,1)

[LocalSets]
exten => julien,1,Dial(SIP/htc-magic&SIP/lenovo,25)
same => n,VoiceMail(julien)
same => n,Hangup()

exten => lenovo,1,Dial(SIP/lenovo,25)
same => n,VoiceMail(julien)
same => n,Hangup()

exten => htc-magic,1,Dial(SIP/htc-magic,25)
same => n,VoiceMail(julien)
same => n,Hangup()

exten => _+.,1,Dial(SIP/sip_proxy-out/00${EXTEN:1})

exten => _00Z.,1,Dial(SIP/sip_proxy-out/${EXTEN})

exten => _0Z.,1,Dial(SIP/sip_proxy-out/0041${EXTEN:1})

exten => i,1,Playback(pbx-invalid)
same => n,Hangup()

exten => 3,1,VoicemailMain(julien)

exten => voicemail,1,Set(vmail=${SIPPEER(${CHANNEL(peername)},mailbox)})
same => n, GotoIf(MailboxExists(${vmail})?gotovoicemail:)
same => n, Playback(pbx-invalid)
same => n, Hangup()
same => n(gotovoicemail),VoicemailMain(${vmail},s)

[unauthenticated]
exten => julien,1,Goto(LocalSets,julien,1)

exten => htc-magic,1,Goto(LocalSets,htc-magic,1)

exten => lenovo,1,Goto(LocalSets,lenovo,1)

exten => i,1,Playback(pbx-invalid)
same => n,Hangup()
##############################################################################

Your trace doesn’t match your dialplan!

Trace shows a (necessary) call to Progress which is not in the dialplan shown.

You say the phones are inside the NAT boundary, but there are no specific provisions in the configuration for this, so the answer is likely to depend on how the router is configured. Possibly the router doesn’t understand how to handle early media?

Incidentally, your SIP provider shouldn’t be providing ringback. They should be passing back early media derived from the PSTN, if they’ve are receiving in band progress from there, or should be sending 180 Ringing, to try to cause the phone to generate the tone.

This trace was done with these config files on an asterisk server 1.8

I’m obviously pretty new to this, and although I did read thoroughly the doc and the sample sip.conf, I have some trouble figuring out which of the numerous options apply to my case. Could you tell me which specific provision should I then use to handle the fact that my phones are behind a nat? Note that I use a stun server.

The trace was clearly not done with the provided configuration files.

The only option that might, be relevant on Asterisk, is nat=. The need for this will be dictated by the phone an router. The important requirements are that the phone and router be configured correctly. If the phone supports it, the simplest configuration is to configure the router to forward all SIP and RTP used by the phone, untranslated, to the phone and configure the phone to output its public address.

If the router is configured to do port mapping, it may well not be turning that on until the call is fully up.

Again, that trace was done with the provided config files: exactly why would I give wrong informations in order to solve my problem? Maybe you don’t know asterisk as well as you would like to think… Honnestly, your contribution doesn’t help, so please refrain from posting if you don’t have anything constructive to add.

Trace:

[quote]-- Executing [+XXXXX@LocalSets:1] Progress(“SIP/lenovo-00000013”, “”) in new stack
– Executing [+XXXXX@LocalSets:2] Dial(“SIP/lenovo-00000013”, “SIP/sip_proxy-out/00XXXXX”) in new stack[/quote]

Configuration:

Why has the trace listed the Dial as step 2 and invented a Progress call, as step 1, that appears nowhere in the configuration, if the trace was produced from the configuration?