Automatic terminating a call when call made - asterisk

here is my Console log of asterisk server
[Feb 15 12:17:49] WARNING[3558][C-00000000]: res_rtp_asterisk.c:2141 dtlsetup: Could not set policies when setting up DTLS-SRTP on '0x7fd64400caa0
[Feb 15 12:17:49] WARNING[3558][C-00000000]: res_rtp_asterisk.c:4465 ast_d: RTP Read error: Unspecified. Hanging up.
Channel SIP/7005-00000000 left 'simple_bridge' basic-bridge <222810-4890-bedf-84d549cea2b0>
== Spawn extension (default, 7008, 1) exited non-zero on 'SIP/7005-0000
-- Channel SIP/7008-00000001 left 'simple_bridge' basic-bridge <222810-4890-bedf-84d549cea2b0>
IS Any changes needed in sip.conf ?
in sip.conf
[7005] ; This will be WebRTC client
type=peer ;
username=7005 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=Z-jj! ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=yes ; Asterisk will relay media for this peer
transport=udp,ws,wss,tcp ; Asterisk will allow this peer to register on UDP or WebSockets
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
disallow=all
disallow=all
allow=ulaw
allow=alaw
allow=speex
allow=gsm
dtlsverify=fingerprint
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass
;nat=force_rport,comedia
force_avp=yes

Read error: Unspecified
Check your firewall and NAT settings.

Related

How to make a H.323 trunk in Asterisk 15

I'm trying to make a H.323 trunk in asterisk 15 (in a remote server with Ubuntu server 16 installed) with ooh323 addon, to test if works I've the softphone ekiga on my local machine. But when I call to test it not even entry the call, the Asterisk CLI doesn't show any useful information, infact doesn't show anything and the log always are empty even I put it explicitly in the ooh323.conf.
In simple words,I just want to call a h323 extension and hear the classic "hello world". Here's my configuration:
ooh323.conf:
[general]
port = 1720
bindaddr = 0.0.0.0
disallow=all
allow=alaw
dtmfmode=inband
gatekeeper = DISABLE
context=default
[307]
type=friend
context=default
host=my server ip
port=1720
disallow=all
allow=alaw,g729,gsm,slinear
extension.conf:
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
[default]
exten => _X!,1,Dial(H323/${EXTEN}#307)
exten => _X!,2,Playback(hello-world)
Any help is useful, thanks a lot.
UPDATE:
Now the calls come in, but I get:
chan_ooh323.c:1975 ooh323_onReceivedSetup: Unacceptable ip 187.155.24.149
Any ideas?

Asterisk reached but can't register

I'm new at asterisk and following asterisk example:
sip.conf
[general]
transport=udp
[friends_internal](!)
type=friend
host=dynamic
context=from-internal
disallow=all
allow=ulaw
[demo-alice](friends_internal)
secret=verysecretpassword
qualify=yes
; put a strong, unique password here instead
qualify=yes
[demo-bob](friends_internal)
secret=othersecretpassword ; put a strong, unique password here instead
And this is pjsip.conf:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
;Templates for the necessary config sections
[endpoint_internal](!)
type=endpoint
context=from-internal
disallow=all
allow=ulaw
[auth_userpass](!)
type=auth
auth_type=userpass
[aor_dynamic](!)
type=aor
max_contacts=1
;Definitions for our phones, using the templates above
[demo-alice](endpoint_internal)
auth=demo-alice
aors=demo-alice
[demo-alice](auth_userpass)
password=unsecurepassword ; put a strong, unique password here instead
username=demo-alice
[demo-alice](aor_dynamic)
[demo-bob](endpoint_internal)
auth=demo-bob
aors=demo-bob
[demo-bob](auth_userpass)
password=unsecurepassword ; put a strong, unique password here instead
username=demo-bob
[demo-bob](aor_dynamic)
I used Ekiga softphone to login demo-alice account:
ubuntu*CLI>
-- Added contact 'sip:demo-alice#192.168.0.217:5060' to AOR 'demo-alice' with expiration of 3600 seconds
== Contact demo-alice/sip:demo-alice#192.168.0.217:5060 has been created
== Endpoint demo-alice is now Reachable
-- Contact demo-alice/sip:demo-alice#192.168.0.217:5060 is now Unknown. RTT: 0.000 msec
[Oct 25 16:40:10] WARNING[16587]: res_pjsip_pubsub.c:3134 pubsub_on_rx_publish_request: No registered publish handler for event presence
[Oct 25 16:40:10] WARNING[16587]: res_pjsip_pubsub.c:3134 pubsub_on_rx_publish_request: No registered publish handler for event presence
ubuntu*CLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
demo-alice (Unspecified) D Auto (No) No 0 Unmonitored
demo-bob (Unspecified) D Auto (No) No 0 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]
ubuntu*CLI>
Ekiga show I already registered but Asterisk server didn't.
It said: Reached but status is Unknown or Unmonitored with Unspecified IP. Help!!!
I'm using Ubuntu 16.04 and Asterisk 13.11.2 in Ubuntu server 16.04.
You propably want to use chan_sip OR chan_pjsip.
Check modules.conf to prevent one of them from loading...
In your CLI it seems, ekiga is registered on chan_pjsip.
So try "pjsip show endpoints" (-> chan_pjsip) instead of "sip show peers" (-> chan_sip).

