Summary:ASTERISK-01545: app_sms (sms_handleincoming: Unknown message type 01)
Reporter:scaredycat (scaredycat)Labels:
Date Opened:2004-05-06 06:42:02Date Closed:2011-06-07 14:10:36
Versions:Frequency of
Description:With app_sms I have the following issues - they MAY be down to my understanding of how things should be config'd (except the first).

1. No log (sms) is generated at all in /var/log/asterisk/

2. With SMS(21103,a) when sending from an attached DECT phone (see additional information) with sms capability the following is generated on the * console:

  -- Executing SMS("Zap/2-1", "21103|a") in new stack
   -- SMS TX 93 00 6D 00 00 00...
   -- SMS RX 91 14 01 01 05 81...
May  6 12:14:28 WARNING[1343510]: app_sms.c:673 sms_handleincoming: Unknown message type 01
   -- SMS TX 96 03 00 FF 00 68...
   -- SMS RX 94 00 6C 01 05 81...
   -- Executing Hangup("Zap/2-1", "") in new stack

 No message appears in the /var/spool/asterisk/sms/sc-me.xxxxx/ or /var/spool/asterisk/sms/me-sc.xxxx/ folders - since the message type isn't known. The phone will try 3 times in total before giving up.

3. Generating a call file and placing it in the /var/spool/sms/sc-me.4/ (4 being the exten of the DECT phone) folder then originating a call using:

action: originate
callerid: Hello Hippo <21103>
exten: 4
channel: Local/09110235029
context: smsdial
priority: 1

Results in:

   -- Executing SMS("Local/09110235029@default-1e57,2", "21103||09110235029|Hello Hippo") in new stack
   -- Executing SMS("Local/09110235029@default-1e57,2", "09110235029") in new stack
   -- Sent into invalid extension 's' in context 'default' on Local/09110235029@default-1e57,1
   -- Executing Hangup("Local/09110235029@default-1e57,1", "") in new stack
 == Spawn extension (default, i, 1) exited non-zero on 'Local/09110235029@default-1e57,1'


[root@ASTERISK asterisk]# cat /var/spool/asterisk/sms/me-sc.21103/2004-05-06_12\:31\:29-00
scts=2004-05-06 12:31:29
ud=Hello Hippo

there is no mention of the 'to' from the origination via manager interface... obviously the message never arrives.




Configuration is:

1. Panasonic KX-TCD775E base station (includes 2 handsets)
2. TDM20B card with DECT base station attached to port 1
3. The DECT phone has 3 message centres defined, I just used the first and created an extension with that number:

exten => 09110235029,1,SMS(21103,a)
exten => 09110235029,2,hangup
Comments:By: Brian West (bkw918) 2004-05-06 16:40:23

Reminder sent to revk

Can you take a look at this.


By: revk (revk) 2004-05-06 16:47:33

I'll have a look at the spec - may be a couple of days as I am snowed under.
I think we have one of those, so I may be able test.

By: revk (revk) 2004-05-07 03:00:08

Hang on - message type 1 is an SMS_SUBMIT which comes from a phone.
You are answering with "a" not "as" so you are acting as a phone not a service centre. Try answering with "as" not just "a"

1. If no message actually sent/recieved there will be no log
2. Answer with "sa" not "a" if answering a phone.
3. What are you trying to actually do?

By: scaredycat (scaredycat) 2004-05-07 06:05:40


errm the documentation suggests you can only use a or s  - I didn't realise you could use BOTH.

I'm trying to

a) send a message from a phone to *
b) send a message from * to a phone.

I grabbed the manual for the phone and noticed that is said:

"The phone number for SMS Message Centre 1 is used to SEND a text message while the number for Message Centre 2 is used to RECEIVE a text message."

Is this likely to have any detrimental effect?

Just tested:

exten => 09110235029,2,SMS(21103,as)
exten => 09110235029,3,hangup

and it did generate

[root@ASTERISK sms]# cat me-sc.21103/2004-05-07_11\:55\:02-01
scts=2004-05-07 11:55:02

Which is correct. (ie the message text the originator and the destination are correct), and the log:

[root@ASTERISK sms]# cat /var/log/asterisk/sms
2004-05-07 11:55:02 Y 21103 4 4 HELLO BOB
[root@ASTERISK sms]#

