Call file between two internal sip phones

I’m doing some testing with a very simple setup. 1 asterisk server and 2 grandstream sip phones.

I have the phones set up so that when I dial 100 on one sip phone, I connect to the other phone - this works well.

If I set up a call file to dial the first phone and then the other, the phones are connected, but I hear loud crackling or clicking (sound does carry through between the phones - I can just make out noises from one phone on the other)

For debug information, I have this on the non working connection initiated by the call file

With the working connection between the phones (where I dial the number), the debug is

As near as I can tell, these should be doing the exact same thing, but when initiated by the call file I am getting an error
WARNING[19076]: channel.c:2612 ast_indicate_data: Unable to handle indication 3 for ‘SIP/phone2-081be0c0’

The call file is

Channel: SIP/phone2
MaxRetries: 1
RetryTime: 60
WaitTime: 30
Context: phones
Extension: 200
Priority: 1

The sip.conf is

[general]
context=default
allowoverlap=no
bindport=5060   
bindaddr=10.0.4.1

[phone1]
type=friend
context=phones
host=dynamic

[phone2]
type=friend
context=phones
host=dynamic

My extensions.conf is

[general]
;static=yes
;clearglobalvars=no
autofallthrough=yes

[globals]

[default]
exten => s,1,Verbose(1|Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()

[incoming]

[internal]
exten => 100,1,Verbose(1|Extension PHONE1)
exten => 100,n,Dial(SIP/phone2,30)
exten => 100,n,Hangup()
exten => 200,1,Verbose(1|Extension PHONE2)
exten => 200,n,Dial(SIP/phone1,30)
exten => 200,n,Hangup()
exten => phone1,1,Dial(SIP/phone1,30)
exten => phone1,n,Hangup()
exten => phone2,1,Dial(SIP/phone2,30)
exten => phone2,n,Hangup()

[phones]
include => internal

If in my sip.conf I add the following

disallow=all
allow=ulaw

to the phones (both of them grandstream - a gxp2000 and gxp2020), the call works fine. I still get the same warning message, but the audio works. Any guesses as to why?

I’ve now forced the call to continue through asterisk by adding the H option to dial(), and gone back to using gsm. I still have the original “clicking noises”, but now I have some more error messages.

Now I get a string of errors as shown below.

    -- Attempting call on SIP/phone2 for 200@phones:1 (Retry 1)
       > Channel SIP/phone2-081b6c18 was answered.
    -- Executing [200@phones:1] Verbose("SIP/phone2-081b6c18", "1|Extension PHONE2") in new stack
 Extension PHONE2
    -- Executing [200@phones:2] Dial("SIP/phone2-081b6c18", "SIP/phone1|30|H") in new stack
    -- Called phone1
    -- SIP/phone1-081a00f0 is ringing
[Jan 25 09:30:01] WARNING[20654]: channel.c:2612 ast_indicate_data: Unable to handle indication 3 for 'SIP/phone2-081b6c18'
[Jan 25 09:30:01] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:01] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:01] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:01] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Jan 25 09:30:02] WARNING[20654]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
    -- SIP/phone1-081a00f0 answered SIP/phone2-081b6c18
    -- Packet2Packet bridging SIP/phone2-081b6c18 and SIP/phone1-081a00f0
  == Spawn extension (phones, 200, 2) exited non-zero on 'SIP/phone2-081b6c18'
[Jan 25 09:30:14] NOTICE[20654]: pbx_spool.c:351 attempt_thread: Call completed to SIP/phone2

It still works properly if I disable gsm.