Outgoing PSTN calls through asterisk fails

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

Outgoing PSTN calls through asterisk fails

Postby miraclekhan » Sat Oct 22, 2011 5:09 am

Hi,
I am new to asterisk and to the forum as well. I have an asterisk box configured by another admin. We have Asterisk 1.6.2.20 with Sangoma A101 card. Incoming calls to the asterisk from PRI line is being received by X-Lite clients but outgoing calls fail.

I did a tail -f /var/log/asterisk/messages/ but dont see any error there. On running wireshark, I see a 503 response to the sip Invite with header "X-Asterisk-HangupCauseCode: 38". I have no clue what to do. This is a prodection PBX. please help me!
miraclekhan
Newsterisk
 
Posts: 8
Joined: Sat Oct 22, 2011 2:13 am

Re: Outgoing PSTN calls through asterisk fails

Postby SGM » Sun Oct 23, 2011 6:46 am

Posting your dialplan & configuration might help.
SGM
Oldsterisk
 
Posts: 193
Joined: Thu Dec 21, 2006 10:56 pm

Re: Outgoing PSTN calls through asterisk fails

Postby miraclekhan » Mon Oct 24, 2011 12:10 am

Here is my extensions.conf:


[general]

static = yes

writeprotect = no


clearglobalvars = no

[globals]
CONSOLE = Console/dsp ; Console interface for demo

IAXINFO = guest ; IAXtel username/password

TRUNK = DAHDI/G1

TRUNKMSD = 1 ; MSD digits to strip (usually 1 or 0)
FEATURES =
DIALOPTIONS =
RINGTIME = 20
FOLLOWMEOPTIONS =
PAGING_HEADER = Intercom

[dundi-e164-canonical]

[dundi-e164-customers]

[dundi-e164-via-pstn]

[dundi-e164-local]

include => dundi-e164-canonical
include => dundi-e164-customers
include => dundi-e164-via-pstn

[dundi-e164-switch]

switch => DUNDi/e164

[dundi-e164-lookup]

include => dundi-e164-local
include => dundi-e164-switch

[macro-dundi-e164]

exten => s,1,Goto(${ARG1},1)
include => dundi-e164-lookup


[iaxtel700]
exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)


[iaxprovider]

[trunkint]

exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})

[trunkld]

exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[trunklocal]

exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[trunktollfree]

exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[international]

ignorepat => 9
include => longdistance
include => trunkint

[longdistance]

ignorepat => 9
include => local
include => trunkld

[local]

ignorepat => 9
include => default
include => trunklocal
include => iaxtel700
include => trunktollfree
include => iaxprovider

include => parkedcalls


[outbound-freenum]

exten => _X*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXXX*X!,1,Goto(outbound-freenum2,${EXTEN},1)

[outbound-freenum2]

exten => _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN})
same => n,Set(SUFFIX=${CUT(EXTEN,*,2-)}) ; make sure the suffix is all digits as well
same => n,GotoIf($["${FILTER(0-9,${SUFFIX})}" != "${SUFFIX}"]?fn-CONGESTION,1)

same => n,Set(TIMEOUT(absolute)=10800)
same => n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)}) ; perform our lookup with freenum.org
same => n,GotoIf($["${isnresult}" != ""]?from)
same => n,Set(DIALSTATUS=CONGESTION)
same => n,Goto(fn-CONGESTION,1)
same => n(from),Set(__SIPFROMUSER=${CALLERID(num)})
same => n,GotoIf($["${GLOBAL(FREENUMDOMAIN)}" = ""]?dial) ; check if we set the FREENUMDOMAIN global variable in [global]
same => n,Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ; if we did set it, then we'll use it for our outbound dialing domain
same => n(dial),Dial(SIP/${isnresult},40)
same => n,Goto(fn-${DIALSTATUS},1)

exten => fn-BUSY,1,Busy()

exten => _f[n]-.,1,NoOp(ISN: ${DIALSTATUS})
same => n,Congestion()

[macro-trunkdial]

exten => s,1,Dial(${ARG1})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Hangup
exten => s-BUSY,1,Hangup
exten => _s-.,1,NoOp

[stdexten]

