Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Change codec when dial from SIP to DAHDI


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
tbskyd at gmail.com
Guest





PostPosted: Tue Sep 23, 2014 12:30 pm    Post subject: [asterisk-users] Change codec when dial from SIP to DAHDI Reply with quote

Hi:
I am useing asterisk 11.12.
I use G722 as preferred codec for my ip-phone. and my PSTN DAHDI
use alaw. G722 is great when ip-phone talks to each other. but when
ip-phone dialout to PSTN DAHDI, G722 is not great, since it is need to
transcode to alaw.
so I try to change the codec when dial from SIP to DAHDI. I tried
to use IP_CODEC/SIP_CODEC_OUTBOUND at dialplan. but the SIP codec
change after dahdi answered the channel. so everything is broken. the
call log like below:

[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:2]
Set("SIP/222-00000004", "SIP_CODEC=alaw") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:3]
Set("SIP/222-00000004", "SIP_OUT_CODEC=alaw") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:4]
MacroExit("SIP/222-00000004", "") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:18] GotoIf("SIP/222-00000004",
"0?bypass,1") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:19] ExecIf("SIP/222-00000004",
"1?Set(CONNECTEDLINE(num,i)=0912345678)") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:20] ExecIf("SIP/222-00000004",
"1?Set(CONNECTEDLINE(name,i)=CID:222)") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:21] GotoIf("SIP/222-00000004",
"0?customtrunk") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:22] Dial("SIP/222-00000004",
"DAHDI/g2/0912345678,300,Tt") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] app_dial.c: --
Called DAHDI/g2/0912345678
[2014-09-23 21:18:53] VERBOSE[11634][C-0000000d] app_dial.c: --
DAHDI/2-1 answered SIP/222-00000004
[2014-09-23 21:18:53] NOTICE[11634][C-0000000d] chan_sip.c: Changing
codec to 'alaw' for this call because of ${SIP_CODEC} variable
[2014-09-23 21:18:53] NOTICE[11634][C-0000000d] chan_sip.c: Changing
codec to 'alaw' for this call because of ${SIP_CODEC} variable

if I check channel with "core show channel xxxxx", got DAHDI/SIP
legs final like this:
NativeFormats: (alaw)
WriteFormat: slin
ReadFormat: slin
WriteTranscode: Yes (slin)->(alaw)
ReadTranscode: Yes (alaw)->(slin)

although two legs finally use alaw both, but transcode use slin in
the middle. is it possible to prevent the transcode?

if that is not possible, then maybe I should give up using G722 as
the preffered codec of ip phone. back to G711 seems much easier to
make all legs with the same codec.

thanks a lot for help!!

Regards,
tbskyd

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
tbskyd at gmail.com
Guest





PostPosted: Wed Sep 24, 2014 10:20 pm    Post subject: [asterisk-users] Change codec when dial from SIP to DAHDI Reply with quote

hi:
I Have tried asterisk 1.6.2, 1.8, 11, 12, 13. all versions behave
the same => transcode in the middle even two legs use the same code.

but I found an article which seems to solve this kind of problem:

https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

but I tried version 13 and didn't notice the change, are there new
diaplan commands or channel variables to do this?

thanks a lot for help!!

Regards,
tbskyd




2014-09-24 1:30 GMT+08:00 d tbsky <tbskyd@gmail.com>:
Quote:
Hi:
I am useing asterisk 11.12.
I use G722 as preferred codec for my ip-phone. and my PSTN DAHDI
use alaw. G722 is great when ip-phone talks to each other. but when
ip-phone dialout to PSTN DAHDI, G722 is not great, since it is need to
transcode to alaw.
so I try to change the codec when dial from SIP to DAHDI. I tried
to use IP_CODEC/SIP_CODEC_OUTBOUND at dialplan. but the SIP codec
change after dahdi answered the channel. so everything is broken. the
call log like below:

[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:2]
Set("SIP/222-00000004", "SIP_CODEC=alaw") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:3]
Set("SIP/222-00000004", "SIP_OUT_CODEC=alaw") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:4]
MacroExit("SIP/222-00000004", "") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:18] GotoIf("SIP/222-00000004",
"0?bypass,1") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:19] ExecIf("SIP/222-00000004",
"1?Set(CONNECTEDLINE(num,i)=0912345678)") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:20] ExecIf("SIP/222-00000004",
"1?Set(CONNECTEDLINE(name,i)=CID:222)") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:21] GotoIf("SIP/222-00000004",
"0?customtrunk") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:22] Dial("SIP/222-00000004",
"DAHDI/g2/0912345678,300,Tt") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] app_dial.c: --
Called DAHDI/g2/0912345678
[2014-09-23 21:18:53] VERBOSE[11634][C-0000000d] app_dial.c: --
DAHDI/2-1 answered SIP/222-00000004
[2014-09-23 21:18:53] NOTICE[11634][C-0000000d] chan_sip.c: Changing
codec to 'alaw' for this call because of ${SIP_CODEC} variable
[2014-09-23 21:18:53] NOTICE[11634][C-0000000d] chan_sip.c: Changing
codec to 'alaw' for this call because of ${SIP_CODEC} variable

