Asterisk Agent Login

Hi Friends,
Thanks in advance

I have the following configuration in my asterisk server,

agents.conf:

agent => 1001,1234,AAA
agent => 1002,4321,BBB

sip.conf
[111]

context=sip-call

[222]


context=agent-call

extensions.conf

[agent-call]
exten=> 2001,1,AgentCallbackLogin(||${CALLERIDNUM}@from-agent)

[sip-call]
exten=> 2020,1,Answer
exten=> 2020,n,Ringing
exten=> 2020,n,Wait(2)
exten=> 2020,n,Queue(MyQueue)
exten=> 2020,n,Hangup

If i make call to 2020 extensions from 111 user , call is queued in MyQueue.

if i make call to 2001 extensions from 222 user , it is not prompting me to enter Agent username and password?How can i login as a Agent? Please help me to fix this problem…

Following output i am seeing in asterisk client for agent show command:

1001 (AAA) not logged in (musiconhold is ‘default’)
1002 (BBB) not logged in (musiconhold is ‘default’)
2 agents configured [0 online , 2 offline]

why are you trying to login using the “from-agent” context when the extension is in context “agent-call”?

try this [which works on my system]:

exten => 2001,1,AgentCallbackLogin(||${CALLERIDNUM}@${CONTEXT})

[quote=“mudslide567”]why are you trying to login using the “from-agent” context when the extension is in context “agent-call”?

try this [which works on my system]:

exten => 2001,1,AgentCallbackLogin(||${CALLERIDNUM}@${CONTEXT})[/quote]

I tried with this but no use… It says following warning

WARNING[31831] chan_sip.c: Maximum retries exceeded on transmission ff4ac30f8363cf61MTllZGVhMDkwMzFlNWVhM2MzNjA1OTdhNWY5NDMwYjQ. for seqno 2 (Non-critical Response)