Call not placed on Asterisk using OpenBTS - asterisk

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)

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 AMD doesn't start on outbound call

Please can you tell me where I am wrong, I am new on Asterisk.
I am trying to detect voicemail on outgoing call (remote provider)
exten => _011225XXXXXXXX,1,Dial(SIP/${EXTEN}#dinstar)
exten => _011225XXXXXXXX,n,AMD()
exten => _011225XXXXXXXX,n,GotoIf($["${AMDSTATUS}" = "HUMAN"]? human:machine)
exten => _011225XXXXXXXX,n(machine),WaitForSilence(2000)
exten => _011225XXXXXXXX,n,Playback(asterisk-friend)
exten => _011225XXXXXXXX,n,Hangup()
exten => _011225XXXXXXXX,n(human),Verbose(3, We've got a human on the line!)
exten => _011225XXXXXXXX,n,Playback(transfer)
exten => _011225XXXXXXXX,n,Dial(SIP/${EXTEN}#dinstar)
exten => _011225XXXXXXXX,n,Playback(im-sorry)
exten => _011225XXXXXXXX,n,Hangup()
Cli print
CLI> == Using SIP RTP CoS mark 5
-- Executing [01122548484444#LocalSets:1] Dial("SIP/mor-00000002", "SIP/01122548484444#dinstar") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/01122548484444#dinstar
-- SIP/dinstar-00000003 is making progress passing it to SIP/mor-00000002
-- SIP/dinstar-00000003 answered SIP/mor-00000002
-- Remotely bridging SIP/mor-00000002 and SIP/dinstar-00000003
== Spawn extension (LocalSets, 01122548484444, 1) exited non-zero on 'SIP/mor-00000002'
Asterisk AMD in this example will start like you asked - after dial command compleated.
If you want use AMD for provisioning dial answer you should use it in on-answer macro(M param in dial command).
If you want use AMD to detect what happens and route calls, you should implement AMD on other end of call/add that to your dialling core. For examples see vicidial.org or other dialler.

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.

Asterisk & freePBX

I m beginner for asterisk, so I cannot transfer call from main line to asterisk line, can anyone help me??
I have Asterisk card which have 4 port, 2 for FXO and 2 for FXS and I attached 2 land-line on FXS port and plugged PSTN line in FXO port, I generated DAHDI extension for those two land-line one was 101 and second one is 102, I check both can call each-other successfully, using soft-phone also can call on 101 and 102 but problem is there when someone call on land-line they cannot ring and cannot attend the call, so please some give me dial plane.
I also configure
extension.conf
[incoming]
exten => s,1,Answer( )
exten => s,2,Background(enter-ext-of-person)
exten => 101,1,Dial(Dahdi/1,10)
exten => 101,2,Playback(vm-nobodyavail)
exten => 101,3,Hangup( )
exten => 101,102,Playback(tt-allbusy)
exten => 101,103,Hangup( )
exten => 102,1,Dial(SIP/Jane,10)
exten => 102,2,Playback(vm-nobodyavail)
exten => 102,3,Hangup( )
exten => 102,102,Playback(tt-allbusy)
exten => 102,103,Hangup( )
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup( )
[internal]
exten => 101,1,Dial(Dahdi/1,,r)
exten => tejas,1,Dial(Dahdi/1,,r)
exten => 102,1,Dial(Dahdi/chirag,,r)
exten => chirag,1,Dial(Dahdi/chirag,,r)
but still unsuccess....
so please help me....
for your more information I will paste some other .conf file
/etc/dahdi/system.conf
fxsks=1,2
fxoks=3,4
loadzone=in
defaultzone=in
As show in above file system.conf in this fxsks channels are 1 & 2 and fxoks channels are 3 & 4 but I also used freePBX for gui mode in this When I searched Connectivity => Dahdi then I got fxsks channels are 3 & 4 and fxoks channels are 1 & 2, which one is right???
/etc/asterisk/chan_dahdi.conf
[general]
#include chan_dahdi_general.conf
#include chan_dahdi_general_custome.conf
[channels]
language=en
busydetect=yes
busycount=10
usecallerid=yes
callwaiting=yes
usecallingpres=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=no
immediate=no
faxdetect=no
rxgain=0.0
txgain=0.0
#include chan_dahdi_channels_custem.conf
#include chan_dahdi_groups.conf
#include chan_dahdi_additional.conf
/etc/asterisk/dahdi-channels.conf
;line="1 WCTDM/4/0 FXSKS (in use) (EC:MG2-INACTIVE)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel=>1
callerid=
group=
context=default
;line="2 WCTDM/4/1 FXSKS (in use) (EC:MG2-INACTIVE)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel=>2
callerid=
group=
context=default
;line="3 WCTDM/4/2 FXOKS (in use) (EC:MG2-INACTIVE)"
signalling=fxo_ks
callerid="channel 3" <4003>
mailbox=4003
group=5
context=from-internal
channel=>3
callerid=
mailbox=
group=
context=default
;line="4 WCTDM/4/3 FXOKS (in use) (EC:MG2-INACTIVE)"
signalling=fxo_ks
callerid="channel 4" <4004>
mailbox=4004
group=5
context=from-internal
channel=>4
callerid=
mailbox=
group=
context=default
I got one more conf file which name is Zapata which I post bellow..
etc/asterisk/zapata.conf.template
[channels]
language=en
#include zapata_additional.conf
context=from-pstn
signalling=fxs_ks
faxdetect=incoming
usecallerid=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=800
group=0
channel=1-2
and more thing I done change just in extension.conf which I mentioned in starting of discussion
I want share some more information, I install freePBX in server PC based on CentOS without gui interface, and I used freePBX in other pc using IP address of server.
And I made some extension based on SIP and Dahdi and its works successfully, If I call 101(Dahdi extension) from 105(SIP Extension) using soft-phone its work.
But when I try to call from my phone to landline then Dahdi extension line not get ring.
I also try to modify extension.conf file which I mentioned in above comment..
Tell one thing which way is better using freePBX or using modification in conf file??
Thanks....
Got it -- you don't have a context defined for from-pstn as specified in dahdi-channels.conf
Outside of freePBX the raw asterisk configuration would be, in your extensions.conf you'll need to add a section like this:
[from-pstn]
exten => _X.,1,Noop(Incoming call "from PSTN")
same => n,Answer()
same => n,Playback(demo-congrats)
same => n,Hangup()
In dahdi-channels.conf in the first two sections there's a definition of context=from-pstn which you'll need an accompanying context in your extensions.conf
The [bracketed] items are "contexts" in Asterisk, and specify a certain context in which the dialplan operates. More information can be found, especially, from the (free) book "Asterisk: The Future of Telephony"

How to get callerid using asterisk

my scenario is below
analog phone (10 to 99)------> pbx------>(77)asterisk--------> jitsi(2000)
i have analog telephone interface numbered 77 attached with asterisk and
other sip user is 2000 on jitsi.
I can call from any number from 10 to 99(in intercom) on 77 and ivr
response will come then i can typed 2000# and call go to 2000 named user
in asterisk.
Now my problem is when i am calling from 10 to 99 (any number) this number
should display to sip 2000's user. But its not showing to user. Its shows
asterisk#my_asterisk_server_ip.
my config. as follow
extension.conf
exten => s,1,Goto(phrase-menu,s,1)
[phrase-menu]
exten => s,1,Answer()
exten => s,2,Wait(1)
exten => s,3,Read(PHRASEID,/var/lib/asterisk/sounds/custom/soip)
exten => s,4,Wait(2)
exten => s,5,Set(CALLERID(num,CID)=${CALLERID})
exten => s,6,Dial(SIP/${PHRASEID},40,tT)
exten => h,1,Hangup()
and in chan_dahdi.conf
; General options
[channels]
usecallerid=yes
hidecallerid=no
callwaiting=yes
threewaycalling=yes
transfer=yes
echocancel=yes
echocancelwhenbridged=yes
cidsignalling=dtmf
cidstart=polarity
callerid=asreceived
rxgain=0.0
txgain=0.0
;FXO Modules
group=1
echocancel=yes
signalling=fxs_ks
context=default
channel=1-20
#include dahdi-channels.conf
any help
thanks..
Thanks a lot...
First of all, exten => s,5,Set(CALLERID(num,CID)=${CALLERID}) is not valid, it should read: exten => s,5,Set(CALLERID(num)=${CALLERID}). Second, setting CALLERID to CALLERID is redundant. Third, are you actually setting the callerid in the first place (that would happen in your default context)?

Resources