I have a test and try server running and GS Wave as the Grandstream soft phone on an Iphone 4s. I’m trying to figure out how to use the MessageSend() feature on Asterisk. I managed to send a message from asterisk to the GS Wave soft phone using the example code.
exten => 1111,n,Set(MESSAGE(from)=sip/${CALLERID(num))
exten => 1111,n,Set(MESSAGE(body)=From now on number ${CALLERID(num)} also receives the incoming lines from extension ${HOTDESK_LOGIN} )
exten => 1111,n,MessageSend(sip:5554)
This is working.
I try to figure out how to send a message from one phone to my Asterisk server and from one phone to an other phone. When I try to send a message to my Asterisk server the SIP debug looks like (I changed IP numbers and domain name):
<--- SIP read from UDP:11.11.11.111:49383 --->
MESSAGE sip:asterisk@myserver.nl SIP/2.0
Via: SIP/2.0/UDP 192.168.1.104:49383;branch=z9hG4bK101233472;rport
Route: <sip:myserver.nl:5060;lr>
From: <sip:5554@myserver.nl>;tag=1790228994
To: <sip:asterisk@myserver.nl>
Call-ID: 1897619614-49383-14@BJC.BGI.B.BAE
CSeq: 130 MESSAGE
Contact: <sip:5554@192.168.1.104:49383>
Max-Forwards: 70
User-Agent: Grandstream Wave 1.2.2
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Type: text/plain; charset=UTF-8
Content-Length: 4
test
<------------->
--- (14 headers 1 lines) ---
Sending to 11.11.11.111:49383 (NAT)
Receiving message!
Found peer '5554' for '5554' from 11.11.11.111:49383
Looking for asterisk in test (domain myserver.nl)
<--- Transmitting (NAT) to 11.11.11.111:49383 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.104:49383;branch=z9hG4bK101233472;received=11.11.11.111;rport=49383
From: <sip:5554@myserver.nl>;tag=1790228994
To: <sip:asterisk@myserver.nl>;tag=as18ad80c0
Call-ID: 1897619614-49383-14@BJC.BGI.B.BAE
CSeq: 130 MESSAGE
Server: Asterisk PBX 13.11.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
I added a couple of lines to my dial plan so in the context [test] the extension Asterisk can be found. But it doesn’t seem to help.
asterisk => _XXXX,1, Answer()
asterisk => _XXXX,n NoOp(XXXXXXXXXXXXXXXXX)
asterisk => _XXXX,n NoOp(test test test test)
asterisk => _XXXX,n NoOp(XXXXXXXXXXXXXXXXX)
I searched for info on what the next logical step should be to make it work. I assume that, since GS Wave receives messages using MessageSend() it most be possible to also send message to the Asterisk server and trigger something in the dial plan and to send messages to other extensions/phones.
I’m looking for examples and pointer to relevant info. Thanks in advance.
/EdW