No sounds in asterisk when call to voicemail - asterisk

I just started to play around with asterisk. Currently it is installed on CentOS 7 and version of Asterisk is 13.
This is what I get when I call directly to voicemail from Zoiper
-- Executing [8500#demo:2] VoiceMailMain("SIP/2001-00000028", "#demo") in new stack
-- <SIP/2001-00000028> Playing 'vm-login.gsm' (language 'en')
-- <SIP/2001-00000028> Playing 'vm-password.gsm' (language 'en')
-- Incorrect password '' for user '2001' (context = demo)
-- <SIP/2001-00000028> Playing 'vm-incorrect-mailbox.gsm' (language 'en')
....
This is what I have in extension.conf
exten => 8500,1,Answer
exten => 8500,2,VoiceMailMain()
exten => 8500,3,Hangup()
This is in voicemail.conf
[demo]
2001 => Demo Test, demo#127.0.0.1
and this is the user in sip.conf
[general]
port = 5060
bindaddr = xxx.xxx.xxx.xxx
allow=all
context = bogon-calls ; Send SIP callers that we don't know about here
[2001]
type=friend ; This device takes and makes calls
username=demo_test ; Username on device
secret=1234 ; Password for device
host=dynamic ; This host is not on the same IP addr every time
context=demo ; Inbound calls from this host go here
mailbox=100
In /var/lib/asterisk/sounds/en are all the .gsm files..

Check firewall rtp ports(see rtp.conf for port list)

Related

Asterisk Playback with no answer on dahdi channel?

Here is my sample dialplan
exten => _X.,1,Progress()
exten => _X.,n,Playback(welcome,noanswer)
exten => _X.,n,Hangup()
When I tried to call through dhadi channel. I am getting the below logs in asterisk console.
-- Accepting call from '9042394773' to '33468550' on channel 0/8, span 1
-- Executing [33468550#test:1] Progress("DAHDI/i1/9042394773-8", "") in new stack
-- Executing [33468550#test:2] Playback("DAHDI/i1/9042394773-8", "welcome,noanswer") in new stack
-- <DAHDI/i1/9042394773-8> Playing 'welcome.slin' (language 'en')
-- Executing [33468550#test:3] Hangup("DAHDI/i1/9042394773-8", "") in new stack
-- Hungup 'DAHDI/i1/9042394773-8'
But the welcome voice is not audio able.. How do I play weclome voice before atten the call??? Whether I have to change any configuration in asterisk????
Am using asterisk 13.5.
I found this example where a Wait(1) is used between Progress and Playback.
Maybe you can give it a try.
exten => 500,1,Progress()
exten => 500,n,Wait(1)
exten => 500,n,Playback(WeAreClosedGoAway,noanswer)
exten => 500,n,Hangup()

Asterisk, blacklisted number won't hang up

I have implemented a simple blacklist for my incoming calls. The problem I am having is that my phone is no longer ringing when a blacklister calls(this part is good), but the blacklisted phone doesn't hang up (this is the problem).
Incoming context in extensions.conf:
exten => 12225551234,1,Zapateller(nocallerid)
same => n,GotoIf(${BLACKLIST()}?hangup)
same => n,Dial(SIP/myphone)
same => n(hangup),Hangup()
Add a number to blacklist:
CLI> database put blacklist +14445554321 "Blacklisted for testing"
Call 12225551234 from blacklisted 14445554321...
As seen via CLI interface:
== Using SIP RTP CoS mark 5
-- Executing [12225551234#from-sipProvider:1] GotoIf("SIP/sipProvider_did9-00000738", "1?hangup") in new stack
-- Goto (from-sipProvider,12225551234,5)
-- Executing [12225551234#from-sipProvider:5] Hangup("SIP/sipProvider_did9-00000738", "") in new stack
== Spawn extension (from-sipProvider, 12225551234, 5) exited non-zero on 'SIP/sipProvider_did9-00000738'
== Using SIP RTP CoS mark 5
-- Executing [12225551234#from-sipProvider:1] GotoIf("SIP/sipProvider_did10-00000739", "1?hangup") in new stack
-- Goto (from-sipProvider,12225551234,5)
-- Executing [12225551234#from-sipProvider:5] Hangup("SIP/sipProvider_did10-00000739", "") in new stack
== Spawn extension (from-sipProvider, 12225551234, 5) exited non-zero on 'SIP/sipProvider_did10-00000739'
== Using SIP RTP CoS mark 5
-- Executing [12225551234#from-sipProvider:1] GotoIf("SIP/sipProvider_did9-0000073a", "1?hangup") in new stack
-- Goto (from-sipProvider,12225551234,5)
-- Executing [12225551234#from-sipProvider:5] Hangup("SIP/sipProvider_did9-0000073a", "") in new stack
== Spawn extension (from-sipProvider, 12225551234, 5) exited non-zero on 'SIP/sipProvider_did9-0000073a'
This continues until the blocked caller hangs up. Eventually, after about 50 seconds, if the caller hasn't hung up he hears ringing. I need to hang up his phone or I will be charged if he leaves the phone off the hook.
Try answering the call before hanging up. This is what I use:
exten => 12225551234,1,Zapateller(nocallerid)
same => n,GotoIf(${BLACKLIST()}?badlist,s,1)
same => n,Dial(SIP/myphone)
same => n,Hangup()
[badlist]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(ss-noservice)
exten => s,n,Hangup

chan_sip.c:21050 handle_response_invite: " Failed to authenticate on INVITE to " in asterisk

this problem came up when i tried forwarding calls..
-- Executing [1001#users:1] Macro("SIP/to_freepbx-0000003a", "stduser,1001,tT") in new stack
-- Executing [s#macro-stduser:1] GotoIf("SIP/to_freepbx-0000003a", "1?FORWARD") in new stack
-- Goto (macro-stduser,s,4)
-- Executing [s#macro-stduser:4] Answer("SIP/to_freepbx-0000003a", "") in new stack
-- Executing [s#macro-stduser:5] Goto("SIP/to_freepbx-0000003a", "users,1002,1") in new stack
-- Goto (users,1002,1)
== Channel 'SIP/to_freepbx-0000003a' jumping out of macro 'stduser'
-- Executing [1002#users:1] Macro("SIP/to_freepbx-0000003a", "stduser,1002,tT") in new stack
-- Executing [s#macro-stduser:1] GotoIf("SIP/to_freepbx-0000003a", "1?FORWARD") in new stack
-- Goto (macro-stduser,s,4)
-- Executing [s#macro-stduser:4] Answer("SIP/to_freepbx-0000003a", "") in new stack
-- Executing [s#macro-stduser:5] Goto("SIP/to_freepbx-0000003a", "users,2004,1") in new stack
-- Goto (users,2004,1)
== Channel 'SIP/to_freepbx-0000003a' jumping out of macro 'stduser'
-- Executing [2004#users:1] Dial("SIP/to_freepbx-0000003a", "SIP/2004#to_freepbx") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/2004#to_freepbx
[Sep 8 12:24:54] NOTICE[17431]: chan_sip.c:21050 handle_response_invite: Failed to authenticate on INVITE to '"LEO" ;tag=as6388ac84'
-- SIP/to_freepbx-0000003b is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
-- Auto fallthrough, channel 'SIP/to_freepbx-0000003a' status is 'CONGESTION'
there seem to be no problem in the flow as seen on the logs except for the notification " chan_sip.c:21050 handle_response_invite: " Failed to authenticate on INVITE to "
i have two pbx servers.. one is gui-less asterisk while the other one is freepbx.. i created a sip trunk for them to connect..here it is
[general]
context=users
realm=training.com
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all
allow=ulaw
allow=gsm
language=en
trustrpid=yes
sendrpid=yes
[examconfig](!)
type=friend
host=dynamic
secret=1qaz1qaz
qualify=yes
callgroup=1
pickupgroup=1
context=users
canreinvite=no
[1001](examconfig)
mailbox=1001#default
callerid="Michael Jordan" <1001>
setvar=USERID=1001
[1002](examconfig)
mailbox=1002#default
callerid="Kobe Brian" <1002>
setvar=USERID=1002
[to_freepbx]
type=friend
host=192.168.1.250
insecure=port,invite
qualify=yes
context=users
disallow=all
allow=ulaw
allow=gsm
canreinvite=no
nat=no
dtmfmode=inband
here is a part my extensions.conf
enter code here
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
extenpatternmatchnew=no
[globals]
[users]
exten => _1XXX,1,Macro(stduser,${EXTEN},tT)
exten => _2XXX,1,Dial(SIP/${EXTEN}#to_freepbx)
exten => _NXXXXXX,1,Dial(SIP/${EXTEN}#to_freepbx)
exten => _09X.,1,Dial(SIP/${EXTEN}#to_freepbx)
exten => 5002,1,GotoIftime(8:30-18:30,mon-fri,*,*?menu,s,1:menu_night,s,1)
include => features
[macro-stduser]
exten => s,1,GotoIf($["${DB(users/${ARG1}/FWD/Status)}" = "1"]?FORWARD)
exten => s,n,Dial(SIP/${ARG1},20)
exten => s,n,GotoIf($[“${DIALSTATUS}” = “NOANSWER”]?TIMEOUT)
exten => s,n(FORWARD),Answer()
exten => s,n,Goto(users,${DB(users/${ARG1}/FWD/Number)},1)
exten => s,n(TIMEOUT),Answer()
exten => s,n,Wait(1)
exten => s,n,Voicemail(${MACRO_EXTEN}#default,u)
exten => s,n,Hangup()
exten => h,1,NoOp(Shucks,hung up!)
when i enabled forwarding and tried calling from my local devices in asterisk, forwading is succesful
but when i try to call from freepbx to my asterisk local extension, it would go to congestion.. how do i troubleshoot this one
This may happen if a calling sip user exists on both servers.

Catch hangup while Asterisk AMD is checking

Im having this problem just when i answer the phone and then hangup, but asterisk does not detect the hangup while AMD is detecting ?
Asterisk 11.11
-- Executing [09XXXXXXXX#appel-sortant:10] NoOp("Local/09XXXXXXXX#appel-sortant-40f9;2", "Next = 0") in new stack
-- Executing [09XXXXXXXX#appel-sortant:11] Set("Local/09XXXXXXXX#appel-sortant-40f9;2", "GLOBAL(NEXT)=0") in new stack
== Setting global variable 'NEXT' to '0'
-- Executing [09XXXXXXXX#appel-sortant:12] Dial("Local/09XXXXXXXX#appel-sortant-40f9;2", "SIP/09XXXXXXXX#forfait-ovh,20,gtr") in new stack
== Using SIP RTP CoS mark 5
-- Called 09XXXXXXXX#forfait-ovh
-- SIP/forfait-ovh-00000000 is ringing
-- SIP/forfait-ovh-00000000 is making progress passing it to Local/09XXXXXXXX#appel-sortant-40f9;2
-- SIP/forfait-ovh-00000000 answered Local/09XXXXXXXX#appel-sortant-40f9;2
> Channel Local/09XXXXXXXX#appel-sortant-40f9;1 was answered.
-- Executing [s#appel-sortant:1] Playback("Local/09XXXXXXXX#appel-sortant-40f9;1", "silence/1") in new stack
-- <Local/09XXXXXXXX#appel-sortant-40f9;1> Playing 'silence/1.gsm' (language 'en')
== Spawn extension (appel-sortant, 09XXXXXXXX, 12) exited non-zero on 'Local/09XXXXXXXX#appel-sortant-40f9;2'
-- Executing [s#appel-sortant:2] AMD("SIP/forfait-ovh-00000000", "") in new stack
-- AMD: SIP/forfait-ovh-00000000 09XXXXXXXX (null) (Fmt: 64)
-- AMD: initialSilence [2500] greeting [1500] afterGreetingSilence [800] totalAnalysisTime [5000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [3] silenceThreshold [256] maximumWordLength [5000]
-- AMD: Channel [SIP/forfait-ovh-00000000]. Changed state to STATE_IN_SILENCE
-- AMD: Channel [SIP/forfait-ovh-00000000]. HANGUP
[Aug 31 09:19:35] NOTICE[32712]: pbx_spool.c:349 attempt_thread: Call completed to Local/09XXXXXXXX#appel-sortant
extensions.conf
exten => s,1,Playback(silence/1)
exten => s,n,AMD()
exten => s,n,NoOp(AMDSTATUS = ${AMDSTATUS})
exten => s,n,GotoIf($[${AMDSTATUS}=MACHINE]?appel-sortant-mach,s,1:appel-sortant-humn,s,1)
I resolved the problem implementing the hangup handler.
Hangup Handlers
Asterisk DO detect hangup on called party ALWAYS.
There are no way prevent that.
Check your provider/FXO gate, probably it just not detect hangup.

Call not placed on Asterisk using OpenBTS

Could someone point me to a location where I can get the correct configuration for a test setup that can hold 1 or 2 mobile phones.
I have setup an OpenBTS 2.8 with Asterisk 1.8.4 on Ubuntu with an N210 and SBX daughterboard. I am able to dial 600 and establish a connection with the BTS and the echotest runs perfectly. I assigned the two terminals connected to the BTS with the following configurations and when I try to call each other I get the error posted below
The debug output says it placed a call and I dont get any ring on the other phone and I cant lift the call. It times out as expected.
This is my extensions.conf
[macro-dialGSM]
exten => s,1,Dial(SIP/${ARG1},20)
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-CANCEL,1,Hangup
exten => s-NOANSWER,1,Hangup
exten => s-BUSY,1,Busy(30)
exten => s-CONGESTION,1,Congestion(30)
exten => s-CHANUNAVAIL,1,playback(ss-noservice)
exten => s-CANCEL,1,Hangup
[sip-external]
exten => 9000,1,Macro(dialGSM,IMSI240020702009669)
exten => 9001,1,Macro(dialGSM,IMSI240016010357097)
This is my sip.conf
[IMSI240020702009669]
callerid=9000
canreinvite=no
type=friend
allow=gsm
context=sip-external
host=dynamic
dtmfmode=info
[IMSI240016010357097]
callerid=9001
canreinvite=no
type=friend
allow=gsm
context=sip-external
host=dynamic
dtmfmode=info
This is the error output from asterisk
-- Executing [s#macro-dialGSM:1] Dial("SIP/IMSI240016010357097-0000001f","SIP/IMSI240020702009669,20") in new stack
== Using SIP RTP CoS mark 5
-- Called IMSI240020702009669
-- Nobody picked up in 20000 ms
-- Executing [s#macro-dialGSM:2] Goto("SIP/IMSI240016010357097-0000001f", "s-NOANSWER,1") in new stack
-- Goto (macro-dialGSM,s-NOANSWER,1)
-- Executing [s-NOANSWER#macro-dialGSM:1] Hangup("SIP/IMSI240016010357097-0000001f", "") in new stack
== Spawn extension (macro-dialGSM, s-NOANSWER, 1) exited non-zero on'SIP/IMSI240016010357097-0000001f' in macro 'dialGSM'
== Spawn extension (sip-external, 9000, 1) exited non-zero on'SIP/IMSI240016010357097-0000001f'
[Sep 18 18:01:31] WARNING[9737]: chan_sip.c:3551 retrans_pkt: Retransmission timeout reached on transmission 3c5b249c2220ff282dddf34d75e0848a#192.168.10.1:5060 for seqno 102(Critical Request) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 32000ms with no response
Where do you think I am making a mistake? I referred the wiki but it doesn't help or I cannot understand how to solve from the wiki the error message points.
I figured out the problem the macro had to be fed the ip to route the traffic on
Macro(dialGSM,IMSI240020702009669#127.0.0.1:5062)
hope this helps someone
Indeed, providing the ip address/port to the Dial function solved my problem.
It was very frustrating until I stumbled upon this solution.
Below is the running code
sip.conf :
[IMSI3102XXXXXXXXXX3]
callerid=2000003
canreinvite=no
type=friend
allow=gsm
context=sip-external
host=dynamic
dtmfmode=info
[IMSI3102XXXXXXXXXX4]
callerid=2000004
canreinvite=no
type=friend
allow=gsm
context=sip-external
host=dynamic
dtmfmode=info
extentions.conf :
[macro-dialGSM]
exten => s,1,Dial(SIP/${ARG1},20)
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-CANCEL,1,Hangup
exten => s-NOANSWER,1,Hangup
exten => s-BUSY,1,Busy(30)
exten => s-CONGESTION,1,Congestion(30)
exten => s-CHANUNAVAIL,1,playback(ss-noservice)
exten => s-CANCEL,1,Hangup
[sip-external]
exten => 2000003,1,Macro(dialGSM,IMSI3102XXXXXXXXXX3#127.0.0.1:5062)
exten => 2000004,1,Macro(dialGSM,IMSI3102XXXXXXXXXX4#127.0.0.1:5062)

Resources