Signal HOLD status to phones that subscribe for status.
authorOlle Johansson <oej@edvina.net>
Thu, 1 Feb 2007 19:04:47 +0000 (19:04 +0000)
committerOlle Johansson <oej@edvina.net>
Thu, 1 Feb 2007 19:04:47 +0000 (19:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53067 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 412ff67..983c484 100644 (file)
@@ -6965,6 +6965,10 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int tim
                pidfnote = "Unavailable";
                break;
        case AST_EXTENSION_ONHOLD:
+               statestring = "confirmed";
+               local_state = NOTIFY_INUSE;
+               pidfstate = "busy";
+               pidfnote = "On hold";
                break;
        case AST_EXTENSION_NOT_INUSE:
        default:
@@ -7060,6 +7064,11 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int tim
                else
                        ast_build_string(&t, &maxbytes, "<dialog id=\"%s\">\n", p->exten);
                ast_build_string(&t, &maxbytes, "<state>%s</state>\n", statestring);
+               if (state == AST_EXTENSION_ONHOLD) {
+                       ast_build_string(&t, &maxbytes, "<local>\n<target uri=\"%s\">\n"
+                                                       "<param pname=\"+sip.rendering\" pvalue=\"no\">\n"
+                                                       "</target>\n</local>\n", mto);
+               }
                ast_build_string(&t, &maxbytes, "</dialog>\n</dialog-info>\n");
                break;
        case NONE: