Ok so I bought 30 G729 licenses for my box they are installed property and seem to be working. For some reason every sip call is using ulaw as the codec no matter what I put in extensions.conf or sip.conf . At the end of the log you will see it gets rejected for not coming in G729. I had the provider do this to aid in testing. once I know the calls go thru its working.
here are the configs:
Verbosity is at least 21
dialer*CLI> show g729
0/0 encoders/decoders of 30 licensed channels are currently in use
dialer*CLI>
sip.conf:
[SIPtrunk]
disallow=all
allow=g729
allow=gsm
allow=g723
host=69.42.117.220
type=friend
canreinvite=no
dtmf=rfc2833
extensions.conf: (I added the setvar line after all else failed, still didn't work)
; dial a long distance outbound number
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls
exten => _9NXXNXXXXXX,1,setvar(SIP_CODEC=g729)
exten => _9NXXNXXXXXX,2,AGI(
agi://127.0.0.1:4577/call_log)
exten => _9NXXNXXXXXX,3,Dial(${TRUNK}/${EXTEN:1},,To)
exten => _9NXXNXXXXXX,4,Hangup
; local area code
exten => _91305NXXXXXX,1,setvar(SIP_CODEC=g729)
exten => _91305NXXXXXX,2,AGI(
agi://127.0.0.1:4577/call_log)
exten => _91305NXXXXXX,3,Dial(${TRUNK}/${EXTEN:2},,To)
exten => _91305NXXXXXX,4,Hangup
; local area code
exten => _91786NXXXXXX,1,setvar(SIP_CODEC=g729)
exten => _91786NXXXXXX,2,AGI(
agi://127.0.0.1:4577/call_log)
exten => _91786NXXXXXX,3,Dial(${TRUNK}/${EXTEN:2},,To)
exten => _91786NXXXXXX,4,Hangup
logs from an actual call:
== Parsing '/etc/asterisk/manager.conf': Found
== Manager 'sendcron' logged on from 127.0.0.1
-- Executing SetVar("Local/98174415815@default-900d,2", "SIP_CODEC=g729") in new stack
-- Executing AGI("Local/98174415815@default-900d,2", "agi://127.0.0.1:4577/call_log") in new stack
-- AGI Script
agi://127.0.0.1:4577/call_log completed, returning 0
-- Executing Dial("Local/98174415815@default-900d,2", "SIP/69.42.117.220/8174415815||To") in new stack
We're at 192.168.3.53 port 11472
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
13 headers, 12 lines
Reliably Transmitting (no NAT) to 69.42.117.220:5060:
INVITE sip:8174415815@69.42.117.220 SIP/2.0
Via: SIP/2.0/UDP 192.168.3.53:5060;branch=z9hG4bK22f0a5ab;rport
From: "V1210155907000153156" <sip:8882738205@192.168.3.53>;tag=as50bd6ac5
To: <sip:8174415815@69.42.117.220>
Contact: <sip:8882738205@192.168.3.53>
Call-ID:
6baf5870300f94a45998dfb43c2a65ca@192.168.3.53
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Wed, 10 Dec 2008 20:59:09 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 261
v=0
o=root 2352 2352 IN IP4 192.168.3.53
s=session
c=IN IP4 192.168.3.53
t=0 0
m=audio 11472 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
---
-- Called 69.42.117.220/8174415815
dialer*CLI>
<-- SIP read from 69.42.117.220:5060:
SIP/2.0 488 Not acceptable here
Via: SIP/2.0/UDP 192.168.3.53:5060;branch=z9hG4bK54c99972;received=192.168.3.53;rport=5060
From: "V1210155907000153154" <sip:8882738205@192.168.3.53>;tag=as0a5af41b
To: <sip:8173417543@69.42.117.220>;tag=as361e1966
Call-ID:
05174fbf6fc9059e403243167f11d6c4@192.168.3.53
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0
--- (10 headers 0 lines) ---