Either the outbound or inbound call only work in asterisk setup, not both. Why?

This is my sip.conf
; inbound configuration
[nexmo-sip]
fromdomain=sip.nexmo.com
type=friend
context=nexmo
insecure=port,invite
nat=no
;Add your codec list here.
; Note: Use "ulaw" for US only, "alaw" for the rest of the world.
allow=ulaw
allow=alaw
allow=G729
dtmfmode=rfc2833
[nexmo-sip-01](nexmo-sip)
host=173.193.199.24
[nexmo-sip-02](nexmo-sip)
host=174.37.245.34
[nexmo-sip-03](nexmo-sip)
host=5.10.112.121
[nexmo-sip-04](nexmo-sip)
host=5.10.112.122
[nexmo-sip-05](nexmo-sip)
host=119.81.44.6
[nexmo-sip-06](nexmo-sip)
host=119.81.44.7
;outbound configuration
[general]
register => <api-key>:<api-secret>#sip.nexmo.com
registerattempts=0
srvlookup=yes
context=nexmo-sip1
[nexmo]
username=<api-key>
host=sip.nexmo.com
defaultuser=<api-key>
fromuser=<myNumber123>
fromdomain=sip.nexmo.com
secret=<api-secret>
type=friend
context=nexmo-sip1
insecure=very
qualify=yes
nat=no
;Add your codec list here.
; Note: Use "ulaw" for US only, "alaw" for the rest of the world.
allow=ulaw
allow=alaw
allow=G729
dtmfmode=rfc2833
[<myNumber123>] ; this number is at soft phone client
type=friend
context=nexmo-sip1
host=dynamic
secret=<myNumber123>
qualify=yes
[<mynumber123456>] ; this is my mobile number
type=friend
context=nexmo-sip1
host=dynamic
secret=<secretkey>
qualify=yes
This is extensions.conf
[general]
live_dangerously=yes
[globals]
[nexmo-sip1]
exten => _X.,1,Dial(SIP/${EXTEN}#nexmo)
[default]
exten => s,1,gosub(nexmo-sip1,${EXTEN},1)
Setting 1: If above is the setting of extensions.conf, I am able to make outbound calls from my soft client, but not able to get inbound calls to that soft client
Setting 2: If I change the settings of extensions.conf as follows, I am able to get incoming calls at softclient, but not able to make outbound calls.
[general]
live_dangerously=yes
[globals]
[nexmo-sip1]
exten => _X.,1,Dial(SIP/${EXTEN},30)
[default]
exten => s,1,gosub(nexmo-sip1,${EXTEN},1)
Question 1) What should I change so that I get both outbound and inbound calls?
Question 2: When I set extensions.conf as in Setting 1, I don't hear the other side, but I hear both the side conversation when extensions.conf is set as in Setting 2. How to fix that? And this is the log I see when I don't hear
[Jul 1 22:50:38] WARNING[11299]: chan_sip.c:4175 retrans_pkt: Retransmission timeout reached on transmission tvK9cRGNN- for seqno 21 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 8383ms with no response
[Jul 1 22:50:38] WARNING[11299]: chan_sip.c:4204 retrans_pkt: Hanging up call tvK9cRGNN- - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
I understand that there are lot of wrong configurations like insecure=very etc. But right now I want to make this prototype to work successfully
To make inbound and outbound calls work, you need to have 2 separate contexts inbound and for outbound.
Try to change your configs in following way, extensions.conf:
[general]
[globals]
[nexmo-sip2]
exten => _X.,1,Dial(SIP/${EXTEN}#nexmo)
[nexmo-sip1]
exten => _X.,1,Dial(SIP/${EXTEN},30)
In sip.conf please leave all what you have, just update lines what I pasted here:
[<myNumber123>] ; this number is at soft phone client
type=friend
context=nexmo-sip2
host=dynamic
secret=<myNumber123>
qualify=yes
[<mynumber123456>] ; this is my mobile number
type=friend
context=nexmo-sip2
host=dynamic
secret=<secretkey>
qualify=yes
As you can see we need to have 2 separate contexts for calls from your SIP extensions(nexmo-sip2) and for calls from your sip provider(nexmo-sip1).

Asterisk and Sipp UAS

I'm trying to get sipp communicate with Asterisk in order to perform
performance tests:
I've been through these steps:
1) In sip.conf
[sippuac]
type=friend
username=sippuac
host=127.0.0.1
port=5061
context=test
dtmfmode=rfc2833
insecure=very
canreinvite=no
nat=yes
[sippuas]
type=friend
username=sippuas
host=127.0.0.1
port=5062
context=test
dtmfmode=rfc2833
insecure=very
canreinvite=no
nat=yes
2) In extensions.conf
[test]
exten=>s,1,Dial(SIP/sippuas,20)
3) Running SIPp
sipp -sn uas -rsa 127.0.0.1:5060 -p 5062 -i 127.0.0.1 -mp 6001
sipp -sn uac 127.0.0.1:5060 -s s -p 5061 -i 127.0.0.1
Finally I get on Asterisk :
[Jun 14 07:36:56] WARNING[2600][C-00000120]: app_dial.c:2437
dial_exec_full: Unable to create channel of type 'SIP' (cause 20 -
Subscriber absent)
How can I solve this and make the UAS receive the calls ?
Thanks for your help !
I think in sip.conf should be type=peer for sippuas.
It is bad idea to run performance test from localhost. SIPP will impact performance of Asterisk. Additionally it make seance to run scenario with audio and I will recommend just answer a call on Asterisk and play some sound, it is not so important to send call out to second sipp.
For receiving calls from asterisk, SIPp user(s) should be registered first to it. You can see if your user is registered or not by using the command:
sip show peers
in the asterisk CLI. If your uas is not registered and you are trying to tell asterisk to dial to a client and not giving the address of it. There are simple xml examples in this link for how to register and make calls to asterisk. Please follow the scenario you want.