exten => _X.,50000(stdexten),NoOp(Start stdexten)
exten => _X.,n,Set(LOCAL(ext)=${EXTEN})
exten => _X.,n,Set(LOCAL(dev)=${ARG1})
exten => _X.,n,Set(LOCAL(cntx)=${ARG2})
exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})})
exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start

exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
exten => stdexten-BUSY,n,Return() ; If they press #, return to start

exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
exten => a,n,Return()

[stdPrivacyexten]

exten => _X.,60000(stdPrivacyexten),NoOp(Start stdPrivacyexten)
exten => _X.,n,Set(LOCAL(ext)=${ARG1})
exten => _X.,n,Set(LOCAL(dev)=${ARG2})
exten => _X.,n,Set(LOCAL(dontcntx)=${ARG3})
exten => _X.,n,Set(LOCAL(tortcntx)=${ARG4})
exten => _X.,n,Set(LOCAL(cntx)=${ARG5})

exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
exten => _X.,n,Dial(${dev},20,p) ; Ring the interface, 20 seconds maximum, call screening

exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER)
exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start

exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY)
exten => stdexten-BUSY,n,Return() ; If they press #, return to start

exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1) ; Callee chose to send this call to a polite "Don't call again" script.

exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1) ; Callee chose to send this call to a telemarketer torture script.

exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer

exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
exten => a,n,Return

[macro-page];

exten => s,1,ChanIsAvail(${ARG1},s) ; s is for ANY call
exten => s,n,GoToIf($[${AVAILORIGCHAN} = ""]?fail:autoanswer)
exten => s,n(autoanswer),Set(_ALERT_INFO="RA") ; This is for the PolyComs
exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!!
exten => s,n,Dial(${ARG1})
exten => s,n(fail),Hangup


[demo]
include => stdexten

exten => s,1,Wait(1) ; Wait a second, just for fun
exten => s,n,Answer ; Answer the line
exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
exten => s,n,WaitExten ; Wait for an extension to be dialed.

exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
exten => 2,n,Goto(s,instruct)

exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
exten => 3,n,Goto(s,restart) ; Start with the congratulations

exten => 1000,1,Goto(default,s,1)

exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."

exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
exten => 1234,n,Goto(default,s,1) ; exited Voicemail

exten => 1235,1,Voicemail(1234,u) ; Right to voicemail

exten => 1236,1,Dial(Console/dsp) ; Ring forever
exten => 1236,n,Voicemail(1234,b) ; Unless busy

exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
exten => #,n,Hangup ; Hang them up.

exten => t,1,Goto(#,1) ; If they take too long, give up
exten => i,1,Playback(invalid) ; "That's not valid, try again"

exten => 500,1,Playback(demo-abouttotry) ; Let them know what's going on
exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site
exten => 500,n,Goto(s,6) ; Return to the start over message.

exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
exten => 600,n,Echo ; Do the echo test
exten => 600,n,Playback(demo-echodone) ; Let them know it's over
exten => 600,n,Goto(s,6) ; Start over

exten => 76245,1,Macro(page,SIP/Grandstream1)

exten => _7XXX,1,Macro(page,SIP/${EXTEN})

exten => 7999,1,Set(TIMEOUT(absolute)=60)
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)


exten => 8500,1,VoicemailMain
exten => 8500,n,Goto(s,6)

[page]

exten => _X.,1,Macro(page,SIP/${EXTEN})


[default]





include => punastro


[time]
exten => _X.,30000(time),NoOp(Time: ${EXTEN} ${timezone})
exten => _X.,n,Wait(0.25)
exten => _X.,n,Answer()
exten => _X.,n,Set(FUTURETIME=$[${EPOCH} + 12])
exten => _X.,n,SayUnixTime(${FUTURETIME},Zulu,HNS)
exten => _X.,n,SayPhonetic(z)
exten => _X.,n,SayUnixTime(${FUTURETIME},${timezone},HNS)
exten => _X.,n,Playback(spy-local)
exten => _X.,n,WaitUntil(${FUTURETIME})
exten => _X.,n,Playback(beep)
exten => _X.,n,Return()

[ani]
exten => _X.,40000(ani),NoOp(ANI: ${EXTEN})
exten => _X.,n,Wait(0.25)
exten => _X.,n,Answer()
exten => _X.,n,Playback(vm-from)
exten => _X.,n,SayDigits(${CALLERID(ani)})
exten => _X.,n,Wait(1.25)
exten => _X.,n,SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit
exten => _X.,n,Return()