if I check channel with "core show channel xxxxx", got DAHDI/SIP
legs final like this:
NativeFormats: (alaw)
WriteFormat: slin
ReadFormat: slin
WriteTranscode: Yes (slin)->(alaw)
ReadTranscode: Yes (alaw)->(slin)

although two legs finally use alaw both, but transcode use slin in
the middle. is it possible to prevent the transcode?

if that is not possible, then maybe I should give up using G722 as
the preffered codec of ip phone. back to G711 seems much easier to
make all legs with the same codec.

thanks a lot for help!!

Regards,
tbskyd

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
tbskyd at gmail.com
Guest





PostPosted: Wed Sep 24, 2014 10:21 pm    Post subject: [asterisk-users] Change codec when dial from SIP to DAHDI Reply with quote

hi:
forgot to mention. not only dialout DAHDI, even I dialout SIP
TRUNK, the situation is the same:

asterisk transcode in the middle even two legs use the same code.

2014-09-25 11:20 GMT+08:00 d tbsky <tbskyd@gmail.com>:
Quote:
hi:
I Have tried asterisk 1.6.2, 1.8, 11, 12, 13. all versions behave
the same => transcode in the middle even two legs use the same code.

but I found an article which seems to solve this kind of problem:

https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

but I tried version 13 and didn't notice the change, are there new
diaplan commands or channel variables to do this?

thanks a lot for help!!

Regards,
tbskyd




2014-09-24 1:30 GMT+08:00 d tbsky <tbskyd@gmail.com>:
Quote:
Hi:
I am useing asterisk 11.12.
I use G722 as preferred codec for my ip-phone. and my PSTN DAHDI
use alaw. G722 is great when ip-phone talks to each other. but when
ip-phone dialout to PSTN DAHDI, G722 is not great, since it is need to
transcode to alaw.
so I try to change the codec when dial from SIP to DAHDI. I tried
to use IP_CODEC/SIP_CODEC_OUTBOUND at dialplan. but the SIP codec
change after dahdi answered the channel. so everything is broken. the
call log like below:

[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:2]
Set("SIP/222-00000004", "SIP_CODEC=alaw") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:3]
Set("SIP/222-00000004", "SIP_OUT_CODEC=alaw") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk-predial-hook:4]
MacroExit("SIP/222-00000004", "") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:18] GotoIf("SIP/222-00000004",
"0?bypass,1") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:19] ExecIf("SIP/222-00000004",
"1?Set(CONNECTEDLINE(num,i)=0912345678)") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:20] ExecIf("SIP/222-00000004",
"1?Set(CONNECTEDLINE(name,i)=CID:222)") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:21] GotoIf("SIP/222-00000004",
"0?customtrunk") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] pbx.c: --
Executing [s@macro-dialout-trunk:22] Dial("SIP/222-00000004",
"DAHDI/g2/0912345678,300,Tt") in new stack
[2014-09-23 21:18:46] VERBOSE[11634][C-0000000d] app_dial.c: --
Called DAHDI/g2/0912345678
[2014-09-23 21:18:53] VERBOSE[11634][C-0000000d] app_dial.c: --
DAHDI/2-1 answered SIP/222-00000004
[2014-09-23 21:18:53] NOTICE[11634][C-0000000d] chan_sip.c: Changing
codec to 'alaw' for this call because of ${SIP_CODEC} variable
[2014-09-23 21:18:53] NOTICE[11634][C-0000000d] chan_sip.c: Changing
codec to 'alaw' for this call because of ${SIP_CODEC} variable

if I check channel with "core show channel xxxxx", got DAHDI/SIP
legs final like this:
NativeFormats: (alaw)
WriteFormat: slin
ReadFormat: slin
WriteTranscode: Yes (slin)->(alaw)
ReadTranscode: Yes (alaw)->(slin)

although two legs finally use alaw both, but transcode use slin in
the middle. is it possible to prevent the transcode?