so a) is complete.

So now just the other way around... * to phone...

Once all this is working do you mind if I re-write the documentation?


By: Olle Johansson (oej) 2004-05-07 10:45:53

Another issue: app_sms doesn't compile on *BSD. The timezone variable that you use doesn't exist.

By: sbingner (sbingner) 2004-05-07 19:58:53

Need to see your smsdial context's dialplan, but it looks like you have invalid syntax there too:

-- Executing SMS("Local/09110235029@default-1e57,2", "21103||09110235029|Hello Hippo") in new stack

looks like SMS(21103||09110235029|Hello Hippo) and since you're sending to a phone, you would need it to be: SMS(21103|s|09110235029|Hello Hippo)

By: scaredycat (scaredycat) 2004-05-08 06:51:58


the problem I'm having is getting the sms to the attached DECT phone (on Zap/2):

here is the context smsdial:

exten => _.,2,SMS(${CALLERIDNUM})
exten => _.,3,Hangup

and what is sent via the asterisk manager interface:

action: originate
callerid: Badgers <0161274599>
exten: 4
channel: local/0161274599@smsdial
context: sip
priority: 1

(the number 0161274599 is set in the phone as message center 2 which is apparently for receiving messages)

the exten 4 is

exten => 4,1,Dial(ZAP/2,120,Ttr)

The problem is the phone rings but the sms transfer wont start until i answer it, at which point it can't transfer the message onhook ... iyswim

 -- Executing SMS("Local/0161274599@smsdial-469b,2", "0161274599|s") in new stack
   -- Executing Dial("Local/0161274599@smsdial-469b,1", "ZAP/2|60|Ttr") in new stack
   -- Called 2
   -- Zap/2-1 is ringing
   -- Zap/2-1 is ringing
   -- Zap/2-1 is ringing
   -- Zap/2-1 answered Local/0161274599@smsdial-469b,1
 == Spawn extension (sip, 4, 1) exited non-zero on 'Local/0161274599@smsdial-469b,1'
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- Executing SMS("Zap/2-1", "0161274599|s") in new stack

edited on: 05-08-04 05:55

edited on: 05-08-04 06:52

By: revk (revk) 2004-05-08 10:12:13

I did ont thing the documentation said a and s were exclusive - indeed they cover different independant things so would not implicetely be exclusive.

Asterisk calls phone   s
Phone calls asters     sa
Asterisk calls SMSC    
SMSC calls asterisk    s

Make sense?

Also, I agreem constructing a message to send *to* a phone using SMS with extra arguments would need the 's' (as documented).

Hope that helps.

Quite happy for documentation to be enhanced...

By: scaredycat (scaredycat) 2004-05-09 07:21:04

Ok, that helps, but I'm still not getting anywhere with sending messages TO the phone...

some quick questions:

1) Can I create a file in sc-me.<whatever> and get SMS to deliver it to the phone..

2) Using originate requires each end to answer the call (which is fine for the sms side), but as soon as you answer the line the sms can't be transferred...

3) Has anyone who has the same handsets managed to get delivery working? (ie is this a handset issue)

4) Yes you are correct, the documentation doesn't say you can only use s or a, I just read it as such since there was no mention of combining the two.. sa works great... :D

Thanks again


edited on: 05-09-04 06:18

By: revk (revk) 2004-05-09 07:30:42

1) Yes, you do not have to use SMS to make the file, make one in the sc-me.xxx directory.

2) originate works by each end answering the call anyway - I am not sure there is a transfer. Anyway, in my testing, and as I would recommend, is to make the call to the analogue phone and then call the SMS. The phone has to wait a few hundred ms before sending the first fsk burst and the SMS function answers immediately when called. (Note "a" means that it is in answer mode - i.e. sending first FSK - it actually "answers" the call regardless).

3) We tested on a DECT handset - very similar I think.

4) Good.

P.S. I hear the dutch are doing a similar service now. No idea yet if that meets the ETSI spec.

By: scaredycat (scaredycat) 2004-05-09 08:15:51


re: 2)