[from-pstn]
exten => _X.,1,Dial(SIP/5000&SIP/5001&SIP/5002&SIP/5003&SIP/5004&SIP/5005&SIP/5006&SIP/5007&SIP/5008&SIP/5009&SIP/5010&SIP/5011&SIP/5012&SIP/5013&SIP/5014&SIP/5015, 15, rtTwW)
exten => _X.,2,Voicemail(5000,u)

[punastro]
exten => _XXXX,1,Dial(SIP/${EXTEN}) ;

exten => _XXXXX.,1,Dial(DAHDI/G1/${EXTEN},40,rtT)
[macro-stdexten]
exten = s,1,Set(__DYNAMIC_FEATURES=${FEATURES})
exten = s,2,Set(ORIG_ARG1=${ARG1})
exten = s,3,GotoIf($["${FOLLOWME_${ARG1}}" = "1"]?6:4)
exten = s,4,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
exten = s,5,Goto(s-${DIALSTATUS},1)
exten = s,6,Macro(stdexten-followme,${ARG1},${ARG2})
exten = s-NOANSWER,1,Voicemail(${ORIG_ARG1},u)
exten = s-NOANSWER,2,Goto(default,s,1)
exten = s-BUSY,1,Voicemail(${ORIG_ARG1},b)
exten = s-BUSY,2,Goto(default,s,1)
exten = _s-.,1,Goto(s-NOANSWER,1)
exten = a,1,VoicemailMain(${ORIG_ARG1})
[macro-stdexten-followme]
exten = s,1,Answer
exten = s,2,Set(ORIG_ARG1=${ARG1})
exten = s,3,Dial(${ARG2},${RINGTIME},${DIALOPTIONS})
exten = s,4,Set(__FMCIDNUM=${CALLERID(num)})
exten = s,5,Set(__FMCIDNAME=${CALLERID(name)})
exten = s,6,Followme(${ORIG_ARG1},${FOLLOWMEOPTIONS})
exten = s,7,Voicemail(${ORIG_ARG1},u)
exten = s-NOANSWER,1,Voicemail(${ORIG_ARG1},u)
exten = s-BUSY,1,Voicemail(${ORIG_ARG1},b)
exten = s-BUSY,2,Goto(default,s,1)
exten = _s-.,1,Goto(s-NOANSWER,1)
exten = a,1,VoicemailMain(${ORIG_ARG1})
[macro-pagingintercom]
exten = s,1,SIPAddHeader(Alert-Info: ${PAGING_HEADER})
exten = s,2,Page(${ARG1},${ARG2})
exten = s,3,Hangup
[conferences]
[ringgroups]
[queues]
[voicemenus]
[voicemailgroups]
[directory]
[page_an_extension]
[pagegroups]
[asterisk_guitools]
exten = executecommand,1,System(${command})
exten = executecommand,n,Hangup()
exten = record_vmenu,1,Answer
exten = record_vmenu,n,Playback(vm-intro)
exten = record_vmenu,n,Record(${var1},0,500,k)
exten = record_vmenu,n,Playback(vm-saved)
exten = record_vmenu,n,Playback(vm-goodbye)
exten = record_vmenu,n,Hangup
exten = play_file,1,Answer
exten = play_file,n,Playback(${var1})
exten = play_file,n,Hangup
[macro-local-callingrule-cid-0.1]
exten = s,1,Set(CALLERID(all)=${IF($[${LEN(${ARG4})} > 2]?${ARG4}:)})
exten = s,n,Goto(${ARG1},${ARG2},${ARG3})
[macro-trunkdial-failover-0.3]
exten = s,1,GotoIf($[${LEN(${FMCIDNUM})} > 6]?1-fmsetcid,1)
exten = s,n,GotoIf($[${LEN(${GLOBAL_OUTBOUNDCIDNAME})} > 1]?1-setgbobname,1)
exten = s,n,Set(CALLERID(num)=${IF($[${LEN(${CID_${CALLERID(num)}})} > 2]?${CID_${CALLERID(num)}}:)})
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})
exten = s,n,GotoIf($[${LEN(${CALLERID(num)})} > 6]?1-dial,1)
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${CID_${ARG3}})} > 6]?${CID_${ARG3}}:${GLOBAL_OUTBOUNDCID})})
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})
exten = s,n,Goto(1-dial,1)
exten = 1-setgbobname,1,Set(CALLERID(name)=${GLOBAL_OUTBOUNDCIDNAME})
exten = 1-setgbobname,n,Goto(s,3)
exten = 1-fmsetcid,1,Set(CALLERID(num)=${FMCIDNUM})
exten = 1-fmsetcid,n,Set(CALLERID(name)=${FMCIDNAME})
exten = 1-fmsetcid,n,Goto(s,4)
exten = 1-dial,1,Dial(${ARG1})
exten = 1-dial,n,Gotoif(${LEN(${ARG2})} > 0 ?1-${DIALSTATUS},1:1-out,1)
exten = 1-CHANUNAVAIL,1,Dial(${ARG2})
exten = 1-CHANUNAVAIL,n,Hangup()
exten = 1-CONGESTION,1,Dial(${ARG2})
exten = 1-CONGESTION,n,Hangup()
exten = 1-out,1,Hangup()
[queue-member-manager]
exten = handle_member,1,Verbose(2, Looping through queues to log in or out queue members)
exten = handle_member,n,Set(thisActiveMember=${CHANNEL(channeltype)}/${CHANNEL(peername)})
exten = handle_member,n,Set(queue_field=2)
exten = handle_member,n,Set(thisQueueXtn=${CUT(QUEUES,\,,${queue_field})})
exten = handle_member,n,While($[${EXISTS(${thisQueueXtn})}])
exten = handle_member,n,Macro(member-loginlogout)
exten = handle_member,n,Set(queue_field=$[${queue_field} + 1])
exten = handle_member,n,Set(thisQueueXtn=${CUT(QUEUES,\,,${queue_field})})
exten = handle_member,n,EndWhile()
[macro-member-loginlogout]
exten = s,1,Verbose(2, Logging queue member in or out of the request queue)
exten = s,n,Set(thisQueue=${thisQueueXtn})
exten = s,n,Set(queueMembers=${QUEUE_MEMBER_LIST(${thisQueue})})
exten = s,n,Set(field=1)
exten = s,n,Set(logged_in=0)
exten = s,n,Set(thisQueueMember=${CUT(queueMembers,\,,${field})})
exten = s,n,While($[${EXISTS(${thisQueueMember})}])
exten = s,n,GotoIf($["${thisQueueMember}" != "${thisActiveMember}"]?check_next)
exten = s,n,Set(logged_in=1)
exten = s,n,ExitWhile()
exten = s,n(check_next),Set(field=$[${field} + 1])
exten = s,n,Set(thisQueueMember=${CUT(queueMembers,\,,${field})})
exten = s,n,EndWhile()
exten = s,n,MacroIf($[${logged_in} = 0]?q_login:q_logout)
[macro-q_login]
exten = s,1,Verbose(2, Logging ${thisActiveMember} into the ${thisQueue} queue)
exten = s,n,AddQueueMember(${thisQueue},${thisActiveMember})
exten = s,n,Playback(silence/1)
exten = s,n,ExecIf($["${AQMSTATUS}" = "ADDED"]?Playback(agent-loginok):Playback(an-error-has-occurred))
[macro-q_logout]
exten = s,1,Verbose(2, Logged ${thisActiveMember} out of ${thisQueue} queue)
exten = s,n,RemoveQueueMember(${thisQueue},${thisActiveMember})
exten = s,n,Playback(silence/1)
exten = s,n,ExecIf($["${RQMSTATUS}" = "REMOVED"]?Playback(agent-loggedoff):Playback(an-error-has-occurred))
miraclekhan
Newsterisk
 
