Asterisk HA with Pacemaker OK, but calls get hangup

Hi!

My setup is Asterisk 11.2 on Debian with Pacemaker 1.1.7 (and its dependent packages: cluster-glue, corosync, resource-agents).
Cluster active-passive
Asterisk in “realtime” managing SIP registrations in external DDBB with ODBC.
Softphones and SIP gateways for analog and ISDN telephony.

In Pacemaker, Asterisk and floating-IP migrate correctly from one node to the other. Every SIP client connects and make calls correctly, no matter where Asterisk is running on (I set up “bindaddr” with the floating IP).

But if there are calls pending before the migration takes place the calls are stopped.

I enter “directmedia = yes” in sip.conf [general] section and at every peer (inside DDBB table) and calls keep getting hangup.

[code][general]
language=es

;;; SIP messaging
accept_outofcall_message = yes
outofcall_message_context = messages
auth_message_requests=no

rtcachefriends = yes
allowguest=no
callcounter = yes

bindaddr = 172.26.50.220 ; floating IP

; canreinvite = yes ; deprecated for directmedia
directmedia = yes
[/code]
I forced both SIP clients to use same codec (confirmed through SIP trace) but same happens.

Any idea what can be wrong?

Could it be the way OCF script stops Asterisk service?
OCF script:

[code] # do a “soft shutdown” via the asterisk command line first
asterisk_rx ‘core stop now’

If “core stop now” didn’t succeed, try SIGTERM

pid=cat $ASTRUNDIR/asterisk.pid
ocf_run kill -s TERM $pid
[/code]

Thanks.

What do I have to look in a SIP trace if I want to check the communication is going straight from phone to phone without passing throguh Asterisk?

Thanks.

Successful re-invites with a comment saying external bridge. It is probably easier to use sip show channel to see if the channel is externally bridged.

Ok, where do I have to look at?

sip show channel:

Curr. trans. direction: Outgoing Call-ID: 4c14f4522394050729f672df0734c094@172.xxx.xxx.xxx:5060 Owner channel ID: SIP/501-00000001 Our Codec Capability: (alaw) Non-Codec Capability (DTMF): 1 Their Codec Capability: (alaw) Joint Codec Capability: (alaw) Format: (alaw) T.38 support No Video support No MaxCallBR: 384 kbps Theoretical Address: 172.xxx.xxx.xxx:56358 Received Address: 172.xxx.xxx.xxx:56358 SIP Transfer mode: open Force rport: No Audio IP: 172.xx.xx.xx (local) Our Tag: as39f4d767 Their Tag: 178467321 SIP User agent: Grandstream GXV3140 Username: 501 Peername: 501 Original uri: sip:501@172.xx.xx.xx:56358 Need Destroy: No Last Message: Tx: ACK Promiscuous Redir: No Route: <sip:501@172.xx.xx.xx:56358> DTMF Mode: rfc2833 SIP Options: (none) Session-Timer: Inactive

It doesn’t show “externally bridge” anywhere. What could be the cause of the communication not being from phone-to-phone?

Thanks.

Indicates that the media is NOT bypassing Asterisk.

Note that many dial application options, and voice recording, etc., are incompatible with direct media as they require access to the main media stream or to dialled digits in the media stream.

Yes, I was dialing with “tk” options.

Thanks. Now I see “Audio IP: Outside bridge”, but if I stop asterisk with “core stop now” the communication stops as well. Is this expected behaviour?

It seems reasonable that Asterisk would try to cleanly close calls, but I haven’t checked the details of the code.

Ok thanks.

If I pause the virtual machine where Asterisk is running the communication keeps going on. But if I “core stop” communication ends.

I believed “directmedia=yes” made Asterisk ‘forget’ about this communication. :frowning: :frowning:

Do you think I should stop with SIGTERM or even SIGKILL then?

I suspect you would need to use SIGKILL, or force the interface down.

(You also need to make sure that the other side is not requesting session timers, or otherwise validating the signalling path.

Thanks, david55. “kill -9” did the trick. :wink:

You could have told me that after my first post!! :stuck_out_tongue: :stuck_out_tongue: