Hi!!!
thanks for your reply.
I’m using:
asterisk*CLI> core show version
Asterisk 14.2.1 built by root @ asterisk on a x86_64 running Linux on 2017-01-11 14:44:21 UTC
I’m using softphones and a Grandstream set GXP1405.
On sip.conf:
[general]
context=public ; Default context for incoming calls. Defaults to 'default’
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
tcpenable=no ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
transport=udp ; Set the default transports. The order determines the primary default transport.
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
qualify=yes
canreinvite=no
[ext7000]
type=friend
context=National_Access
callerid="Mister X"
Callgroup=1
pickupgroup=1
allow=alaw,ulaw
secret=12345678
host=dynamic
[ext7001]
type=friend
context=National_Access
callerid="Lady Y"
Callgroup=1
pickupgroup=1
allow=alaw,ulaw
secret=12345678
host=dynamic
On extensions.conf:
[phones]
exten => 7000,1,NoOp(a marcar…)
same => n,Macro(standardextensiondial,7000,SIP/ext7000) ; SIP connection
exten => 7001,1,NoOp(a marcar…)
same => n,Macro(standardextensiondial,7001,SIP/ext7001) ; SIP connection
[macro-standardextensiondial]
;
; Standard extension macro (with call forwarding):
; ${ARG2} - Device(s) to ring
; ${temp} = cfw target
; ${ARG1} = calling extension
;
;Check if CFW is configured
exten => s,1,Set(temp=${DB(CFW_ALL/${ARG1})}) ; Get CFW_ALL key, if not existing, goto next line
same => n,NoOp(CheckCallForward)
same => n,GotoIf(${temp}?:Check-BusyFWD,1)
same => n,NoOp(CallForwardActivated)
same => n,GotoIf($["${temp}"="${CALLERID(num):3}"]?No-Forward,1); if cfw target and calling are equal then allow to dial the source extension
same => n,Dial(Local/${temp}@phones,240) ; Unconditional forward
same => n,Hangup
;Check if CFW_BUSY is configured
exten => Check-BusyFWD,1,NoOp(CheckBusyFWD)
same => n,NoOp(CheckCallForwardBusy)
same => n,Set(temp=${DB(CFW_BUSY/${ARG1})}) ; Get CFW_BUSY key, if not existing, goto 105
same => n,GotoIf(${temp}?:Check-noanFWD,1)
same => n,NoOp(Busy CallForwardActivated)
same => n,Dial(Local/${temp}@phones/n) ; Forward on busy or unavailable
same => n,Hangup
;Check if CFW_NOAN is configured
exten => Check-noanFWD,1,NoOp(ChecknoanFWD)
same => n,NoOp(CheckCallForwardNoan)
same => n,Set(temp=${DB(CFW_NOAN/${ARG1})}) ; Get CFW_NOAN key, if not existing, goto 105
same => n,GotoIf(${temp}?:No-Forward,1)
same => n,NoOp(noan CallForwardActivated)
same => n,Set(CALLERID(num)=${CALLERID(num):3});gets the caller ID and removes the ext to present the correct CLID
same => n,Dial(${ARG2},20) ;dial first the estension then
same => n,Dial(Local/${temp}@phones,240) ; Forward on noan
same => n,Hangup
; No CFW key so dial the extension
exten => No-Forward,1,NoOp(Dial extension)
same => n,Set(CALLERID(num)=${CALLERID(num):3});gets the caller ID and removes the ext to present the correct CLID
same => n,Dial(${ARG2},240) ; 240sec timeout
same => n,Hangup
[Emergency]
exten => 112,1,Goto(outgoing,${EXTEN},1)
exten => _0112,1,Goto(outgoing,${EXTEN:1},1)
[Internal_Access]
include => Emergency
exten => _*[1-9].,1,Goto(phones,${EXTEN},1);features
exten => _#.,1,Goto(phones,${EXTEN},1);features
exten => _XXXX,1,Goto(phones,${EXTEN},1);internal extensions
exten => _*01XXXX,1,Goto(features,${EXTEN},1) ; callforward to external numbers
exten => _[Ee][x][t]X.,1,Goto(phones,${EXTEN:3},1);internal extensions
[Local_Access]
include => Emergency
include => Internal_Access
exten => _022.,1,Goto(outgoing,${EXTEN:1},1)
exten => _*01022.,1,Goto(features,${EXTEN},1) ; callforward to external numbers
exten => _*02022.,1,Goto(features,${EXTEN},1) ; callforward to external numbers
exten => _*03022.,1,Goto(features,${EXTEN},1) ; callforward to external numbers
[National_Access]
include => Emergency
include => Internal_Access
include => Local_Access
exten => _0[1-9].,1,Goto(outgoing,${EXTEN:1},1)
exten => _*010[1-9].,1,Goto(features,${EXTEN},1) ; callforward to external numbers
exten => _*020[1-9].,1,Goto(features,${EXTEN},1) ; callforward to external numbers
exten => _*030[1-9].,1,Goto(features,${EXTEN},1) ; callforward to external numbers
[International_Access]
include => Emergency
include => Internal_Access
include => Local_Access
include => National_Access
exten => _000.,1,Goto(outgoing,${EXTEN:1},1)
exten => _*01000.,1,Goto(features,${EXTEN},1) ; callforward to external numbers
exten => _*02000.,1,Goto(features,${EXTEN},1) ; callforward to external numbers
exten => _*03000.,1,Goto(features,${EXTEN},1) ; callforward to external numbers
Best Regards,
Jose