Posts: 8
Joined: Sat Oct 22, 2011 2:13 am

Re: Outgoing PSTN calls through asterisk fails

Postby miraclekhan » Mon Oct 24, 2011 1:09 am

I set the verbose level to 10 and here is the error:

== Using SIP RTP CoS mark 5
-- Executing [09900435066@default:1] Dial("SIP/5002-00000003", "DAHDI/G1/09900435066,40,rtT") in new stack
-- Requested transfer capability: 0x00 - SPEECH
-- Called G1/09900435066
-- DAHDI/31-1 is proceeding passing it to SIP/5002-00000003
-- Span 1: Channel 0/31 got hangup, cause 38
-- DAHDI/31-1 is circuit-busy
-- Hungup 'DAHDI/31-1'
== Everyone is busy/congested at this time (1:0/1/0)
-- Auto fallthrough, channel 'SIP/5002-00000003' status is 'CONGESTION'

========================================================================================================

vi /etc/asterisk/chan_dahdi.conf

;autogenerated by /usr/sbin/wancfg_dahdi do not hand edit
;autogenrated on 2011-08-27
;Dahdi Channels Configurations
;For detailed Dahdi options, view /etc/asterisk/chan_dahdi.conf.bak

[trunkgroups]

[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no

;Sangoma A101 port 1 [slot:4 bus:4 span:1] <wanpipe1>
switchtype=euroisdn
context=from-pstn
group=1
echocancel=yes
signalling=pri_cpe
; added by pforte 9.8.11
;dchan = 16
; end of additions by pforte
channel =>1-15,17-31

========================================================================================================

dahdi show channels:

Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
1 from-pstn default In Service
2 from-pstn default In Service
3 from-pstn default In Service
4 from-pstn default In Service
5 from-pstn default In Service
6 from-pstn default In Service
7 from-pstn default In Service
8 from-pstn default In Service
9 from-pstn default In Service
10 from-pstn default In Service
11 from-pstn default In Service
12 from-pstn default In Service
13 from-pstn default In Service
14 from-pstn default In Service
15 from-pstn default In Service
17 from-pstn default In Service
18 from-pstn default In Service
19 from-pstn default In Service
20 from-pstn default In Service
21 from-pstn default In Service
22 from-pstn default In Service
23 from-pstn default In Service
24 from-pstn default In Service
25 from-pstn default In Service
26 from-pstn default In Service
27 from-pstn default In Service
28 from-pstn default In Service
29 from-pstn default In Service
30 from-pstn default In Service
31 from-pstn default In Service
miraclekhan
Newsterisk
 
Posts: 8
Joined: Sat Oct 22, 2011 2:13 am

Re: Outgoing PSTN calls through asterisk fails

Postby david55 » Mon Oct 24, 2011 1:34 am

You need to provide the detailed signalling trace, but my guess is that channel 31 is configured as incoming only by the service provider. or maybe you haven't actually bought 30 channels.
david55
Moves Like Spencer
 
Posts: 10740
Joined: Fri Sep 26, 2008 5:03 am

Re: Outgoing PSTN calls through asterisk fails

Postby miraclekhan » Mon Oct 24, 2011 2:01 am

Hi david55,

This used to work earlier, we have bought 30 channels.

Trace:

INVITE sip:09900435066@192.168.0.201 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.102:47697;branch=z9hG4bK-d8754z-ab7925840b8a8726-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:5002@192.168.0.102:47697>
To: "09900435066"<sip:09900435066@192.168.0.201>
From: "Arshad Khan"<sip:5002@192.168.0.201>;tag=7139aa28
Call-ID: YWRmMzUzM2FmYmQyZWMyNDJiNmM3Njg3YWZlZjk5ZDQ.
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
Supported: replaces
User-Agent: X-Lite 4 release 4.1 stamp 63214
Authorization: Digest username="5002",realm="asterisk",nonce="224d8484",uri="sip:09900435066@192.168.0.201",response="69c35bad75be4146b01f1ba55a32dbd4",algorithm=MD5
Content-Length: 410

v=0
o=- 12963743524105646 1 IN IP4 192.168.0.102
s=CounterPath X-Lite 4.1
c=IN IP4 192.168.0.102
t=0 0
a=ice-ufrag:31bf5b
a=ice-pwd:04dd30635b1cf3e6478d287c3f02040d
m=audio 53060 RTP/AVP 107 0 8 101
a=rtpmap:107 BV32/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=candidate:1 1 UDP 659136 192.168.0.102 53060 typ host
a=candidate:1 2 UDP 659134 192.168.0.102 53061 typ host

SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.102:47697;branch=z9hG4bK-d8754z-ab7925840b8a8726-1---d8754z-;received=192.168.0.102;rport=47697
From: "Arshad Khan"<sip:5002@192.168.0.201>;tag=7139aa28
To: "09900435066"<sip:09900435066@192.168.0.201>
Call-ID: YWRmMzUzM2FmYmQyZWMyNDJiNmM3Njg3YWZlZjk5ZDQ.
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.20
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:09900435066@192.168.0.201>
Content-Length: 0

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.102:47697;branch=z9hG4bK-d8754z-ab7925840b8a8726-1---d8754z-;received=192.168.0.102;rport=47697
From: "Arshad Khan"<sip:5002@192.168.0.201>;tag=7139aa28
To: "09900435066"<sip:09900435066@192.168.0.201>;tag=as12727025
Call-ID: YWRmMzUzM2FmYmQyZWMyNDJiNmM3Njg3YWZlZjk5ZDQ.
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.20
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:09900435066@192.168.0.201>
Content-Length: 0

SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 192.168.0.102:47697;branch=z9hG4bK-d8754z-ab7925840b8a8726-1---d8754z-;received=192.168.0.102;rport=47697
From: "Arshad Khan"<sip:5002@192.168.0.201>;tag=7139aa28
To: "09900435066"<sip:09900435066@192.168.0.201>;tag=as12727025
Call-ID: YWRmMzUzM2FmYmQyZWMyNDJiNmM3Njg3YWZlZjk5ZDQ.
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.20
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
X-Asterisk-HangupCause: Network out of order
X-Asterisk-HangupCauseCode: 38
Content-Length: 0
miraclekhan
Newsterisk
 
Posts: 8
Joined: Sat Oct 22, 2011 2:13 am

Re: Outgoing PSTN calls through asterisk fails

Postby david55 » Mon Oct 24, 2011 4:59 am

That is a SIP trace. You need to provide the E1 side trace.
david55
Moves Like Spencer
 
Posts: 10740
Joined: Fri Sep 26, 2008 5:03 am

Re: Outgoing PSTN calls through asterisk fails

Postby miraclekhan » Mon Oct 24, 2011 5:46 am

Is this what you are looking for? If not please let me know the command. Pardon my ignorance. I am pretty new at this thing..

I did a pri set debug 2 span 1.

== Using SIP RTP CoS mark 5
-- Executing [09900435066@default:1] Dial("SIP/5002-00000011", "DAHDI/G1/09900435066,40,rtT") in new stack
-- Making new call for cref 32780
-- Requested transfer capability: 0x00 - SPEECH

> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=38
> TEI=0 Call Ref: len= 2 (reference 12/0xC) (Sent from originator)
> Message Type: SETUP (5)
TEI=0 Transmitting N(S)=27, window is open V(A)=27 K=7

> TEI: 0 State 7(Multi-frame established)
> V(A)=27, V(S)=27, V(R)=25
> K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
> T200_id=0, N200=3, T203_id=8192
> [ 00 01 36 32 08 02 00 0c 05 04 03 80 90 a3 18 03 a1 83 9f 6c 06 21 80 35 30 30 32 70 0c 80 30 39 39 30 30 34 33 35 30 36 36 a1 ]
> Informational frame:
> SAPI: 00 C/R: 0 EA: 0
> TEI: 000 EA: 1
> N(S): 027 0: 0
> N(R): 025 P: 0
> 38 bytes of data
> Protocol Discriminator: Q.931 (8) len=38
> TEI=0 Call Ref: len= 2 (reference 12/0xC) (Sent from originator)
> Message Type: SETUP (5)
> [04 03 80 90 a3]
> Bearer Capability (len= 5) [ Ext: 1 Coding-Std: 0 Info transfer capability: Speech (0)
> Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
> User information layer 1: A-Law (35)
> [18 03 a1 83 9f]
> Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Preferred Dchan: 0
> ChanSel: As indicated in following octets
> Ext: 1 Coding: 0 Number Specified Channel Type: 3
> Ext: 1 Channel: 31 Type: CPE]
> [6c 06 21 80 35 30 30 32]
> Calling Number (len= 8) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
> Presentation: Presentation permitted, user number not screened (0) '5002' ]
> [70 0c 80 30 39 39 30 30 34 33 35 30 36 36]
> Called Number (len=14) [ Ext: 1 TON: Unknown Number Type (0) NPI: Unknown Number Plan (0) '09900435066' ]
> [a1]
> Sending Complete (len= 1)
-- Stopping T203 timer
-- Starting T200 timer
q931.c:6036 q931_setup: Call 32780 enters state 1 (Call Initiated). Hold state: Idle
-- Called G1/09900435066

