Instant Message not allowing external calls

Hello!

I’ve configured a messaging system by adding to sip.conf:
accept_outofcall_message=yes
outofcall_message_context=internal

And I’ve added to [internal] in extensions.conf the following:

exten => test1,1,Answer()
exten => test1,2,Dial(SIP/test1,60)
exten => test1,3,Playback(vm-nobodyavail)
exten => test1,4,VoiceMail(test1@main)
exten => test1,5,Hangup()

exten => test2,1,Answer()
exten => test2,2,Dial(SIP/test2,60)
exten => test2,3,Playback(vm-nobodyavail)
exten => test2,4,VoiceMail(test2@main)
exten => test2,5,Hangup()

exten => test3,1,Answer()
exten => test3,2,Dial(SIP/test3,60)
exten => test3,3,Playback(vm-nobodyavail)
exten => test3,4,VoiceMail(test3@main)
exten => test3,5,Hangup()

exten => 8001,1,VoicemailMain(test1@main)
exten => 8001,2,Hangup()

exten => 8002,1,VoicemailMain(test2@main)
exten => 8002,2,Hangup()

exten => 8003,1,VoicemailMain(test3@main)
exten => 8003,2,Hangup()

exten => _.,1,NoOp(SMS receiving dialplan invoked)
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,GotoIf($[“${MESSAGE_SEND_STATUS}” != “SUCCESS”]?
sendfailedmsg)
exten => _.,n,Hangup()
exten => h,1,Hangup()
;
; Handle failed messaging
exten => _.,n(sendfailedmsg),Set(MESSAGE(body)=“[${STRFTIME(${EPOCH},
%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.”)
exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
exten => _.,n,Hangup()
exten => h,1,Hangup()

However, when I do that, whenever my system tries calling, both dialing or being called, the server lashes out lots of warnings:

And calls go straight to “busy”.
Once I disable those lines from the context, all goes back to normal but without messages.
Can someone help me out? I’ve never configured a message system before.

Hi first of all, for the love of XXX do not post screenshots of the console
past it as “Preformatted text”

also do not use this pattern match

please use:

 _X.
_X!
_[0-1a-zA-Z*#]!

also try start using “same”, and way are you answering all calls

exten => test1,1,Dial(SIP/test1,60)
same => n,Playback(vm-nobodyavail)
same => n,VoiceMail(test1@main)
same => n,Hangup()

also you do not need this line

Assuming you meant a-zA-Z, rather than than, effectively, zZ, this is almost as bad as _. It matches all the special extensions.

I gave up on the screenshot, too.

Hello! Sorry for the print,
tried to apply the changes but I got the same problem: Calls are stuck in busy state as soon as i apply this dialplan.

Here is the output:

-- Executing [0991786935@from-internal:1] NoOp("PJSIP/6656-0000003c", "SMS receiving dialplan invoked") in new stack

[2022-06-24 10:39:36] ERROR[21100][C-0000009d]: message.c:1031 msg_func_read: No MESSAGE data found on the channel to read.
– Executing [0991786935@from-internal:2] NoOp(“PJSIP/6656-0000003c”, "To ") in new stack
[2022-06-24 10:39:36] ERROR[21100][C-0000009d]: message.c:1031 msg_func_read: No MESSAGE data found on the channel to read.
– Executing [0991786935@from-internal:3] NoOp(“PJSIP/6656-0000003c”, "From ") in new stack
[2022-06-24 10:39:36] ERROR[21100][C-0000009d]: message.c:1031 msg_func_read: No MESSAGE data found on the channel to read.
– Executing [0991786935@from-internal:4] NoOp(“PJSIP/6656-0000003c”, "Body ") in new stack
[2022-06-24 10:39:36] ERROR[21100][C-0000009d]: message.c:1031 msg_func_read: No MESSAGE data found on the channel to read.
– Executing [0991786935@from-internal:5] Set(“PJSIP/6656-0000003c”, “ACTUALTO=”) in new stack
[2022-06-24 10:39:36] ERROR[21100][C-0000009d]: message.c:1031 msg_func_read: No MESSAGE data found on the channel to read.
– Executing [0991786935@from-internal:6] MessageSend(“PJSIP/6656-0000003c”, “,”) in new stack
[2022-06-24 10:39:36] WARNING[21100][C-0000009d]: message.c:1265 msg_send_exec: A ‘to’ URI is required for MessageSend()
– Executing [0991786935@from-internal:7] NoOp(“PJSIP/6656-0000003c”, “Send status is INVALID_URI”) in new stack
– Executing [0991786935@from-internal:8] GotoIf(“PJSIP/6656-0000003c”, “1?”) in new stack
– Executing [0991786935@from-internal:9] Hangup(“PJSIP/6656-0000003c”, “”) in new stack
== Spawn extension (from-internal, 0991786935, 9) exited non-zero on ‘PJSIP/6656-0000003c’
– Executing [h@from-internal:1] Hangup(“PJSIP/6656-0000003c”, “”) in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/6656-0000003c’

You have a voice call incoming, not a message. A message would be on a special device.

Yes. So, when I put that context into [internal] the messages start working and the calls stop working.
Calls go to busy state.
When I remove it the messages stop working (obviously) and calls start working again, I think the context are mixing up or I’m putting the messages context in the wrong place. As of now it is inside [internal] context. Should I be creating a new context specifically for messages? If so… How do I direct to it?

I believe that is the easiest way.

INVITE sip:6656@172.17.4.213:64349;rinstance=7A94EC82 SIP/2.0
Via: SIP/2.0/UDP 172.17.3.235:39090;rport;branch=z9hG4bKPj3248066f-df7a-4f30-a85e-fdedc3e48c64
From: <sip:172 .17.3.235>;tag=e5e8c277-dd91-4216-81fb-f0c9156c8656
To: <sip:6656@ 172.17.4.213;rinstance=7A94EC82>
Contact: <sip:asterisk@1 72.17.3.235:39090>
Call-ID: 05b2a602-b152-4194-a831-9050819a149a
CSeq: 20675 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Issabel-4.1
Content-Type: application/sdp
Content-Length: 308

v=0
o=- 2030132873 2030132873 IN IP4 172.17.3.235
s=Asterisk
c=IN IP4 172.17.3.235
t=0 0
m=audio 10474 RTP/AVP 8 0 18 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

Sorry, no reference here:

So; When I made a different context, All messages prompted a call attempt to the receiving end, which never is answered and so the message doesn’t go through, I believee it’s detecting as an attempt to call

I don’t know whether your INVITE is incoming or outgoing, but if the latter, I believe Issabel is a distant relative of FreePBX, and, as far as I know, FreePBX does not support out of dialogue messages, except from certain Sangoma phones/soft phones.

Whether or not it is derived from FreePBX, integrating custom code into a GUI system, tends to require quite a detailed understanding of how the code that supports the GUI works.

It looks like support for Issabel may be findable via Community » Issabel.org

That would make sense if I haven’t gotten a way to make it work (even tho it stops all calls), I know how to switch from calls to message and get it working, the thing is that I don’t know how to direct messages to the context messages that I created, so it gets mixed up with context internal

The context to use for messages is configured using the “outofcall_message_context” option in chan_sip.

Solved it!

So this is the solution:

[messages]

exten => _XXXX,1,NoOp(SMS receiving dialplan invoked)
exten => _XXXX,n,NoOp(To ${MESSAGE(to)})
exten => _XXXX,n,NoOp(From ${MESSAGE(from)})
exten => _XXXX,n,NoOp(Body ${MESSAGE(body)})
;exten => _XXXX,n,AGI(chatplan.php,${MESSAGE(from)})
exten => _XXXX,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
exten => _XXXX,n,ExecIf($[“${ACTUALTO}” != “pjsip:${EXTEN}”]?Set(ACTUALTO=pjsip:${EXTEN}))
exten => _XXXX,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
exten => _XXXX,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _XXXX,n,GotoIf($[“${MESSAGE_SEND_STATUS}” != “SUCCESS”]?sendfailedmsg)
exten => _XXXX,n,Hangup()
;; Handle failed messaging
exten => _XXXX,n(sendfailedmsg),NoOp(Sending error to user)
exten => _XXXX,n,Set(SRC=${MESSAGE(from)})
exten => _XXXX,n,Set(DST=${MESSAGE(to)})
exten => _XXXX,n,Set(MSG=${MESSAGE(body)})
exten => _XXXX,n,Set(MESSAGE(body)=“[${STRFTIME(${EPOCH},%d%m%Y-%H:%M:%S)}] Sua mensagem para ${EXTEN} falhou. Destinatário não está on-line”)
exten => _XXXX,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
exten => _XXXX,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
exten => _XXXX,n,MessageSend(${ACTUALFROM},ServiceCenter)
;exten => _XXXX,n,GotoIf($[“${INQUEUE}” != “1”]?startq)
exten => _XXXX,n,Hangup()

;–== end of [messages] ==–;

then I reference that in sip.conf:

[general]
accept_outofcall_message=yes
outofcall_message_context=messages
auth_message_requests=yes

And here’s what was missing:

In my ISSABEL extension configuration, I needed to do this:

That did the trick for me!

Thank you all for your help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.