you can use the attached patch, to avoid the use of sipsak.
try the following lines in your extensions.conf:
exten => 99,1,Answer()
exten => 99,2,Set(_CONTENT-DISPOSITION=desktop)
exten => 99,3,SendText(Testmessage)
the patch is for asterisk 1.2.1 but should work on newer versions.
let me know if it is working for you.
regards
Harald Holzer
> try "sipsak -M -O desktop -B "foo" -s sip:<user>@<registrar> -H <ip of
> registrar>"
>
> the trick is to specify the "-O desktop" parameter + the "-H <ip of
> registrar>" parameter. Sipsak fakes the host-header of the registrar so that
> the Snom thinks it is coming from your Asterisk server, then lets the
> message through to the "desktop" (the display of the phone)
>
> I wasn't kidding about obscure syntax, sipsak is a PITA
>
> -----Original Message-----
> From: Sean Kennedy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 09, 2006 5:01 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [Asterisk-Users] OT: Snom 320, displaying text on the screen
> from *
>
>
> I have that set, but for some reason I get errors when I try sipsak, and
> nothing comes through to the phone:
>
>
>
> sipsak -M -B "test" -s sip:[EMAIL PROTECTED] <sip:[EMAIL PROTECTED]>
> timeout after 500ms
> timeout after 500ms...
>
>
> Some debugging info:
>
>
> [EMAIL PROTECTED] root]# sipsak -vvv -M -B "test" -s sip:[EMAIL PROTECTED]
> <sip:[EMAIL PROTECTED]>
> warning: ignoring -i option when in usrloc mode
> fqdnhostname: 192.168.1.1
> our Via-Line: Via: SIP/2.0/UDP
> 192.168.1.1:34213;branch=z9hG4bK.105fb86e;rport;alias
>
> New message with Via-Line:
> MESSAGE sip:[EMAIL PROTECTED] <sip:[EMAIL PROTECTED]> SIP/2.0
> Via: SIP/2.0/UDP 192.168.1.1:34213;branch=z9hG4bK.105fb86e;rport;alias
> To: sip:[EMAIL PROTECTED] <sip:[EMAIL PROTECTED]>
> Call-ID: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> CSeq: 1 MESSAGE
> Content-Type: text/plain
> Max-Forwards: 70
> User-Agent: sipsak 0.9.5
> From: sip:[EMAIL PROTECTED]:34213;tag=7c8bd47f
> <sip:[EMAIL PROTECTED]:34213;tag=7c8bd47f>
> Content-Length: 4
>
> test
> sending message ...
>
> request:
> MESSAGE sip:[EMAIL PROTECTED] <sip:[EMAIL PROTECTED]> SIP/2.0
> Via: SIP/2.0/UDP 192.168.1.1:34213;branch=z9hG4bK.105fb86e;rport;alias
> To: sip:[EMAIL PROTECTED] <sip:[EMAIL PROTECTED]>
> Call-ID: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> CSeq: 1 MESSAGE
> Content-Type: text/plain
> Max-Forwards: 70
> User-Agent: sipsak 0.9.5
> From: sip:[EMAIL PROTECTED]:34213;tag=7c8bd47f
> <sip:[EMAIL PROTECTED]:34213;tag=7c8bd47f>
> Content-Length: 4
>
> test
> send to: UDP:192.168.1.67:5060
> :
> ignoring MESSAGE retransmission
> timeout after 500 ms
>
>
> So I am at a bit of a loss.
>
> Thanks for your help though, I apprecaite it. :)
>
> Colin Anderson wrote:
>
>
> Trick with Sipsak is you have to change the network port to 5060 or sipsak
> messages never hit the right port. In the web interface, Advaced > Avanced
> Network > Network identity (port): change that to 5060 and you should be
> good assuming you can figure out sipsak's nasty syntax. hth.
>
>
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
diff -ur asterisk-1.2.1.org/channels/chan_sip.c asterisk-1.2.1/channels/chan_sip.c
--- asterisk-1.2.1.org/channels/chan_sip.c 2006-02-05 01:20:39.000000000 +0100
+++ asterisk-1.2.1/channels/chan_sip.c 2006-02-05 20:02:31.000000000 +0100
@@ -888,7 +888,7 @@
static int transmit_reinvite_with_sdp(struct sip_pvt *p);
static int transmit_info_with_digit(struct sip_pvt *p, char digit);
static int transmit_info_with_vidupdate(struct sip_pvt *p);
-static int transmit_message_with_text(struct sip_pvt *p, const char *text);
+static int transmit_message_with_text(struct sip_pvt *p, struct ast_channel *ast, const char *text);
static int transmit_refer(struct sip_pvt *p, const char *dest);
static int sip_sipredirect(struct sip_pvt *p, const char *dest);
static struct sip_peer *temp_peer(const char *name);
@@ -1582,7 +1582,7 @@
return 0;
if (debug)
ast_verbose("Really sending text %s on %s\n", text, ast->name);
- transmit_message_with_text(p, text);
+ transmit_message_with_text(p, ast, text);
return 0;
}
@@ -4226,10 +4226,20 @@
}
/*! \brief add_text: Add text body to SIP message ---*/
-static int add_text(struct sip_request *req, const char *text)
+static int add_text(struct sip_request *req, struct ast_channel *ast, const char *text)
{
+ struct varshead *headp;
+ struct ast_var_t *current;
+
/* XXX Convert \n's to \r\n's XXX */
add_header(req, "Content-Type", "text/plain");
+
+ headp=&ast->varshead;
+ AST_LIST_TRAVERSE(headp,current,entries) {
+ if (!strcasecmp(ast_var_name(current), "CONTENT-DISPOSITION")) {
+ add_header(req, "Content-Disposition", ast_var_value(current));
+ };
+ }
add_header_contentLength(req, strlen(text));
add_line(req, text);
return 0;
@@ -5518,11 +5528,11 @@
}
/*! \brief transmit_message_with_text: Transmit text with SIP MESSAGE method ---*/
-static int transmit_message_with_text(struct sip_pvt *p, const char *text)
+static int transmit_message_with_text(struct sip_pvt *p, struct ast_channel *ast, const char *text)
{
struct sip_request req;
reqprep(&req, p, SIP_MESSAGE, 0, 1);
- add_text(&req, text);
+ add_text(&req, ast, text);
return send_request(p, &req, 1, p->ocseq);
}
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users