Asterisk HA with Pacemaker OK, but calls get hangup


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.


;;; SIP messaging
accept_outofcall_message = yes
outofcall_message_context = messages

rtcachefriends = yes
callcounter = yes

bindaddr = ; floating IP

; canreinvite = yes ; deprecated for directmedia
directmedia = yes
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/
ocf_run kill -s TERM $pid


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?


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: 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: Received Address: 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?


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: