Both sides work using these setting. Using G729 codec is the key, it is not bundled with the stock Trixbox or Asterisk and must be acquired sepreately. Without the g729 codec there is a problem with incoming getting dropped was due to the fact that brain seems to only support g729 for incoming calls. And Asterisk also seems to be very particular about codec order.
I only have experience with Trixbox so these instructions are from my settings.
1. Get your Trixbox working with any other provider and make sure you can make outgoing calls and have incoming calls working.
2. Go to this thread
http://www.trixbox.org/modules/newbb/viewtopic.php?topic_id=1725&forum=2#forumpost10916 http://www.trixbox.org/modules/newbb/viewtopic.php?topic_id=1725&forum=2#forumpost10916
and follow the instructions and install the g729 codec; make sure you get the correct codec for your processor in step 5, to check for the correct codec go to
Index of /pub/Linux/Asterisk and locate the correct one for your processor ... I am running the latest (as of Sept 9, 2006 )Trixbox 1.1.1 which uses Asterisk 1.2.9.1 and I got the codec from this dir
Index of /pub/Linux/Asterisk/built-for-asterisk-1.2-untested
The thing to remember is that these are open source codecs but you should still buy a licence from Digium but don't install it because there is compatiblity issue with Asterisk 1.2.9.1 and the Digium g729 - This is so you are legal.
3. From the main Trixbox Admin page click on Config Edit and then edit sip.conf file look for lines in the [General] section that look like this
disallow=all
allow=ulaw
allow=alaw
Add allow=g729 immedieatly following disallow=all. So now they should look like this: Remember this has to be the first allow line, becuase this determines the codec order in SIP negotiations
disallow=all
allow=g729
allow=ulaw
allow=alaw
4. Save and re-read your config
5. Replace 210XXXX with your braintel number and YYYY with your password in the following settings
Now go to FreePBX and add a new SIP Trunk with the following settings:
Outbound Caller ID: 210XXXX
Trunk Name: Brain
PEER Details:
username=210XXXX
type=peer
secret=YYYY
qualify=yes
progressinband=yes
port=8891
nat=yes
insecure=very
host=chat.brain.net.pk
fromuser=210XXXX
fromdomain=chat.brain.net.pk:8891
dtmfmode=rfc2833
disallow=all
context=from-trunk
canreinvite=no
authname=210XXXX
auth=md5
allow=g729
Leave User Context, and User Details blank, delete default stuff in User Details if you have to.
Registration String :
210XXXX:YYYY:210XXXX@Brain/210XXXX
Make sure the string after the @ matches the Trunk name there is bug in Trixbox that makes it reject @chat.brain.net.pk:8891 in the registration string by saying @Brain you are telling Asterisk to register using the info in the 'Brain' section.
That is it.
Save the settings reload asterisk by clicking on the red bar. make sure you go to the Asterisk info and verify whether you are succesfully registering with Brain.