Hi, I am new to asterisk and pjsip, but I have some strange configuration (please, don’t ask why).
I have IP Office (with TTS - special config);
AMI is configured correctly and working.
What I want is, to have a SMS using AMI - to the Avaya IP Office.
For example:
Sms to 202333; from an internal number, which should arrive on avaya.
Endpoints; where Voipie (testingname) is configured as trunk using freepbx
Endpoint: 2222/2222 Not in use 0 of inf
InAuth: 2222-auth/2222
Aor: 2222 1
Contact: 2222/sip:2222@10.0.4.10:5060 52e738c533 Avail 1.087
Endpoint: 2323/2323 Not in use 0 of inf
InAuth: 2323-auth/2323
Aor: 2323 1
Contact: 2323/sip:2323@10.0.4.10:5060 e70d8aea05 Avail 0.771
Endpoint: voipie Not in use 0 of inf
InAuth: voipie/voipie
Aor: voipie 1
Contact: voipie/sip:voipie@10.0.4.10:5060;transport 7b39ff8af0 Avail 1.141
Transport: 0.0.0.0-udp udp 3 96 0.0.0.0:5060
My extensions.conf (custom) has been configured as this;
[from-internal-msg]
exten => _.,1,NoOp(Sending message!)
same => n,NoOp(Message: ${MESSAGE})
same => n,Set(message_body=${CUT(MESSAGE,body=,2)})
same => n,Set(from=${CUT(${FILTER(MESSAGE,from=)},=,2)})
same => n,Set(to=${CUT(${FILTER(MESSAGE,to=)},=,2)})
same => n,NoOp(To ${MESSAGE(to)})
same => n,NoOp(From ${MESSAGE(from)})
same => n,NoOp(Body ${MESSAGE(body)})
same => n,Set(from=${CUT(MESSAGE(from),@,1)})
same => n,Set(from_domain=${CUT(MESSAGE(from),@,2)})
;same => n,Set(from_domain=${CUT(from_domain,;,1)})
same => n,Set(from_domain=${CUT(from_domain,>,1)})
same => n,Set(from_no=${CUT(from,:,2)})
same => n,Set(to=2222)
same => n,Set(to_no=${CUT(to,:,2)})
same => n,Set(dial=${DB(DEVICE/${to_no}/dial)})
same => n,Set(tech=${TOLOWER(${CUT(dial,/,1)})})
same => n,Set(MESSAGE(from)=202333)
same => n,Set(MESSAGE(to)=sip:202333@voipie)
same => n,Set(MESSAGE(body)=This is a TestMessage from ${CALLERID(num)} )
same => n,GotoIf($["${tech}" != “pjsip”]?sendmsg)
same => n,Set(contacts=${PJSIP_AOR(${to_no},contact)})
same => n,While($["${SET(contact=${SHIFT(contacts,)})}" != “”])
same => n,Set(contacturi=${PJSIP_CONTACT(${contact},uri)})
same => n,Set(sipuri=${CUT(contacturi,;,1)})
same => n,Set(to_no=${CUT(contacturi,@,2)})
;same => n(sendmsg),MessageSend(${tech}:${to_no},sip:${from_no}@${from_domain})
;same => n(sendmsg),MessageSend(pjsip:${MESSAGE(to),sip:2323@2222)
same => n(sendmsg),MessageSend(pjsip:voipie@10.0.4.10)
same => n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
same => n,GotoIf($[${EXISTS(${contacturi})}]?:end)
same => n,EndWhile
same => n(end),HangUp()
Logs:
MESSAGE sip:voipie@10.0.4.10:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.0.4.15:5060;rport;branch=z9hG4bKPj23969aed-67d0-45bc-8053-5526bfc21d34
From: <sip:202333@10.0.32.15>;tag=afd20e41-8269-4688-ae20-b0565ebd9699
To: <sip:202333@voipie>
Contact: <sip:2323@10.0.4.15:5060>
Call-ID: 233d0605-b801-4521-8e83-4e6e4cff5051
CSeq: 8113 MESSAGE
Max-Forwards: 70
User-Agent: FPBX-17.0.19.17(21.5.0)
Content-Type: text/plain
Content-Length: 75
-- Executing [h@from-internal-msg:27] NoOp("PJSIP/2222-00000186", "Send status is SUCCESS") in new stack
<--- Received SIP response (423 bytes) from UDP:10.0.4.10:5060 --->
SIP/2.0 405 Method Not Allowed
Via: SIP/2.0/UDP 10.0.4.15:5060;rport;branch=z9hG4bKPj23969aed-67d0-45bc-8053-5526bfc21d34
From: <sip:202333@10.0.32.15>;tag=afd20e41-8269-4688-ae20-b0565ebd9699
Call-ID: 233d0605-b801-4521-8e83-4e6e4cff5051
CSeq: 8113 MESSAGE
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,INFO,NOTIFY,UPDATE
Supported: timer
Server: IP Office 11.0.4.8.0 build 17
Content-Length: 0
To: <sip:202333@voipie>
10.0.4.15 = my asterisk test server
10.0.4.10 = avaya internal test server
What am I missing in order to get this working?