Hello, I have very recently started working with Asterisk with no prior telecom experience whatsoever and generally mediocre network skills. I am in the process of familiarising myself with all of it and to this end have installed an asterisk server on a ubuntu server machine on my desk. My setup is successfull enough that I can call my server using zoiper and do nifty things with the dialplan. However I now need to move on to bigger challenges, and this is where I’m stuck.
I need to write some code for an application that lets me dial a number. So far I have implemented the C# example from voip-info.org and I can connect to my server using AMI. Now that I want to use the Originate action things have gone bad. To clarify, everything is done on local network, my server’s address is .42 while my client’s is .47.
My sip.conf:
[general]
context=default
localnet=0.0.0.0/255.255.255.0
[6003]
type=peer
context=from-internal
host=dynamic
insecure=invite,port
Manager.conf:
[general]
enabled = yes
;webenabled = yes
port = 5038
bindaddr = 0.0.0.0
debug = on
[testDaemon]
secret = *********
deny = 0.0.0.0/0.0.0.0
permit = 192.168.16.47/255.255.255.0
read = all
write = all
Extensions.conf:
[from-internal]
exten = hello,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Wait(1)
same = n,Hangup()
sip show peers:
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
6003 (Unspecified) D Auto (No) No 0 Unmonitored
1 sip peer [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 offline]
The action I send is:
Action: Originate
Channel: SIP/6003@192.168.16.47
Exten: hello
Context: from-internal
Priority: 1
And in return I get three blocks. First:
== Using SIP RTP CoS mark 5
Audio is at 19868
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.16.47:5060:
INVITE sip:6003@192.168.16.47 SIP/2.0
Via: SIP/2.0/UDP 192.168.16.42:5060;branch=z9hG4bK3f71f735
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as1e9966d5
To: <sip:6003@192.168.16.47>
Contact: <sip:anonymous@192.168.16.42:5060>
Call-ID: 36ea99f01a9d10825c15a34721b2cb9c@192.168.16.42:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 14.4.1
Date: Thu, 08 Jun 2017 12:19:47 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 286
v=0
o=root 378028270 378028270 IN IP4 192.168.16.42
s=Asterisk PBX 14.4.1
c=IN IP4 192.168.16.42
t=0 0
m=audio 19868 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv
---
[Jun 8 14:19:47] ERROR[2250]: chan_sip.c:4279 __sip_reliable_xmit: Serious Network Trouble; __sip_xmit returns error for pkt data
-- Called 6003@192.168.16.47
After a little while:
Scheduling destruction of SIP dialog '36ea99f01a9d10825c15a34721b2cb9c@192.168.16.42:5060' in 32000 ms (Method: INVITE)
<-- Examining AMI event: -->
Event: Newchannel
Privilege: call,all
SequenceNumber: 49
File: manager_channels.c
Line: 761
Func: channel_snapshot_update
Channel: SIP/192.168.16.47-00000008
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode:
Context: default
Exten: s
Priority: 1
Uniqueid: 1496924387.8
Linkedid: 1496924387.8
<-- Examining AMI event: -->
Event: VarSet
Privilege: dialplan,all
SequenceNumber: 50
File: manager.c
Line: 1825
Func: manager_default_msg_cb
Channel: SIP/192.168.16.47-00000008
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode:
Context: default
Exten: s
Priority: 1
Uniqueid: 1496924387.8
Linkedid: 1496924387.8
Variable: SIPCALLID
Value: 36ea99f01a9d10825c15a34721b2cb9c@192.168.16.42:5060
<-- Examining AMI event: -->
Event: Newexten
Privilege: call,all
SequenceNumber: 51
File: manager_channels.c
Line: 761
Func: channel_snapshot_update
Channel: SIP/192.168.16.47-00000008
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode:
Context: default
Exten:
Priority: 1
Uniqueid: 1496924387.8
Linkedid: 1496924387.8
Extension:
Application: AppDial2
AppData: (Outgoing Line)
<-- Examining AMI event: -->
Event: DialBegin
Privilege: call,all
SequenceNumber: 52
File: manager_channels.c
Line: 1173
Func: channel_dial_cb
DestChannel: SIP/192.168.16.47-00000008
DestChannelState: 0
DestChannelStateDesc: Down
DestCallerIDNum: <unknown>
DestCallerIDName: <unknown>
DestConnectedLineNum: <unknown>
DestConnectedLineName: <unknown>
DestLanguage: en
DestAccountCode:
DestContext: default
DestExten:
DestPriority: 1
DestUniqueid: 1496924387.8
DestLinkedid: 1496924387.8
DialString: 6003@192.168.16.47
<-- Examining AMI event: -->
Event: Hangup
Privilege: call,all
SequenceNumber: 53
File: manager_channels.c
Line: 761
Func: channel_snapshot_update
Channel: SIP/192.168.16.47-00000008
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode:
Context: default
Exten:
Priority: 1
Uniqueid: 1496924387.8
Linkedid: 1496924387.8
Cause: 0
Cause-txt: Unknown
<-- Examining AMI event: -->
Event: DeviceStateChange
Privilege: call,all
SequenceNumber: 54
File: manager.c
Line: 1825
Func: manager_default_msg_cb
Device: SIP/192.168.16.47
State: INVALID
And finally:
Really destroying SIP dialog '36ea99f01a9d10825c15a34721b2cb9c@192.168.16.42:5060' Method: INVITE
Two things have held my interest but I cannot make anything of either.
First and foremost is of course the ERROR[2250] line. From what I could gather it tends to be a firewall error, but my ports are open on both machines. I could not find anything else useful.
Second is the From: “Anonymous” sip:anonymous@anonymous.invalid line which I have looked into as well to no avail.
Thanks in advance for any help on this problem.