Pls help, Can't find the answer anywhere!(about IAX / SIP)

Hi all,

Does someone pls help me with this?!
I have a standard install of Asterisk. Setup some extensions, and can call from IAX2/1000 to IAX2/1001 and from SIP/1002 to SIP/1003.

What and where do i configure something if i want to call from IAX2/1000 to SIP/1003 and reversed???

Please help me with this issue!!

Lots of thanks in advance!
Onno.

When you created these extensions did you create them in the same context ?

this would be done in extensions.conf see link

voip-info.org/wiki/view/Aste … sions.conf

[quote=“rusty”]this would be done in extensions.conf see link

voip-info.org/wiki/view/Aste … sions.conf[/quote]
Could you please point me into the exact location? Because I read it twice now, and still haven’t find the part where I can find how I configure Asterisk so I can call from an SIP extension to an IAX2 extension.

Thanks again.
Onno.

post relevant parts of your sip, iax, and extensions.conf files

Since it’s a complete fresh installation, there’s nothing special.

[code]IAX.CONF
; Inter-Asterisk eXchange driver definition
;

[general]

bindaddr=192.168.0.231 ; more than once to bind to multiple
bindaddr=PublicAddress
; ; addresses, but the first will be the
; ; default
;

bandwidth=medium

disallow=lpc10 ; Icky sound quality… Mr. Roboto.
allow=gsm ; Always allow GSM, it’s cool :slight_smile:

jitterbuffer=no
forcejitterbuffer=no

tos=lowdelay

autokill=yes

[guest]
type=user
context=default
callerid=“Guest IAX User”

;
; Trust Caller*ID Coming from iaxtel.com
;
[iaxtel]
type=user
context=default
auth=rsa
inkeys=iaxtel

;
; Trust Caller*ID Coming from iax.fwdnet.net
;
[iaxfwd]
type=user
context=default
auth=rsa
inkeys=freeworlddialup

[demo]
type=peer
username=asterisk
secret=supersecret
host=216.207.245.47

[user1]
type=friend
host=dynamic
regexten=1000
secret=pw1
context=default
permit=0.0.0.0/0.0.0.0

[user2]
type=friend
host=dynamic
regexten=1001
secret=pw2
context=default
permit=0.0.0.0/0.0.0.0

[user3]
type=friend
host=dynamic
regexten=1002
secret=pw3
context=default
permit=0.0.0.0/0.0.0.0[/code]

[code]SIP.CONF
;
; SIP Configuration example for Asterisk
;

[general]
context=sip

bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the
; ability to place SIP calls based on domain
; names to some other SIP users on the Internet

[authentication]

[user1]
type=friend
secret=pw1
host=dynamic
dtmfmode=inband ; Choices are inband, rfc2833, or info
defaultip=192.168.0.52
mailbox=1000 ; Mailbox for message waiting indicator
disallow=all
allow=ulaw ; since we chose ‘inband’ for dtmf we must use g.711
allow=alaw

[user2]
type=friend
secret=pw2
host=dynamic
dtmfmode=inband ; Choices are inband, rfc2833, or info
defaultip=192.168.0.51
mailbox=1001 ; Mailbox for message waiting indicator
disallow=all
allow=ulaw ; since we chose ‘inband’ for dtmf we must use g.711
allow=alaw

[test]
type=friend
secret=test
host=dynamic
dtmfmode=inband ; Choices are inband, rfc2833, or info
mailbox=1003 ; Mailbox for message waiting indicator
disallow=all
allow=ulaw ; since we chose ‘inband’ for dtmf we must use g.711
allow=alaw
[/code]

[code]EXTENSIONS.CONF
;
; Static extension configuration file, used by
; the pbx_config module. This is where you configure all your
; inbound and outbound calls in Asterisk.
;

[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no

[globals]
CONSOLE=Console/dsp ; Console interface for demo
IAXINFO=guest ; IAXtel username/password
TRUNK=Zap/g2 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)

[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/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel)

[iaxprovider]

[trunkint]
exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
exten => _9011.,n,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}})

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

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

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

[international]
ignorepat => 9
include => longdistance
include => trunkint

[longdistance]
ignorepat => 9
include => local
include => trunkld

[local]
ignorepat => 9
include => default
include => parkedcalls
include => trunklocal
include => iaxtel700
include => trunktollfree
include => iaxprovider

[macro-stdexten];
exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start

exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start

exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer

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

[macro-stdPrivacyexten];
exten => s,1,Dial(${ARG2},20|p) ; Ring the interface, 20 seconds maximum, call screening option (or use P for databased call screening)
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start

exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start

exten => s-DONTCALL,1,Goto(${ARG3},s,1) ; Callee chose to send this call to a polite “Don’t call again” script.

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

exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer

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

[demo]
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…”
; (but skip if channel is not up)
exten => 1234,n,Macro(stdexten,1234,${CONSOLE})

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

exten => 1236,1,Dial(Console/dsp) ; Ring forever
exten => 1236,n,Voicemail(u1234) ; 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@misery.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 => 8500,1,VoicemailMain
exten => 8500,n,Goto(s,6)

[default]
include => demo

exten => 1000,1, Dial(IAX2/user1,10,t)
exten => 1001,1, Dial(IAX2/user2,10,t)
exten => 1002,1, Dial(IAX2/user3,10,t)
exten => 1003,1, Dial(SIP/test,10,t)

[sip]
include => demo
exten => 1000,1, Dial(SIP/user1,10,t)
exten => 1001,1, Dial(SIP/user2,10,t)
exten => 1002,1, Dial(SIP/user3,10,t)
[/code]

lets try this

in sip.conf change

context=default

Then in default context in extensions.conf do this

exten => 1000,1, Dial(IAX2/user1,10,t)
exten => 1001,1, Dial(IAX2/user2,10,t)
exten => 1002,1, Dial(IAX2/user3,10,t)
exten => 1003,1, Dial(SIP/user1,10,t)
exten => 1004,1, Dial(SIP/user2,10,t)
exten => 1005,1, Dial(SIP/user3,10,t)
exten => 1006,1, Dial(SIP/test,10,t)
include => demo

then restart asterisk

watch the cli to see if you get any errors

awesome! That was just it.
But now ofcourse the following question, is it also possible to link the same extension to the different ‘protocols’?
So when user1 (IAX2) is logged in though SIP, that people still can call him under the ‘IAX2’-extension.

Thank you VERY much for your (easy) answer!
Onno.

there are several way to go about forwarding calls to another device couple examples

exten => 1000,1, Dial(IAX2/user1&Sip/user1) This would ring both phones

exten => 1000,1, Dial(IAX2/user1,20) ring iax2 then go to sip user
exten => 1000,2,Dial(Sip/user1,20)
exten => 1000,3,Hangup

another example here

voip-info.org/wiki/view/Aste … +follow+me

You’re the best Rusty!
Kindly thank you for your information!
These small samples give me lots of info on how Asterisk is handling calls.

Onno.

[quote=“rusty”]there are several way to go about forwarding calls to another device couple examples

exten => 1000,1, Dial(IAX2/user1&Sip/user1) This would ring both phones

exten => 1000,1, Dial(IAX2/user1,20) ring iax2 then go to sip user
exten => 1000,2,Dial(Sip/user1,20)
exten => 1000,3,Hangup

another example here

voip-info.org/wiki/view/Aste … +follow+me[/quote]