WebRTC doesnt trigger session_description_created

Godot Version

4.3

Question

When trying to create an offer, I don’t get the session_description_created callback.

I’m using this library: GitHub - godotengine/webrtc-native: The official GDNative WebRTC implementation for non-html exports.

Minimal Reproduction

extends Node2D

func _on_peer1_offer_created() -> void:
	# This never gets called
	print("_on_peer1_offer_created")



func _ready() -> void:
	var peer1 = WebRTCPeerConnection.new()
	# Both version since I found both versions in demos/Github but neither works
	#peer1.session_description_created.connect(_on_peer1_offer_created)
	peer1.connect("session_description_created", _on_peer1_offer_created)
	
	# From the documentation: If this functions returns OK, session_description_created will be called when the session is ready to be sent.
	var peer1offerStatus = peer1.create_offer()
	# This logs to the console: peer1 create_offer: true
	print("peer1 create_offer: ", peer1offerStatus == OK)

If someone else has this issue, this is a better minimal version that works:


extends Node2D

var peer1 = WebRTCPeerConnection.new()
var ch1 = peer1.create_data_channel("chat", {"id": 1, "negotiated": true})

func _on_peer1_offer_created(type: String, sdp: String):
	print("_on_peer1_offer_created")



func _ready():	
	peer1.session_description_created.connect(_on_peer1_offer_created)
	peer1.create_offer()
	peer1.poll()