2

I have a Small and basic PBX, and with two contexts wich basicly are sales and supervisor both have different roles and privileges. I notice that it is possible to transfer call from the same context but it have been imposible to transfer anything to another context.

Any insight, i am kinda a rookie on asterisk but currently there is no one else in charge...

Thanks

Edit

This is the extension.conf

[supervisor]
include => from-internal
exten => _40XX,1,Answer
exten => _40XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _40XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _40XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _40XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _40XX,n,Hangup

[sales]
include => out-trunksip
exten => _41XX,1,Answer
exten => _41XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _41XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _41XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _41XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _41XX,n,Hangup

and the sip.conf looks like this:

[supervisor]
username=sales
secret=ASUPERSECRETPASSWORD
type=peer
.....
context=supervisor
mailbox=supervisor

[sales]
username=sales
secret=ASUPERSECRETPASSWORD
type=peer
.....
context=sales
mailbox=sales

What do you suggest in order to get the supervisor with the same privileges that he already has and the sales been able to transfer calls to him

2
  • Post your config. You need to include both sales supervisor extensions into both contexts
    – Steven
    Commented May 6, 2011 at 0:51
  • Questions already been answered (users can only dial extensions in their own context) but I'll just add how I do it. I.e, I usually have a separate context for 'internal' containing all the user extensions. Then I can simply create a context for each group (sales/support/supervisors/whatever), and add 'include => internal'.
    – USD Matt
    Commented Nov 26, 2012 at 10:10

1 Answer 1

5

when you transfer the calls, asterisk will search for the extension in your current context so if someone calls using "sales" he will be able to transfer only to extensions 41XX, if you want to let him transfer to extensions 40XX then you should add 40XX to sales context, example:

[sales]
include => out-trunksip
exten => _41XX,1,Answer
exten => _41XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _41XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _41XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _41XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _41XX,n,Hangup

exten => _40XX,1,Dial(SIP/${EXTEN},40,TtRr)

(you can also include supervisor context in your sales context)

If you want to prevent sales users from calling supervisor users and viceversa but still allow them to transfer calls to each other then you can solve it this way:

create a new context designated only for call transfers where you provide extensions which should be reachale when transfering a call, example:

[call-transfer]
 exten => _40XX,1,Dial(SIP/${EXTEN},40,TtRr)
 exten => _41XX,1,Dial(SIP/${EXTEN},40,TtRr)

Then set __TRANSFER_CONTEXT=call-transfer:

[supervisor]
include => from-internal
exten => _40XX,1,Answer
exten => _40XX,n,Set(__TRANSFER_CONTEXT=call-transfer)
exten => _40XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _40XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _40XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _40XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _40XX,n,Hangup

[sales]
include => out-trunksip
exten => _41XX,1,Answer
exten => _40XX,n,Set(__TRANSFER_CONTEXT=call-transfer)
exten => _41XX,n,Set(calltime=${STRFTIME(${EPOCH},,%C%y%m%d.%H.%M.%S)})
exten => _41XX,n,Set(CALLEDNUMBER=${EXTEN})
exten => _41XX,n,MixMonitor(/tmp/Para_${CALLEDNUMBER}-${calltime}-De_${CALLERID(num)}.wav)
exten => _41XX,n,Dial(SIP/${EXTEN},40,TtRr)
exten => _41XX,n,Hangup

I'm just not sure if __TRANSFER_CONTEXT is still present in new asterisk versions :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .