I am configuring a test Asterisk server (1.8.9.2) to practice setting a single codec globally, to avoid transcoding as much as possible. Since all of my recordings are in gsm format, I am trying to make the SIP clients use gsm everywhere. I am using Ekiga on Fedora 16 x86_64 for my tests.

[root@elx2 asterisk]# cat /etc/asterisk/sip_general_additional.conf
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications 
to ;
; this file must be done via the web gui. There are alternative files to make   
 ;
; custom modifications, details at: http://freepbx.org/configuration_files      
 ;
;--------------------------------------------------------------------------------;
;

vmexten=*97
faxdetect=yes
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
useragent=FPBX-2.8.1(1.8.9.2)
disallow=all
allow=gsm
allow=alaw
allow=ulaw
allow=g729
allow=g723
allow=g722
allow=speex

I am using the originate command through the Asterisk console to test this. 
With plain SIP/1064, codec negotiation works as expected:

elx2*CLI> channel originate SIP/1064 application playback demo-congrats
elx2*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/1064-00000044    (None)               Up      Playback(demo-congrats)
1 active channel
0 active calls
86 calls processed
elx2*CLI> core show channel SIP/1064-00000044
 -- General --
           Name: SIP/1064-00000044
           Type: SIP
       UniqueID: 1329515589.179
       LinkedID: 1329515589.179
      Caller ID: 1064
 Caller ID Name: device
Connected Line ID: (N/A)
Connected Line ID Name: (N/A)
    DNID Digits: (N/A)
       Language: en
          State: Up (6)
          Rings: 0
  NativeFormats: 0x3c0002 (gsm|h261|h263|h263p|h264)
    WriteFormat: 0x2 (gsm)
     ReadFormat: 0x2 (gsm)
 WriteTranscode: No
  ReadTranscode: No
1st File Descriptor: 17
      Frames in: 153
     Frames out: 385
 Time to Hangup: 0
   Elapsed Time: 0h0m10s
  Direct Bridge: <none>
Indirect Bridge: <none>
 --   PBX   --
        Context: from-internal
      Extension:
       Priority: 1
     Call Group: 0
   Pickup Group: 0
    Application: Playback
           Data: demo-congrats
    Blocking in: ast_waitfor_nandfds
      Variables:
[email protected]:5060

  CDR Variables:
level 1: dnid=
level 1: clid="device" <1064>
level 1: src=1064
level 1: dst=s
level 1: dcontext=from-internal
level 1: channel=SIP/1064-00000044
level 1: lastapp=Playback
level 1: lastdata=demo-congrats
level 1: start=2012-02-17 16:53:09
level 1: answer=2012-02-17 16:53:11
level 1: duration=9
level 1: billsec=7
level 1: disposition=ANSWERED
level 1: amaflags=DOCUMENTATION
level 1: uniqueid=1329515589.179
level 1: linkedid=1329515589.179
level 1: sequence=217

However, when I use Local/XXXX@from-internal to call the same extension, I get 
a different codec:

elx2*CLI> channel originate Local/1064@from-internal application playback 
demo-congrats
elx2*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/1064-00000043    1064@from-internal:1 Up      Playback(demo-congrats)
1 active channel
0 active calls
86 calls processed
elx2*CLI> core show channel SIP/1064-00000043
 -- General --
           Name: SIP/1064-00000043
           Type: SIP
       UniqueID: 1329515478.176
       LinkedID: 1329515478.176
      Caller ID: 1064
 Caller ID Name: device
Connected Line ID: (N/A)
Connected Line ID Name: (N/A)
    DNID Digits: (N/A)
       Language: en
          State: Up (6)
          Rings: 0
  NativeFormats: 0x3c0002 (gsm|h261|h263|h263p|h264)
    WriteFormat: 0x2 (gsm)
     ReadFormat: 0x40 (slin)
 WriteTranscode: No
  ReadTranscode: Yes gsm->slin
1st File Descriptor: 33
      Frames in: 168
     Frames out: 560
 Time to Hangup: 0
   Elapsed Time: 0h0m11s
  Direct Bridge: <none>
Indirect Bridge: <none>
 --   PBX   --
        Context: from-internal
      Extension: 1064
       Priority: 1
     Call Group: 0
   Pickup Group: 0
    Application: Playback
           Data: demo-congrats
    Blocking in: ast_waitfor_nandfds
      Variables:
MACRO_DEPTH=0
BRIDGEPEER=Local/1064@from-internal-49cb;2
DIALEDPEERNUMBER=1064
[email protected]:5060
KEEPCID=TRUE
CWIGNORE=
EXTTOCALL=1064
TTL=64

  CDR Variables:
level 1: dnid=
level 1: clid="device" <1064>
level 1: src=1064
level 1: dst=s
level 1: dcontext=from-internal
level 1: channel=SIP/1064-00000043
level 1: start=2012-02-17 16:51:20
level 1: duration=10
level 1: billsec=0
level 1: disposition=NO ANSWER
level 1: amaflags=DOCUMENTATION
level 1: uniqueid=1329515478.178
level 1: linkedid=1329515478.177
level 1: sequence=215

Why the difference? Is the client really using slin for one half of the stream? 
If so, how can I make it use gsm in the Local case?


--
_____________________________________________________________________
-- 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

Reply via email to