[Asterisk-Dev] SIP media negotiation problem

Steven Critchfield critch at basesys.com
Tue Nov 29 09:43:52 MST 2005


On Tue, 2005-11-29 at 07:08 -0800, anthony thomas wrote:
>  
>     Hello all,
> 
>     We are facing a problem trying to pass faxes between two gateways
> configured this way (we have tested with Quintum and Cisco gws):
> 
>     GW1 -------> Asterisk (1.2)-------> GW2
> 
>     Both gateways and asterisk support g729 and g711, we want to use
> g729 for voice and fallback to g711 when a fax is detected.
> 
>     The call goes like this:
> 
>     - GW1 initiates the call using g729 (at this time, no one knows
> that the call is a fax)
> 
>     - Once the call is answered, GW2 detects a fax tone, it sends an
> INVITE to * to change the media to g711, Asterisk relies the INVITE
> correctly to GW2 and GW2 switches to g711, the problem seems to be
> that * replays to the INVITE coming from GW2 with an OK with codec
> g729 as prefered codec, this fools GW2 and chooses g729 again.
> 
>     The codec that Asterisk uses in the OK seems to be the codec sent
> by GW1 when the call was established instead of sending the codec that
> GW2 sent in the (RE)INVITE.
> 
>     Can anyone comment if this is a bug or simply we are
> missunderstanding something?

Let me state that I do not like SIP and don't use it. I am stating
opinions below based on my limited understanding. Others should chime in
to help further.

It would seem to me that Asterisk is behaving in the appropriate manner
for the information it has in hand. Asterisk should try it's best to not
transcode if possible. 

With asterisk in the middle, it is bridging 2 calls, GW1 to asterisk and
asterisk to GW2. Without asterisk getting out of the way of the call, it
is probably going to leave the first leg alone and deal with whatever it
can in the second leg. I doubt you would get end to end G711 while going
through asterisk if the first leg is brought up as G729. 

It may not be the desired effect, but you might want to look at either
allowing GW1 and GW2 connect to each other directly to negotiate the
G711, or drop trying to do faxing over IP.

-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-dev mailing list