< TEI: 0 State 7(Multi-frame established)
< V(A)=27, V(S)=28, V(R)=25
< K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
< T200_id=8192, N200=3, T203_id=0
< [ 00 01 01 38 ]
< Supervisory frame:
< SAPI: 00 C/R: 0 EA: 0
< TEI: 000 EA: 1
< Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
< N(R): 028 P/F: 0
< 0 bytes of data
-- Got ACK for N(S)=27 to (but not including) N(S)=28
-- ACKing N(S)=27, tx_queue head is N(S)=-1 (-1 is empty, -2 is not transmitted)
-- Stopping T200 timer
-- Starting T203 timer
Done handling message for SAPI/TEI=0/0

< TEI: 0 State 7(Multi-frame established)
< V(A)=28, V(S)=28, V(R)=25
< K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
< T200_id=0, N200=3, T203_id=8192
< [ 02 01 32 38 08 02 80 0c 02 18 03 a9 83 9f ]
< Informational frame:
< SAPI: 00 C/R: 1 EA: 0
< TEI: 000 EA: 1
< N(S): 025 0: 0
< N(R): 028 P: 0
< 10 bytes of data
< Protocol Discriminator: Q.931 (8) len=10
< TEI=0 Call Ref: len= 2 (reference 12/0xC) (Sent to originator)
< Message Type: CALL PROCEEDING (2)
< [18 03 a9 83 9f]
< Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
< ChanSel: As indicated in following octets
< Ext: 1 Coding: 0 Number Specified Channel Type: 3
< Ext: 1 Channel: 31 Type: CPE]
-- Got ACK for N(S)=28 to (but not including) N(S)=28
-- T200 requested to stop when not started
T203 requested to start without stopping first
-- Starting T203 timer
Received message for call 0xb76055f8 on link 0x8cde1b4 TEI/SAPI 0/0
-- Processing IE 24 (cs0, Channel Identification)
q931.c:8454 post_handle_q931_message: Call 32780 enters state 3 (Outgoing Call Proceeding). Hold state: Idle

