>> allow=ulaw >Why don't you remove this?Because I need some other users to be able to call out using ULAW over the same PSTN gateway... -Manuel ___________________________________________________ Ticinocom SA - Via Stazione 5 - 6600 Muralto Tel 0844 007070 - Fax 0844 007071 http://www.ticinocom.com
Define that per user. Isamar On Thu, 24 Jun 2004, Manuel Wenger wrote:> >> allow=ulaw > >Why don't you remove this? > > Because I need some other users to be able to call out using ULAW over the same PSTN gateway... > > -Manuel > > > ___________________________________________________ > Ticinocom SA - Via Stazione 5 - 6600 Muralto > Tel 0844 007070 - Fax 0844 007071 > http://www.ticinocom.com > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
>Try to configure in sip.conf your extensions context like this: > >[XXX] >.... >disallow=all >allow=g729 >....Done that already: but then, the "incoming channel" (from the user to Asterisk) is G729, and the "outgoing channel" (from Asterisk to the PSTN gateway) still remains ULAW, so Asterisk has to do transcoding (ULAW to G729), which I don't want, obviously. For some reason, the outgoing channel doesn't follow the setvar(SIP_CODEC=g729) rule. -Manuel ___________________________________________________ Ticinocom SA - Via Stazione 5 - 6600 Muralto Tel 0844 007070 - Fax 0844 007071 http://www.ticinocom.com
> Did you try having two sip.conf entries for your gateway? Forcing one > with G729 and the other with ulaw? You would obviously need to change > your dialplan accordingly and have each phone configured so that it > would take the proper extension. I have not tried this, it is just > really an idea...That's actually a very good idea, and I have tried it: for outgoing calls it works like charm. But then the problem is transferred to incoming calls (from the gateway->asterisk->SIP client). Because the gateway now has 2 entries, asterisk is confused about what codec it has to use for incoming calls, and for some reason I can't force it, because the 2 entries have the same IP. I'm starting to think that I won't be able to solve that myself, but that someone will have to program something for this to work... But if I'm the only one having this kind of request, I'm not too optimistic -Manuel ___________________________________________________ Ticinocom SA - Via Stazione 5 - 6600 Muralto Tel 0844 007070 - Fax 0844 007071 http://www.ticinocom.com
> Hmmm, I was thinking about this problem too... What type of gateway are > you using? Is it registering with the Asterisk server? I would try using > two different 'virtual' extensions on the gateway and in sip.conf. That > way you would have full control on how calls from the gw to * are handled.I had thought about that, too ... Unfortunately the gateway is unable to register. We authenticate based on the IP address only. Otherwise, like you say, I could have 2 "virtual" extensions, but with IP only this is not possible. Maybe I will find a solution by sleeping over the problem (not physically, that is) tonight :-) -Manuel ___________________________________________________ Ticinocom SA - Via Stazione 5 - 6600 Muralto Tel 0844 007070 - Fax 0844 007071 http://www.ticinocom.com
>They don't need to have the same IP. Assign several IP numbers to your >linux box: > >ifconfig eth0:1 10.1.1.1 netmask 255.255.255.0 >ifconfig eth0:2 10.1.1.2 netmask 255.255.255.0Sorry guys... These are all great tips, but also this doesn't work: the gateway is not under my control, it is actually a real phone switch, which isn't owned by us. Unfortunately I can't tell them to add a second IP ... :-) -Manuel ___________________________________________________ Ticinocom SA - Via Stazione 5 - 6600 Muralto Tel 0844 007070 - Fax 0844 007071 http://www.ticinocom.com
> Use two separate entries with type=peer and type=user instead of one > entry with type=friend.Tried that as well. This triggers yet another misbehaviour... I tried to define 2 peers (for the outgoing calls), one called [gateway-g729] and one called [gateway-ulaw], each allowing only the codec specified in the name. Then I defined 1 "user" for incoming calls from the gateway (called [gateway-in]), with both g729 and ulaw in the allow list. And you know what happens? Outgoing calls are now fine (I can direct them either to @gateway-g729 or @gateway-ulaw in the Dial() command), but incoming calls seem to have a live on their own, and choose whatever codec they prefer. Even if I setvar(SIP_CODEC=ulaw), the gateway-to-asterisk channel seems to remain in g729 (at least that's what I can tell from "show g729" - because "sip show channels" looks correct, both ULAW). At some point I get that message: Jun 24 16:37:14 NOTICE[1104739248]: chan_sip.c:1314 sip_answer: Changing codec to 'ulaw' for this call because of ${SIP_CODEC) variable And yes, in "sip show channels" the gateway-to-asterisk channel is marked as ULAW, but for some reason a G729 license is used up, because the call did start in G729... Any ideas? I guess I'm very close to the solution, but now G729 licenses are acting weird and are being used even in ULAW-to-ULAW calls which started with G729 in the beginning... -Manuel ___________________________________________________ Ticinocom SA - Via Stazione 5 - 6600 Muralto Tel 0844 007070 - Fax 0844 007071 http://www.ticinocom.com