There is something wrong in your asterisk setup.
Please note that I use Trunkbuilder to set up my siptosis few years ago. The basic codes are the same with only minor settings adjustment
In my sip.conf of asterisk I have- [stsTrunk_01]
- username=stsTrunk_01
- type=friend
- secret=yourdefinedsecret
- host=127.0.0.1
- ;nat=no
- dtmfmode=auto
- canreinvite=no
- port=5072
- qualify=yes
- defaultip=127.0.0.1
- incominglimit=1
- outgoinglimit=1
- call-limit=1
- busylevel=1
複製代碼 The code in my extensions.conf- [CallingRule_Skype]; This serve 3 skype trunks _01 _02 _03 _05 _06 _07 _08 & _09 for outgoing to other skype accounts. Only 9 accounts.
- exten => _83[1235679].,1,NoOp
- exten => _83[1235679].,n,Dial(SIP/stsTrunk_0${EXTEN:2:1}/${EXTEN:3})
- exten => _83[1235679].,n,Macro(stsdialresult)
- exten => _83[1235679].,n,Playback(pls-try-call-later)
- exten => _83[1235679].,n,Hangup()
複製代碼 stsdialresult is a Macro I have- [macro-stsdialresult]
- ; **** this is not complete - but a good start ****
- ; 603 Refused - hangup
- ; 404 Failed, Invalid user, no skype credit (Can't tell the difference) - hangup
- ; 408 UNPLACED whatever that means, try next channel
- ; 600 Busy - hangup
- ; 403 Anything else - hangup
- ;ISUP Cause value SIP response
- ; ---------------- ------------
- ; 1 unallocated number 404 Not Found
- ; 2 no route to network 404 Not found
- ; 3 no route to destination 404 Not found
- ; 16 normal call clearing --- (*)
- ; 17 user busy 486 Busy here
- ; 18 no user responding 408 Request Timeout
- ; 19 no answer from the user 480 Temporarily unavailable
- ; 20 subscriber absent 480 Temporarily unavailable
- ; 21 call rejected 403 Forbidden (+)
- ; 22 number changed (w/o diagnostic) 410 Gone
- ; 22 number changed (w/ diagnostic) 301 Moved Permanently
- ; 23 redirection to new destination 410 Gone
- ; 26 non-selected user clearing 404 Not Found (=)
- ; 27 destination out of order 502 Bad Gateway
- ; 28 address incomplete 484 Address incomplete
- ; 29 facility rejected 501 Not implemented
- ; 31 normal unspecified 480 Temporarily unavailable
- exten => s,1,NoOp(HANGUPCAUSE is ${HANGUPCAUSE} and DIALSTATUS is ${DIALSTATUS})
- exten => s,2(debug1),Verbose(1,debug1 "${HANGUPCAUSE}:${DIALSTATUS}")
- exten => s,3,Set(TIMEOUT(absolute)=120)
- exten => s,4,GotoIf($[${HANGUPCAUSE} = 0]?s,6)
- exten => s,5,Goto(cause-${HANGUPCAUSE},1)
- exten => s,6,GotoIf($[${DIALSTATUS} = NOANSWER]?cause-19,1)
- exten => s,7,GotoIf($[${DIALSTATUS} = BUSY]?cause-2,1)
- exten => s,8,GotoIf($[${DIALSTATUS} = CHANUNAVAIL]?cause-0,1)
- exten => s,9,GotoIf($[${DIALSTATUS} = ANSWER]?exit-1,1)
- exten => s,10,Goto(cause-0,1)
- exten => cause-0,1,NoOp(AST_CAUSE_NOTDEFINED)
- exten => cause-0,n,Verbose(1,debug "cause-0")
- exten => cause-0,n,Playback(error)
- ;exten => cause-0,n,Congestion
- exten => cause-0,n,Goto(exit-1,1)
- exten => cause-1,1,NoOp(AST_CAUSE_FAILURE)
- exten => cause-1,n,Verbose(1,debug "cause-1 invalid destination")
- exten => cause-1,n,Playback(invalid)
- exten => cause-1,n,Hangup
- exten => cause-2,1,NoOp(AST_CAUSE_BUSY)
- exten => cause-2,n,Verbose(1,debug "cause-2 busy")
- exten => cause-2,n,Busy
- exten => cause-3,1,NoOp(AST_CAUSE_FAILURE)
- exten => cause-3,n,Verbose(1,debug "cause-3")
- ;exten => cause-3,n,Playback(error)
- exten => cause-3,n,Goto(exit-1,1)
- exten => cause-4,1,NoOp(AST_CAUSE_CONGESTION)
- exten => cause-4,n,Verbose(1,debug "cause-4")
- exten => cause-4,n,Goto(exit-1,1)
- exten => cause-5,1,NoOp(AST_CAUSE_UNALLOCATED)
- exten => cause-5,n,Verbose(1,debug "cause-5 invalid destination")
- exten => cause-5,n,Playback(invalid)
- exten => cause-5,n,Hangup
- exten => cause-18,1,NoOp(AST_CAUSE_CALL_UNPLACED)
- exten => cause-18,n,Verbose(1,debug "cause-18 unplaced")
- exten => cause-18,n,Goto(exit-1,1)
- exten => cause-19,1,NoOp(AST_CAUSE_NO_ANSWER)
- exten => cause-19,n,Verbose(1,debug "cause-19 noanswer")
- exten => cause-19,n,Playback(noanswer)
- exten => cause-19,n,Hangup
- exten => cause-21,1,NoOp(AST_CAUSE_CALL_REJECTED)
- exten => cause-21,n,Verbose(1,debug "cause-21 rejected")
- exten => cause-21,n,Playback(rejected)
- exten => cause-21,n,Hangup
- exten => _cause-X,1,NoOp(UNKNOWN_CAUSECODE)
- exten => _cause-X,n,Verbose(1,debug "cause-X")
- exten => _cause-X,n,Playback(error)
- ;exten => _cause-X,n,Congestion
- exten => _cause-X,n,Goto(exit-1,1)
- exten => exit,1(exit),Noop
複製代碼 Hope this is helpful. |