> TEI: 0 State 7(Multi-frame established)
> V(A)=28, V(S)=28, V(R)=26
> K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
> T200_id=0, N200=3, T203_id=8192
> [ 02 01 01 34 ]
> Supervisory frame:
> SAPI: 00 C/R: 1 EA: 0
> TEI: 000 EA: 1
> Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
> N(R): 026 P/F: 0
> 0 bytes of data
Done handling message for SAPI/TEI=0/0
-- DAHDI/31-1 is proceeding passing it to SIP/5002-00000011

< TEI: 0 State 7(Multi-frame established)
< V(A)=28, V(S)=28, V(R)=26
< K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
< T200_id=0, N200=3, T203_id=8192
< [ 02 01 34 38 08 02 80 0c 4d 08 06 82 a6 00 00 00 00 ]
< Informational frame:
< SAPI: 00 C/R: 1 EA: 0
< TEI: 000 EA: 1
< N(S): 026 0: 0
< N(R): 028 P: 0
< 13 bytes of data
< Protocol Discriminator: Q.931 (8) len=13
< TEI=0 Call Ref: len= 2 (reference 12/0xC) (Sent to originator)
< Message Type: RELEASE (77)
< [08 06 82 a6 00 00 00 00]
< Cause (len= 8) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Public network serving the local user (2)
< Ext: 1 Cause: Network out of order (38), class = Network Congestion (resource unavailable) (2) ]
< Cause data 1: 00 (0)
< Cause data 2: 00 (0)
< Cause data 3: 00 (0)
< Cause data 4: 00 (0)
-- Got ACK for N(S)=28 to (but not including) N(S)=28
-- T200 requested to stop when not started
T203 requested to start without stopping first
-- Starting T203 timer
Received message for call 0xb76055f8 on link 0x8cde1b4 TEI/SAPI 0/0
-- Processing IE 8 (cs0, Cause)
q931.c:8620 post_handle_q931_message: Call 32780 enters state 0 (Null). Hold state: Idle

