Asterisk: Cannot send Instant messaging using PJSIP (415 Unsupported Media Type)


#1

i have setup a realtime asterisk using PJSIP, i have configured some accounts, i see that they are well registered, but when i try to send Instant message from one peer to another, PJSIP resend Unsupported Media Type herein a trace

MESSAGE sip:user1@mydomain.com SIP/2.0
Via: SIP/2.0/UDP 10.42.0.10:5060;branch=z9hG4bK2754b2334d6baa33fd7459a0abb4ca57
Via: SIP/2.0/TLS 192.168.0.141:41082;branch=z9hG4bKb38169af55b04e81d9ace924f9f77da1343633;rport
From: "U2" <sip:user2@mydomain.com>;tag=2904885357
To: <sip:user1@mydomain.com>
Call-ID: 3c9473f85da212a9584541502acaf750@192.168.0.141
CSeq: 3810 MESSAGE
Max-Forwards: 69
Accept: text/plain,application/im-iscomposing+xml
Content-Type: application/im-iscomposing+xml
Content-Length: 401

<?xml version='1.0' encoding='UTF-8' standalone='no' ?><isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:im-composing iscomposing.xsd" name="{////90927765-7e47-4202-96ec-a31191c895d2}"><state>idle</state><list><entry uri="sip:u1@mydomain.com" cp:copyControl="to" /></list></isComposing>



<--- Transmitting SIP response (526 bytes) to UDP:10.42.0.10:5060 --->

SIP/2.0 415 Unsupported Media Type
Via: SIP/2.0/UDP 10.42.0.10:5060;rport=5060;received=10.42.0.10;branch=z9hG4bK2754b2334d6baa33fd7459a0abb4ca57
Via: SIP/2.0/TLS 192.168.0.141:41082;rport;branch=z9hG4bKb38169af55b04e81d9ace924f9f77da1343633
Call-ID: 3c9473f85da212a9584541502acaf750@192.168.0.141
From: "U2" <sip:user2@mydomain.com>;tag=2904885357
To: <sip:user1@mydomain.com>;tag=z9hG4bK2754b2334d6baa33fd7459a0abb4ca57
CSeq: 3810 MESSAGE
Server: Platform PBX
Content-Length:  0

i have inserted my users like this:

insert into ps_endpoints (id, transport, aors, auth, context, disallow,  allow, direct_media, message_context) values ('user1', 'transport-udp', 'user1', 'user1', 'testing', 'all', 'gsm,alaw,ulaw,g729', 'no', 'astsms');
insert into ps_auths (id,auth_type,md5_cred, realm, username)VALUES ('user1','md5','55528a840cfcd2083966e679c8f968f9','mydomain.com', 'user1');
insert into ps_aors (id, max_contacts) values ('user1', 1);

pjsip tells me that it can’t support application/im-iscomposing+xml, pjsip is supposed to support RFC 3994.

my pjsip.conf

[general]
rtcachefriends = yes

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--;


[global]
type = global
user_agent = Platform PBX

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0

installed pjsip libraries

chan_pjsip.so
func_pjsip_aor.so
func_pjsip_contact.so
func_pjsip_endpoint.so
res_pjsip_acl.so
res_pjsip_authenticator_digest.so
res_pjsip_caller_id.so
res_pjsip_config_wizard.so
res_pjsip_dialog_info_body_generator.so
res_pjsip_diversion.so
res_pjsip_dlg_options.so
res_pjsip_dtmf_info.so
res_pjsip_empty_info.so
res_pjsip_endpoint_identifier_anonymous.so
res_pjsip_endpoint_identifier_ip.so
res_pjsip_endpoint_identifier_user.so
res_pjsip_exten_state.so
res_pjsip_header_funcs.so
res_pjsip_logger.so
res_pjsip_messaging.so
res_pjsip_mwi_body_generator.so
res_pjsip_mwi.so
res_pjsip_nat.so
res_pjsip_notify.so
res_pjsip_one_touch_record_info.so
res_pjsip_outbound_authenticator_digest.so
res_pjsip_outbound_publish.so
res_pjsip_outbound_registration.so
res_pjsip_path.so
res_pjsip_pidf_body_generator.so
res_pjsip_pidf_digium_body_supplement.so
res_pjsip_pidf_eyebeam_body_supplement.so
res_pjsip_publish_asterisk.so
res_pjsip_pubsub.so
res_pjsip_refer.so
res_pjsip_registrar_expire.so
res_pjsip_registrar.so
res_pjsip_rfc3326.so
res_pjsip_sdp_rtp.so
res_pjsip_send_to_voicemail.so
res_pjsip_session.so
res_pjsip_sips_contact.so
res_pjsip.so
res_pjsip_transport_management.so
res_pjsip_xpidf_body_generator.so

What i’m missing?


#2

Neither chan_pjsip or chan_sip support the “application/im-iscomposing+xml” media type. Thus why it responds with unsupported media type. Only “text/plain” is supported.