Asterisk -- VOIP prepaid account setup (outbound through remote asterisk server)

I have a continental calling card and I'm not sure how to make it possible to dial out with my asterisk server.
It is a VOIP prepaid card. I can call out on a softphone using their server address and my username and password.
I can't figure out my sip.conf or my dial plan.
Here is what I have.
sip.conf:
[continentalcard]
host=continental.com
defaultuser=username ;; user on continental's server
secret=password
register => username:password#continental.com
context=global
[frank]
type=friend
defaultuser=frank ;; user on my local asterisk server
secret=password
host=dynamic
context=internal
extensions.conf:
[global]
CARD=SIP/continentalcard
[internal]
exten => 100,1,Dial(SIP/frank)
same => n,Hangup()
include => continentalcard
[continentalcard] ;; outgoing
exten => _1NXXNXXXXXX,1,Dial(${CARD}/${EXTEN})
I get the following message on the CLI as I try to dial out 1-222-333-4444 (not the real number):
== Using SIP RTP CoS mark 5
-- Executing [12223334444#internal:1] Dial("SIP/frank-00000151", "SIP/continentalcard:12223334444") in new stack
== Using SIP RTP CoS mark 5
[Oct 3 04:02:57] ERROR[22923]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo("continentalcard", "12223334444", ...): Servname not supported for ai_socktype
[Oct 3 04:02:57] WARNING[22923]: chan_sip.c:5866 create_addr: No such host: continentalcard:12223334444
[Oct 3 04:02:57] WARNING[22923]: app_dial.c:2345 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
-- Auto fallthrough, channel 'SIP/frank-00000151' status is 'CHANUNAVAIL'
Update: Filled sip.conf with the global context. Also just noticed your missing a / in extensions.conf. Please look below
You have your sip.conf formatted incorrectly.
[global]
register => username:password#continental.com
context=continentalcard
[continentalcard]
host=continental.com
defaultuser=username
secret=password
context=continentalcard
Registration should be placed under the [global] context in sip.conf.
Context should be continentalcard not global. When the softphone dials 1NXXNXXXXXX it should start using the continentalcard context from extensions and perform the Dial(${CARD}/${EXTEN})

Resources