Unfortunately my phone just rings and rings... (until answered..

Here is exactly what I'm doing:

exten => _.,2,SMS(${CALLERIDNUM},s)
exten => _.,3,Hangup

as defined in extensions.conf (for this test I'm generating the message on the fly from the originate - the actual intention when I get it working is to use a call file) - My understanding is that priority 1 creates the message and priority 2 actually sends the tones to the phone..

In the manager interface I'm sending:

action: originate
callerid: message text <0161274599>
exten: 4
context: sip
priority: 1
channel: Local/0161274599@smsdial

0161274599 = message centre 2 in the phone

the phone is defined as:

exten =>4,1,Dial(Zap/2,60)

This is the result:

 -- Executing SMS("Local/0161274599@smsdial-2d5a,2", "0161274599|s|0161274599|message text") in new stack
   -- Executing SMS("Local/0161274599@smsdial-2d5a,2", "0161274599|s") in new stack
   -- Executing Dial("Local/0161274599@smsdial-2d5a,1", "ZAP/2|60|Ttr") in new stack
   -- Called 2
   -- Zap/2-1 is ringing
   -- Zap/2-1 answered Local/0161274599@smsdial-2d5a,1
 == Spawn extension (sip, 4, 1) exited non-zero on 'Local/0161274599@smsdial-2d5a,1'
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- SMS TX 92 01 FF 6E 00 00...
   -- Executing SMS("Zap/2-1", "0161274599|s|h|message text") in new stack
   -- Executing SMS("Zap/2-1", "0161274599|s") in new stack
   -- Executing Hangup("Zap/2-1", "") in new stack
 == Spawn extension (smsdial, h, 3) exited non-zero on 'Zap/2-1'
   -- Hungup 'Zap/2-1'

could you supply a working config so that I can establish if it's me or the phone that is the problem



By: revk (revk) 2004-05-09 09:02:31

As I said, I would make the call to the phone and then to SMS, you are still doing it the other way around. It should work, but obviosuly is not.

Also, the log shows you doing the SMS stuff twice! We never see the answer from the phone (i.e. SMS RX). This looks like you are cathing the "h" at the hangup and running SMS again. I suggest you match something like _X. rather than _. to avoid picking up "s", "h", etc in smsdial.

Anyway, we can see that the phone answers and the SMS is sending timeouts (92). The phone is supposed to answser and send a message first. It may be that connecting to SMS first and the the phone is bad as this introduces a delay. This delay is one that is much longer than the phone should take and could mean that just as the phone is trying to send its initial message, SMS is sending a timeout message and so ignoring it.

Trying the call the other way around means the phone has answered, and then SMS is called and will be waiting for the phone.

I suspect that is the answer (as previously suggested).

So, why not try calling the phone and then the SMS
e.g. context: smsdial, channel: zap/2, and see if that works.

Also, I am surprised you are calling from 0161274599 and not a valid length number. The phone will be looking for the delivery type digit, e.g. 1, so why not call from 01612745991 and see if that helps. Mind you, if the phone is in fact answering, then that is probably not the problem.

It may be sensible to re-program the phone to use the BT Text message centre numbers anyway, but you may as well get it working first.

Hope that helps.

By: scaredycat (scaredycat) 2004-05-09 09:18:27

ok, sorted...

it was the 1 missing off the end of the message centre!!!! I just used what was defined in the phone :/

So everything was working fine, I just needed the 1 OMG! Arrrghhh!!

   -- Executing SMS("Zap/2-1", "01612745991|s|01612745991|blah! blah!") in new stack
   -- Executing SMS("Zap/2-1", "01612745991|s") in new stack
   -- SMS RX 93 00 6D 00 00 00...
   -- SMS TX 91 1D 00 0B 81 10...
   -- SMS RX 95 02 00 00 69 00...
   -- SMS TX 94 00 6C 0B 81 10...
   -- Hungup 'Zap/2-1'

Ok, so it's worth adding this to the documentation I think.. Things like 'delivery type digit' isn't something muppets like me would know.. (ok ok maybe I should read the spec) ...

Many thanks indeed revk...

Works for me now .. hurrah!!!!

Oh, and my DECT phones don't ring, not even once, I get the beep for the sms delivery that's all :D


edited on: 05-09-04 08:19

By: Brian West (bkw918) 2004-05-09 10:26:34

Doc improvements needed?

By: scaredycat (scaredycat) 2004-05-09 10:38:32

or a more intelligent user ;)

I'll try to put together some "extra" docs for the less sms aware :)

btw, this works with phones connected to IAXy's too... :)