> TEI: 0 State 7(Multi-frame established)
> V(A)=28, V(S)=28, V(R)=27
> K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
> T200_id=0, N200=3, T203_id=8192
> [ 02 01 01 36 ]
> Supervisory frame:
> SAPI: 00 C/R: 1 EA: 0
> TEI: 000 EA: 1
> Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
> N(R): 027 P/F: 0
> 0 bytes of data
Done handling message for SAPI/TEI=0/0
-- Span 1: Channel 0/31 got hangup, cause 38
-- DAHDI/31-1 is circuit-busy
q931.c:6837 q931_hangup: Hangup other cref:32780
q931.c:6594 __q931_hangup: ourstate Null, peerstate Release Request, hold-state Idle

> DL-DATA request
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 12/0xC) (Sent from originator)
> Message Type: RELEASE COMPLETE (90)
TEI=0 Transmitting N(S)=28, window is open V(A)=28 K=7

> TEI: 0 State 7(Multi-frame established)
> V(A)=28, V(S)=28, V(R)=27
> K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
> T200_id=0, N200=3, T203_id=8192
> [ 00 01 38 36 08 02 00 0c 5a 08 02 81 90 ]
> Informational frame:
> SAPI: 00 C/R: 0 EA: 0
> TEI: 000 EA: 1
> N(S): 028 0: 0
> N(R): 027 P: 0
> 9 bytes of data
> Protocol Discriminator: Q.931 (8) len=9
> TEI=0 Call Ref: len= 2 (reference 12/0xC) (Sent from originator)
> Message Type: RELEASE COMPLETE (90)
> [08 02 81 90]
> Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
> Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]
-- Stopping T203 timer
-- Starting T200 timer
q931.c:6837 q931_hangup: Hangup other cref:32780
q931.c:6594 __q931_hangup: ourstate Null, peerstate Null, hold-state Idle
Destroying call 0xb76055f8, ourstate Null, peerstate Null, hold-state Idle
-- Hungup 'DAHDI/31-1'
== Everyone is busy/congested at this time (1:0/1/0)
-- Auto fallthrough, channel 'SIP/5002-00000011' status is 'CONGESTION'

