Lync Asterisk 10 seconds

Hi Everybody,
I’ve created with Asterisk 1.8 two SIP Trunk: one from Lync and other one for Voip.

Everything is fine but if I call from external phone to mine Voip number, Asterik forward the call to Lync account, the person answer and after 10 second I can talk with him.

Maybe I had make some mistakes but I can’t understand where the mistakes are.

Follow the configuration about Asterisk:

[Lync]
host= #IP FrontEnd
type=friend
port=5060
transport=tcp,udp
allow=ulaw,alaw,gsm
insecure=port,invite
qualify=yes
context=from-lync
canreinvite=yes

[Voip]
allow=gsm,alaw,ulaw
dtmfmode=rfc2833
host= #IP Voip Operator
insecure=port,invite
type=friend
qualify=yes
transport=tcp,udp
context=from-twt
fromdomain= #external public Ip

I need help!!

You did this in FreePBX?

Yes I did. I’ve created the Context Lync e Voip in FreePBX.

There’s a problem into context?

How did you create this context? I am lost, did you put the SIP peers in sip_custom as above? If so why, should be in trunk module.

Also, where do the from-lync and from-twt get declared?

Sorry I’ve wrote wrong before.

Voip and Lync are trunk not context and I’ve write that into sip_additional.

Also the contexts from-twt and from-lync on my hand.

Follow the context

[from-lync]
exten=>+.,1,Set(CALLERID(num)=${CALLERID(num):3:10})
exten=>
+.,n,Dial(SIP/Voip/${EXTEN:3:10},100,tT)

[from-twt]
exten=>0.,1,Progress()
exten=>0.,n,Set(CALLERID(num)=+39${CALLERID(num)})
exten=>
.,n,Dial(SIP/Lync/+39${EXTEN},120,tr)
exten=>
.,n,Hangup()

You are not supposed to modify sip_additional, did you not see the warning at the top of the file?

These go in sip_custom.conf. Also you can use the CallerID module to modify the digits as you are doing in your code. Your code bypasses FreePBX so you lose all features.

Why are you not using trunk module in FreePBX.

The first step it was to create the trunk from module in FreePBX, then, when I was sure that all is done, I’ve modify some variabile on my hands.

I am very sorry, but your English is so poor I don’t think we are communicating.

That’s right… I’m not English.

So restart to begin.
Step 1st. Becuase I’ve ever see Asterisk, I had create trunks with module FreePBX.

Step 2nd. When I had some skill, I modify trunks and contexts into sip_additional.conf. So I had learn more than using module.