if that is not possible, then maybe I should give up using G722 as
the preffered codec of ip phone. back to G711 seems much easier to
make all legs with the same codec.

thanks a lot for help!!

Regards,
tbskyd

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mjordan at digium.com
Guest





PostPosted: Thu Sep 25, 2014 7:47 am    Post subject: [asterisk-users] Change codec when dial from SIP to DAHDI Reply with quote

On Wed, Sep 24, 2014 at 10:20 PM, d tbsky <tbskyd@gmail.com> wrote:
Quote:
hi:
I Have tried asterisk 1.6.2, 1.8, 11, 12, 13. all versions behave
the same => transcode in the middle even two legs use the same code.

but I found an article which seems to solve this kind of problem:

https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

That article is in the development section of the wiki. While that
doesn't mean any of the information there is necessarily wrong, its
purpose was to coordinate development efforts, not to define behavior
for end-users.

In this particular case, portions of that page only affect chan_pjsip:

{quote}

The Offer/Answer use cases below only apply to chan_pjsip. chan_sip,
for better or worse, has its own fun rules about what codecs are
offered and when.

/* add_sdp: */

/* Now, start adding audio codecs. These are added in this order:
- First what was requested by the calling channel
- Then preferences in order from sip.conf device config for
this peer/user
- Then other codecs in capabilities, including video
*/


Changing chan_sip is fraught with peril. As such, we're going to try
and give the power/flexibility of how things are offered/answered to
where we can better maintain/control the behaviour, which means
chan_pjsip.

{quote}

We worked to make sure that we *didn't* change the offer/answer rules
in chan_sip. The fact that we did a lot work under the hood and things
managed to remain the same was the goal.

chan_pjsip does use a different set of rules for how it offers its
codecs, and should generally follow what it outlined on that wiki
page.

Matt

--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
tbskyd at gmail.com
Guest





PostPosted: Thu Sep 25, 2014 1:57 pm    Post subject: [asterisk-users] Change codec when dial from SIP to DAHDI Reply with quote

2014-09-25 20:46 GMT+08:00 Matthew Jordan <mjordan@digium.com>:
Quote:
Quote:
https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

That article is in the development section of the wiki. While that
doesn't mean any of the information there is necessarily wrong, its
purpose was to coordinate development efforts, not to define behavior
for end-users.

In this particular case, portions of that page only affect chan_pjsip:

thanks a lot for the hint! you really save my day!
I was thinking about studying freeswitch, since people said
freeswitch can do that without transcode. now i will spent my time to
study chan_pjsip, and hope it can fix the problem. i really want to
stay with asterisk Smile

thanks again for your kindly help!!

Regards,
tbskyd

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
EWieling at nyigc.com
Guest





PostPosted: Thu Sep 25, 2014 2:34 pm    Post subject: [asterisk-users] Change codec when dial from SIP to DAHDI Reply with quote

You will find not transcoding much less useful that one might imagine.


-----Original Message-----
From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of d tbsky
Sent: Thursday, September 25, 2014 2:57 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Change codec when dial from SIP to DAHDI

2014-09-25 20:46 GMT+08:00 Matthew Jordan <mjordan@digium.com>:
Quote:
Quote:
https://wiki.asterisk.org/wiki/display/AST/Media+Format+Rewrite

That article is in the development section of the wiki. While that
doesn't mean any of the information there is necessarily wrong, its
purpose was to coordinate development efforts, not to define behavior
for end-users.

In this particular case, portions of that page only affect chan_pjsip:

thanks a lot for the hint! you really save my day!
I was thinking about studying freeswitch, since people said
freeswitch can do that without transcode. now i will spent my time to
study chan_pjsip, and hope it can fix the problem. i really want to
stay with asterisk Smile

thanks again for your kindly help!!

Regards,
tbskyd

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
tbskyd at gmail.com
Guest





PostPosted: Thu Sep 25, 2014 9:22 pm    Post subject: [asterisk-users] Change codec when dial from SIP to DAHDI Reply with quote

2014-09-26 3:34 GMT+08:00 Eric Wieling <EWieling@nyigc.com>:
Quote:
You will find not transcoding much less useful that one might imagine.

hi:
can you give some more hint about the topic?

in my testing, if the sip phone use G.722 and the sip trunk use G.711,
I can hear the quality is not as good as both side use G.711.

but you maybe right when both legs use G.711 but transcoding in
the middle. the quality seems not so bad but I have test it very
deeper..

thanks a lot for your help!!

Regards,
tbskyd

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services