< TEI: 0 State 7(Multi-frame established)
< V(A)=28, V(S)=29, V(R)=27
< K=7, RC=0, l3_initiated=0, reject_except=0, ack_pend=0
< T200_id=8192, N200=3, T203_id=0
< [ 00 01 01 3a ]
< Supervisory frame:
< SAPI: 00 C/R: 0 EA: 0
< TEI: 000 EA: 1
< Zero: 0 S: 0 01: 1 [ RR (receive ready) ]
< N(R): 029 P/F: 0
< 0 bytes of data
-- Got ACK for N(S)=28 to (but not including) N(S)=29
-- ACKing N(S)=28, tx_queue head is N(S)=-1 (-1 is empty, -2 is not transmitted)
-- Stopping T200 timer
-- Starting T203 timer
Done handling message for SAPI/TEI=0/0
miraclekhan
Newsterisk
 
Posts: 8
Joined: Sat Oct 22, 2011 2:13 am

Re: Outgoing PSTN calls through asterisk fails

Postby david55 » Mon Oct 24, 2011 6:00 am

That looks like the right trace (note I don't use DAHDI, so, whilst I can tell that the problem is on that side, I don't know the exact commands to debug it).

You need to show this to your service provide and ask them why they are responding "network out of order".

On the face of it, this is an admission of the fault being on their side. If the fault were on the Asterisk side I would expect the diagnostic to say the request was invalid in some way.

You are acutally sending an invalid caller ID, but I wouldn't expect that to produce network out of order.

You are claiming to be sending something in national number format, which, for the UK, might mean 207xxxyyyy, for a central London number, but you are only sending four digits. However, as the number is not screened, I'd expect them to ignore it, anyway.
david55
Moves Like Spencer
 
Posts: 10740
Joined: Fri Sep 26, 2008 5:03 am

Re: Outgoing PSTN calls through asterisk fails

Postby miraclekhan » Mon Oct 24, 2011 6:38 am

Talked to the service provider. They say that the line is fine and there is no blockages from their side.. :(
miraclekhan
Newsterisk
 
Posts: 8
Joined: Sat Oct 22, 2011 2:13 am


Return to Asterisk Support

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests