Calls in/out problem from extenssion

Hi,

First sorry for my bad english, and i’m a really newbie with asterix.

The problem is that I do not manage to realize calls between my 2 accounts internal 1000 and 1001 nevertheless I manage to make the login above, puts puts its show me the following error message :

“[May 30 21:33:08] NOTICE[5565]: chan_sip.c:22873 handle_request_invite: Call from ‘1001’ (94.224.68.133:63996) to extension ‘1000’ rejected because extension not found in context ‘interne’.”

I would like that when I connect in the account 1000 or 1001, I can realize my outbound calls by means of my account voipbuster (name of account: synergiec1).

The format with internationnal prefix in belgium are 0032 2 123 45 67 or +32 2 123 45 67. (0032 or +32 = internationnal code and 2 = area code, the rest is the number)

But I am totally lost in my configuration.

Can anybody help me please?

Thank you in advance.

My sip.conf file :

[general] port = 5060 bindaddr = 0.0.0.0 dtmfmode=rfc2833 srvlookup=yes register => synergiec1:tzkev5276@sip1.voipbuster.com/synergiec1 ; [1000] username=1000 secret=1000 type=friend host=dynamic disallow=all allow=alaw allow=ulaw allow=gsm context=interne nat=never qualify=yes dtmfmode=rfc2833 ; [1001] username=1001 secret=1001 type=friend host=dynamic disallow=all allow=alaw allow=ulaw allow=gsm context=interne nat=never qualify=yes dtmfmode=rfc2833 ; [voipbuster] username=synergiec1 secret=tzkev5276 type=peer host=sip1.voipbuster.com disallow=all allow=alaw allow=ulaw allow=gsm context=outbound nat=never qualify=yes dtmfmode=rfc2833

My extenssion.conf file :

[code]; extensions.conf - the Asterisk dial plan
;
[general]
static=yes
writeprotect=no
clearglobalvars=no
;
[globals]
CONSOLE=Console/dsp ;CONSOLE=DAHDI/1
;CONSOLE=Phone/phone0
IAXINFO=guest ;username/password
;IAXINFO=myuser:mypass
TRUNK=synergiec1 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
TRUNK=IAX2/synergiec1:tzkev5276@voipbuster.com
;
[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)
;
[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 => _XX!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XX
X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXX!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXX
X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXXX!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXXX
X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXXXXXXXXXX!,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-)})
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)})
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)
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1)
exten => stdexten-NOANSWER,1,Voicemail(${mbx},u)
exten => stdexten-NOANSWER,n,Return()
exten => stdexten-BUSY,1,Voicemail(${mbx},b)
exten => stdexten-BUSY,n,Return()
exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1)
exten => a,1,VoicemailMain(${mbx})
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)
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1)

exten => stdexten-NOANSWER,1,Voicemail(${mbx},u)
exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER)
exten => stdexten-NOANSWER,n,Return()

exten => stdexten-BUSY,1,Voicemail(${mbx},b)
exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY)
exten => stdexten-BUSY,n,Return()
exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1)
exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1)
exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1)

exten => a,1,VoicemailMain(${mbx})
exten => a,n,Return
;
[macro-page];
exten => s,1,ChanIsAvail(${ARG1},s) ; s is for ANY call
exten => s,n,GoToIf($[${AVAILSTATUS} = “1”]?autoanswer:fail)
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
;
[page]
exten => _X.,1,Macro(page,SIP/${EXTEN})
;
[default]
include => internal
include => local
include => voipbuster
exten => _0.,1,Dial(SIP/${TRUNK}/${EXTEN:1})
exten = s,1,NoOp(Appel Entrant)
exten = s,n,Set(CALLERID(name)=Autre)
exten = s/_0032XX.,n,Set(CALLERID(name)=Belgique)
exten = s/_0041XX.,n,Set(CALLERID(name)=Suisse)
exten = s/_0033XX.,n,Set(CALLERID(name)=France)
exten = s,n,Dial(SIP/Support)
exten = s/_XXXX,1,Dial(SIP/${EXTEN})
exten = s/_XXXXXXXXXXXX,1,Dial(SIP/${EXTEN})
exten = s/_XXXXXXXXXXXXX,1,Dial(SIP/${EXTEN})
exten = s/_XXXXXXXXXXXXX,1,Dial(SIP/${EXTEN})
exten = s/_003222167013,1,Dial(SIP/${EXTEN})
;
[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()
;
[interne]
exten => XXXX,1,Dial(SIP/1000)
exten => XXXX,1,Dial(SIP/1001)
exten => 1000,1,Dial(SIP/1000)
exten => 1001,1,Dial(SIP/1001)
exten => _.,1,Dial(SIP/${EXTEN}@outbound)
exten => _.,2,Hangup
;
[outbound]
exten => _.,1,Goto(moncontexte,100,1)
exten => 32XXXXXXXXX,1,Goto(moncontexte,300,1)
exten => 32XXXXXXXXX,1,Goto(moncontexte,400,1)
exten => 32XXXXXXXXX,1,Goto(moncontexte,500,1)
exten => 32XXXXXXXXX,1,Goto(moncontexte,900,1)[/code]

First
you didn’t removed your voipbuster-credentials…
Change them before someone starts using your account! Really do that now!

Second

[quote][interne]
exten => XXXX,1,Dial(SIP/1000)
exten => XXXX,1,Dial(SIP/1001)
[/quote]
your pattern doesn’t start with an _. So it is not an valid expression
Second: even if it was a valid expression, the result is unsure. Because you have two identical expression. How must asterisk decide which it will use?

OK

Don’t use _., use _X. instead. Now the special extensions as timeout,hangup etc are covered too.

same for the outbound calls: expressions always start with an _.
You could use
_+32.,1,Goto(whatever)
_032.,1,Goto(whatever)
or _Z.,1,Goto(whatever) for calls inside Belgium

I m a Belgian too, you can pm me if you want.

I’m testing.

If I understand, it’s so ?

For my extenssions.conf files :

[default]
include  => interne
include  => outbound
exten => _XXXX,1,Dial(SIP/{EXTEN})
;
[interne]
exten => _.100X,1,Dial(SIP/${EXTEN})
exten => _.100X,n,Hangup()
exten => _X.,1,Dial(SIP/${EXTEN}@outbound)
exten => _X.,2,Hangup
;
[outbound]
exten => _Z.,1,Goto(interne,100,1)[/code]

Now if I call the extenssion 1000 with the 1001 account, i have this error

[code]  == Using SIP RTP CoS mark 5
    -- Executing [1000@interne:1] Dial("SIP/1001-00000028", "SIP/1000") in new stack
[Jun  1 01:34:56] WARNING[28159]: app_dial.c:2218 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Unknown)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [1000@interne:2] Hangup("SIP/1001-00000028", "") in new stack
  == Spawn extension (interne, 1000, 2) exited non-zero on 'SIP/1001-00000028'
liberty-chat*CLI>

Thanks in advance.

“.” is only allowed at the end of patterns.

You don’t have an “outbound” section in your sip.conf, and I rather suspect that you didn’t understand the syntax of SIP device addresses.

How can I do ?

Can you help me please ?

Thanks